From patchwork Tue Mar 12 08:51:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 13589624 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 1B9BAC54E58 for ; Tue, 12 Mar 2024 08:52:15 +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:Cc:To:Message-Id:MIME-Version:Subject: Date:From: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=9IG/p/ErJ0TgYD4yWe5jjmZM5pSBwNO0YmCGj+l4GPE=; b=TvmeWmRPdglGWd I9AGQR36lsml/xXoTzMfyQtIw4sys+xZHxpmUUtrLa9t+NkmOSNyqeStwSgBFNF8uTA+yF3nRmzgZ aBcUdRQ3YvEf11e4VPKhHRvYoYTfDx3Y8rKEDZ2SlMEqk6eKcy6+HS2T8YvW9A5LkyIxChMJy0xq9 F8KBi2TLOAE6waQZFlekngy4tz4BAamWbaaU8JUOnBi+5QVx4UYG/ABxLCShZg0004k5qurMdV1l8 UkXdpU/Ac40+AzpJATMYWJk3ropDaDJwG5HrRkKFhkwQBD3Q6EEvfZT+tk/01iptbvDIQZsTyGNVa /FiOR4/vtWJKKw74zCOg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rjxrc-00000004xyE-478a; Tue, 12 Mar 2024 08:52:00 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rjxra-00000004xxF-21FF for linux-arm-kernel@lists.infradead.org; Tue, 12 Mar 2024 08:51:59 +0000 Received: from [127.0.1.1] (91-154-34-181.elisa-laajakaista.fi [91.154.34.181]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 886C4593; Tue, 12 Mar 2024 09:51:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1710233495; bh=RfrIGaUBPnbxtPJtTaj/4+KTrkxzufzY4u5uqIdEyU8=; h=From:Date:Subject:To:Cc:From; b=UrKSoBLkxrE3FL9dpcS1/wHgC4DMquLE+rPATQL4ge5BOqKV2hNh8smPFer0IFw8I oMwI5pAwt/1UhUTSDFvHTXS2Rkqne8Z6I7vjXyrELiO8rxVZzArKnReOQJwYT0n4K5 8naEIg2TA1BVItx70DEVlYfbsU0nGnCpqeI5tapI= From: Tomi Valkeinen Date: Tue, 12 Mar 2024 10:51:15 +0200 Subject: [PATCH] drm: xlnx: zynqmp_dpsub: Fix missing drm_bridge_add() call MIME-Version: 1.0 Message-Id: <20240312-xilinx-dp-lock-fix-v1-1-1698f9f03bac@ideasonboard.com> X-B4-Tracking: v=1; b=H4sIAIIX8GUC/x2MWwqAIBAArxL73UI+qOgq0YfaWkuhoRBCdPekz xmYeSBTYsowNQ8kujlzDBVE24DbTdgIea0MspO6U0Ji4ZNDwfXCM7oDPRd0vh+9VmawxkINr0R V/9N5ed8Pcj6vNGQAAAA= To: Laurent Pinchart , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Michal Simek Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Vishal Sagar , Anatoliy Klymenko , Tomi Valkeinen X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2155; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=RfrIGaUBPnbxtPJtTaj/4+KTrkxzufzY4u5uqIdEyU8=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBl8BerpDiidFHriMiQ8qBqGpJ/sDPilBS3NJYJG asciSzP70WJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZfAXqwAKCRD6PaqMvJYe 9XhqD/4t9ODyal7897NogGZr9Qx6/BNvtuh6yDE22u9RP2D5IXxBkS+ZV2g2WrXcA1rbmBMMbhu AOoG7h9mMHSN/DpJA0pp4CWfIDKjjab12seg+YE8WeDWGLsQ/k2xHyvT2fGAIibAhDbrk86DbAd alu8NqJjZPjwR3GF1icpdIrlfgzony8SsFHMTFrEtDzJ1EQLH0bjJQCFOaOKpXJxNsgXXaJqwuq YZOHZ7XJjEORV5NOALJHtfqbex6Lybin0GpHcE+Yh87H01klt3NxLbSj+506N5l4q79eBZJljXP QKSmhMHr/U+ogKiGA+P9Xl4pKemmwyeobrj34Am3dS4V/DCqL6wWUjVfjbboEvv3H8mJ7myj9Gc aTVfmfXGPbP1FC+HLHLsDIwNc2VKncRJndl7CSQvlBfnqO3Md1wV1JmtJ5xpQ1JgOUlrgJGtIkx cJ6olat6TUBucN9Rr+Z07vwLzsuVz+0pjI5LuyjAfbV0/VT8SKJnBqFxFlzblp0vHtU8qZS8EOi zMT7kigXgLs+qa40HxcjnLoGV2Mhg5v8zlXy/DhMhBydBHcv5IZgVJx4ePbkoRR4aTbtRoRdhe5 vVy0pbk1nx72atH/1BSaAARPKfUzZucy59HAGOevojuuWpqdSsduRGQcWA7tK9pXtjrdYYPiOWs xCIh9aNdVo6+3lA== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240312_015158_697998_08649B93 X-CRM114-Status: GOOD ( 11.66 ) 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 The driver creates a bridge, but never calls drm_bridge_add() when non-live input is used. This leaves the bridge's hpd_mutex uninitialized, leading to: WARNING: CPU: 0 PID: 9 at kernel/locking/mutex.c:582 __mutex_lock+0x708/0x840 Add the bridge add & remove calls so that the bridge gets managed correctly. Signed-off-by: Tomi Valkeinen Fixes: 561671612394 ("drm: xlnx: zynqmp_dpsub: Add support for live video input") --- drivers/gpu/drm/xlnx/zynqmp_dp.c | 4 ++++ drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) --- base-commit: e8f897f4afef0031fe618a8e94127a0934896aba change-id: 20240312-xilinx-dp-lock-fix-cf68f43a7bab Best regards, diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp_dp.c index a0606fab0e22..9f750740dfb8 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_dp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c @@ -1761,6 +1761,8 @@ int zynqmp_dp_probe(struct zynqmp_dpsub *dpsub) dpsub->dp = dp; + drm_bridge_add(dpsub->bridge); + dev_dbg(dp->dev, "ZynqMP DisplayPort Tx probed with %u lanes\n", dp->num_lanes); @@ -1789,4 +1791,6 @@ void zynqmp_dp_remove(struct zynqmp_dpsub *dpsub) zynqmp_dp_phy_exit(dp); zynqmp_dp_reset(dp, true); + + drm_bridge_remove(dpsub->bridge); } diff --git a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c index 88eb33acd5f0..3933c4f1a44f 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c +++ b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c @@ -260,8 +260,6 @@ static int zynqmp_dpsub_probe(struct platform_device *pdev) ret = zynqmp_dpsub_drm_init(dpsub); if (ret) goto err_disp; - } else { - drm_bridge_add(dpsub->bridge); } dev_info(&pdev->dev, "ZynqMP DisplayPort Subsystem driver probed"); @@ -288,8 +286,6 @@ static void zynqmp_dpsub_remove(struct platform_device *pdev) if (dpsub->drm) zynqmp_dpsub_drm_cleanup(dpsub); - else - drm_bridge_remove(dpsub->bridge); zynqmp_disp_remove(dpsub); zynqmp_dp_remove(dpsub);