From patchwork Fri May 3 21:54:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 13653504 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 80EC2C4345F for ; Fri, 3 May 2024 21:55:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:Cc:To:From:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=2FHOKebwLhqnoOfFV6bgSWzJ0zTZXNZKd3qFBay98Io=; b=hH3XhEa6UgS+J/ nTeBg1loIwxsVV1qre/0E+VFgrsXg9W+UlrFnSye+Z1ZNxk/A8fPt9f5rxDRMKNhfBtMe6+NeCvLX Wn2pxGX5ZLTEeAaT6AAX4fY9XMPpgVJBdX4HZHzVYHowcneflwfwowDIJEqgPjuZhZKvUotDv2xSL LgZQteWoP0U8COh0my69rVbEeEN4/JZgM1WYNARPK8JK8GhshNzte7MMNfbd9bEO+1imbCmzyw7+G PvMPTJMeZVFLpAUp6oSR9ccgBapZslDQyKwfHvhiiCxmLgr+H4yxH6eu9HDK7LEURbwui9n3tWa8Y zYLZOIn7b/eHeLsbkF5A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s30rd-00000000WKv-0kGt; Fri, 03 May 2024 21:54:45 +0000 Received: from out-177.mta1.migadu.com ([2001:41d0:203:375::b1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s30ra-00000000WJD-059c for linux-arm-kernel@lists.infradead.org; Fri, 03 May 2024 21:54:43 +0000 Message-ID: <4d8f4c9b-2efb-4774-9a37-2f257f79b2c9@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1714773279; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y2853ucShxPVH0hhzsUqBU7LM1cSh77nnSWLF2uYAqA=; b=BUWeOsA0/2P3mrUoipdI59mfx6Z9ZUqxsBff025rLQpEMITgxHTVZ9dS4dduZnDjzKTEro XU4Ed7K+d42hYYAzzakJTGxl8KrH96WgPonVvNjx5kzSPgPWWM0bKgWSWMzhu0Jz8EPgHO QY6+6RvZNTzEX4zO2GBvJ6cb93DDs5M= Date: Fri, 3 May 2024 17:54:32 -0400 MIME-Version: 1.0 Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Sean Anderson To: Laurent Pinchart , Tomi Valkeinen Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Michal Simek , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [BUG] drm: zynqmp_dp: Lockup in zynqmp_dp_bridge_detect when device is unbound X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240503_145442_335892_C283D759 X-CRM114-Status: GOOD ( 13.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, I have discovered a bug in the displayport driver on drm-misc-next. To trigger it, run echo fd4a0000.display > /sys/bus/platform/drivers/zynqmp-dpsub/unbind The system will become unresponsive and (after a bit) splat with a hard LOCKUP. One core will be unresponsive at the first zynqmp_dp_read in zynqmp_dp_bridge_detect. I believe the issue is due the registers being unmapped and the block put into reset in zynqmp_dp_remove instead of zynqmp_dpsub_release. This could be resolved by deferring things until zynqmp_dpsub_release (requiring us to skip devm_*), or by adding a flag to struct zynqmp_dp and checking it before each callback. A subsystem-level implementation might be better for the latter. For a better traceback, try applying the below patch and running the following commands before triggering the lockup: echo 4 > /sys/module/drm/parameters/debug echo 8 > /proc/sys/kernel/printk diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp_dp.c index 9df068a413f3..17b477b14ab5 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_dp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c @@ -296,6 +296,7 @@ struct zynqmp_dp_config { * @train_set: set of training data */ struct zynqmp_dp { + unsigned long long magic; struct device *dev; struct zynqmp_dpsub *dpsub; void __iomem *iomem; @@ -1533,6 +1534,8 @@ static enum drm_connector_status zynqmp_dp_bridge_detect(struct drm_bridge *brid u32 state, i; int ret; + WARN_ON(dp->magic != 0x0123456789abcdefULL); + /* * This is from heuristic. It takes some delay (ex, 100 ~ 500 msec) to * get the HPD signal with some monitors. @@ -1723,6 +1726,7 @@ int zynqmp_dp_probe(struct zynqmp_dpsub *dpsub) if (!dp) return -ENOMEM; + dp->magic = 0x0123456789abcdefULL; dp->dev = &pdev->dev; dp->dpsub = dpsub; dp->status = connector_status_disconnected; @@ -1839,4 +1843,5 @@ void zynqmp_dp_remove(struct zynqmp_dpsub *dpsub) zynqmp_dp_phy_exit(dp); zynqmp_dp_reset(dp, true); + dp->magic = 0xdeadbeefdeadbeefULL; }