Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp257009lqa; Sat, 27 Apr 2024 00:47:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUdjYeu7dSkdHT8DyExRc6eRZytLcH3DZGo/llGe+zFOGiLyiIiOshsSnb25pAEcfC34jinG+1MJg/YgfE2aTCFLeduEnIIVaB96fO3Mw== X-Google-Smtp-Source: AGHT+IFX4ogTIPqttawi0C6xZ8f38RXH8Gkl4pWtuhTY7Xz42Ma9LCTfMAzWKSlx/bYYavgBPwVx X-Received: by 2002:a50:a408:0:b0:566:2f24:b063 with SMTP id u8-20020a50a408000000b005662f24b063mr3210381edb.23.1714204054318; Sat, 27 Apr 2024 00:47:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714204054; cv=pass; d=google.com; s=arc-20160816; b=bUZC9EJn5qVvma/HcBT3JKrLDcGFWowpERk8+20IwtcS06KJA25EP4DNzRXobfIEGj fLZZ9dwZT0DMBFp9c+r2CNBc7a2oZYi3Ifake0Enp789HaBx965SrPlWGekKSLG7xFqf T2Dl28iyMla5OIrnYGu3dHDGUZ4BQSG+G9Vj5iBmxmryf2Fp0FeU0ilVMox08tqcUcsY BSaOMtwGGKFydsQFUmqsbZhOSg0nK1lmuD/tX2W2PjNt4jBhxEZJr5o3AFBz7ytQ4L4c dNlp4M6um8E3xtX2ksxydL/kB3DQ/O7eB3L8SvHmGIsI89Mt0J0woxNoJXd4PynU67xJ Tn6w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=1XQOe0W2fvgyyCbRrr4EP5dyRtiwQgBA166pk0BfHvU=; fh=5PyzcPnzXdRCs7S0gOn44b5r8y7FG/UZoRDJBbu0d4s=; b=azSorxFe/yj2jJDtuDQemnZ8t6M/JJtHnPBhVYS4SES/wPUOSoW1H0hEMAh3QigXP+ gu+awI/uElZs7epzcisNfzzxnjCYUCmACITG6APBlAg7KuvEO+pOuLU9mWw+sxqPeobx 1AY1psb/bVdAZz7gn4aGmhTBbNIp0WXME4nIM6jMjuLv6ZSYoPsmOwHlqVkIxdp+r5W/ jtZIlDBE0WNC7POjlxDD87+oMMU6BISSzCH+kvXBn8pwJNaaYICS4NR3+F4GI2ajKM1Z u0fzZtDHcNARpggz2xAKcV4HatD3m26MuNHleaG5eO8r5S4QchziiQOWEYRUqgmH0B2z Dv7w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=B1abxB1y; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-160949-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160949-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id o11-20020a509b0b000000b005726deee0absi384077edi.186.2024.04.27.00.47.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Apr 2024 00:47:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160949-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=B1abxB1y; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-160949-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160949-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id DD5EA1F22AF9 for ; Sat, 27 Apr 2024 07:47:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 48F9043AC1; Sat, 27 Apr 2024 07:47:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="B1abxB1y" Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B11A9381C7 for ; Sat, 27 Apr 2024 07:47:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714204047; cv=none; b=qwxgxGkqg3UejAiKZT5t0b3utrorEHMBOh9IIS/kyF+fO2oQoz5jxc8oLqBJSapgIT5A/Xmtq4q01pTyBKUmfr9wmth539TqA1pDk7mhOp4aq7h0iQQuTCoiGmZgmT0YY85BX14vhtJZEXCvgtcTedEzVadKCF3VwS/5jDD8L4s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714204047; c=relaxed/simple; bh=ScodLgb+4xg2kWDzZknab3XdTSYqKr5etPt/jseQvg0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=P9fDyM884A3BTQp9bmfRUDTmmW/VlNiYWt+yGBypK2vrgonMqG76EqzQ9Hc1DRvAxLd0dg3JjHkedhKBcjPffqUU9Bt6Wvg5dhYCDqNrDop4RmwxibjC15lucerISmbDiEL1s40HuXIoD+pCS+umzQyZs5i1Z1KhTXTwwUjzii0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=B1abxB1y; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Received: from [192.168.88.20] (91-154-34-181.elisa-laajakaista.fi [91.154.34.181]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 46E5C842; Sat, 27 Apr 2024 09:46:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1714203989; bh=ScodLgb+4xg2kWDzZknab3XdTSYqKr5etPt/jseQvg0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=B1abxB1y0ckML92jWdI4qQfy+1/H+rURohf7q42zV7bOKbZgBdeV8DI/eW6AnSSwm 0GZjQgWYL0mqacc9hkZAZl/Nhm2zudSiFZ6MLBD7LcW5PcBkFXQYQlnsA1bmX6Fc6k QkhyU+l2tJ17hnUNHvEduICiUK0Vs2hYA8vobJFE= Message-ID: <3d72f876-2bae-495f-8851-bfcce4b827c9@ideasonboard.com> Date: Sat, 27 Apr 2024 10:47:20 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] drm: zynqmp_dpsub: Always register bridge To: Laurent Pinchart , Sean Anderson Cc: linux-arm-kernel@lists.infradead.org, Michal Simek , linux-kernel@vger.kernel.org, Daniel Vetter , David Airlie , dri-devel@lists.freedesktop.org, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann References: <20240308204741.3631919-1-sean.anderson@linux.dev> <222c0245-b8bc-48d8-b4e1-a9fb276774ae@ideasonboard.com> <20240426093053.GB4524@pendragon.ideasonboard.com> From: Tomi Valkeinen Content-Language: en-US Autocrypt: addr=tomi.valkeinen@ideasonboard.com; keydata= xsFNBE6ms0cBEACyizowecZqXfMZtnBniOieTuFdErHAUyxVgtmr0f5ZfIi9Z4l+uUN4Zdw2 wCEZjx3o0Z34diXBaMRJ3rAk9yB90UJAnLtb8A97Oq64DskLF81GCYB2P1i0qrG7UjpASgCA Ru0lVvxsWyIwSfoYoLrazbT1wkWRs8YBkkXQFfL7Mn3ZMoGPcpfwYH9O7bV1NslbmyJzRCMO eYV258gjCcwYlrkyIratlHCek4GrwV8Z9NQcjD5iLzrONjfafrWPwj6yn2RlL0mQEwt1lOvn LnI7QRtB3zxA3yB+FLsT1hx0va6xCHpX3QO2gBsyHCyVafFMrg3c/7IIWkDLngJxFgz6DLiA G4ld1QK/jsYqfP2GIMH1mFdjY+iagG4DqOsjip479HCWAptpNxSOCL6z3qxCU8MCz8iNOtZk DYXQWVscM5qgYSn+fmMM2qN+eoWlnCGVURZZLDjg387S2E1jT/dNTOsM/IqQj+ZROUZuRcF7 0RTtuU5q1HnbRNwy+23xeoSGuwmLQ2UsUk7Q5CnrjYfiPo3wHze8avK95JBoSd+WIRmV3uoO rXCoYOIRlDhg9XJTrbnQ3Ot5zOa0Y9c4IpyAlut6mDtxtKXr4+8OzjSVFww7tIwadTK3wDQv Bus4jxHjS6dz1g2ypT65qnHen6mUUH63lhzewqO9peAHJ0SLrQARAQABzTBUb21pIFZhbGtl aW5lbiA8dG9taS52YWxrZWluZW5AaWRlYXNvbmJvYXJkLmNvbT7CwY4EEwEIADgWIQTEOAw+ ll79gQef86f6PaqMvJYe9QUCX/HruAIbAwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRD6 PaqMvJYe9WmFD/99NGoD5lBJhlFDHMZvO+Op8vCwnIRZ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set=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 26/04/2024 12:30, Laurent Pinchart wrote: > On Fri, Mar 22, 2024 at 08:01:44AM +0200, Tomi Valkeinen wrote: >> On 08/03/2024 22:47, Sean Anderson wrote: >>> We must always register the DRM bridge, since zynqmp_dp_hpd_work_func >>> calls drm_bridge_hpd_notify, which in turn expects hpd_mutex to be >>> initialized. We do this before zynqmp_dpsub_drm_init since that calls >>> drm_bridge_attach. This fixes the following lockdep warning: >>> >>> [ 19.217084] ------------[ cut here ]------------ >>> [ 19.227530] DEBUG_LOCKS_WARN_ON(lock->magic != lock) >>> [ 19.227768] WARNING: CPU: 0 PID: 140 at kernel/locking/mutex.c:582 __mutex_lock+0x4bc/0x550 >>> [ 19.241696] Modules linked in: >>> [ 19.244937] CPU: 0 PID: 140 Comm: kworker/0:4 Not tainted 6.6.20+ #96 >>> [ 19.252046] Hardware name: xlnx,zynqmp (DT) >>> [ 19.256421] Workqueue: events zynqmp_dp_hpd_work_func >>> [ 19.261795] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) >>> [ 19.269104] pc : __mutex_lock+0x4bc/0x550 >>> [ 19.273364] lr : __mutex_lock+0x4bc/0x550 >>> [ 19.277592] sp : ffffffc085c5bbe0 >>> [ 19.281066] x29: ffffffc085c5bbe0 x28: 0000000000000000 x27: ffffff88009417f8 >>> [ 19.288624] x26: ffffff8800941788 x25: ffffff8800020008 x24: ffffffc082aa3000 >>> [ 19.296227] x23: ffffffc080d90e3c x22: 0000000000000002 x21: 0000000000000000 >>> [ 19.303744] x20: 0000000000000000 x19: ffffff88002f5210 x18: 0000000000000000 >>> [ 19.311295] x17: 6c707369642e3030 x16: 3030613464662072 x15: 0720072007200720 >>> [ 19.318922] x14: 0000000000000000 x13: 284e4f5f4e524157 x12: 0000000000000001 >>> [ 19.326442] x11: 0001ffc085c5b940 x10: 0001ff88003f388b x9 : 0001ff88003f3888 >>> [ 19.334003] x8 : 0001ff88003f3888 x7 : 0000000000000000 x6 : 0000000000000000 >>> [ 19.341537] x5 : 0000000000000000 x4 : 0000000000001668 x3 : 0000000000000000 >>> [ 19.349054] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffffff88003f3880 >>> [ 19.356581] Call trace: >>> [ 19.359160] __mutex_lock+0x4bc/0x550 >>> [ 19.363032] mutex_lock_nested+0x24/0x30 >>> [ 19.367187] drm_bridge_hpd_notify+0x2c/0x6c >>> [ 19.371698] zynqmp_dp_hpd_work_func+0x44/0x54 >>> [ 19.376364] process_one_work+0x3ac/0x988 >>> [ 19.380660] worker_thread+0x398/0x694 >>> [ 19.384736] kthread+0x1bc/0x1c0 >>> [ 19.388241] ret_from_fork+0x10/0x20 >>> [ 19.392031] irq event stamp: 183 >>> [ 19.395450] hardirqs last enabled at (183): [] finish_task_switch.isra.0+0xa8/0x2d4 >>> [ 19.405140] hardirqs last disabled at (182): [] __schedule+0x714/0xd04 >>> [ 19.413612] softirqs last enabled at (114): [] srcu_invoke_callbacks+0x158/0x23c >>> [ 19.423128] softirqs last disabled at (110): [] srcu_invoke_callbacks+0x158/0x23c >>> [ 19.432614] ---[ end trace 0000000000000000 ]--- >>> >>> Fixes: eb2d64bfcc17 ("drm: xlnx: zynqmp_dpsub: Report HPD through the bridge") >>> Signed-off-by: Sean Anderson >>> --- >>> >>> drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 6 ++---- >>> 1 file changed, 2 insertions(+), 4 deletions(-) >>> >>> diff --git a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c >>> index 88eb33acd5f0..639fff2c693f 100644 >>> --- a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c >>> +++ b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c >>> @@ -256,12 +256,11 @@ static int zynqmp_dpsub_probe(struct platform_device *pdev) >>> if (ret) >>> goto err_dp; >>> >>> + drm_bridge_add(dpsub->bridge); > > A blank line here would be nice. > >>> if (dpsub->dma_enabled) { >>> 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,9 +287,8 @@ static void zynqmp_dpsub_remove(struct platform_device *pdev) >>> >>> if (dpsub->drm) >>> zynqmp_dpsub_drm_cleanup(dpsub); >>> - else >>> - drm_bridge_remove(dpsub->bridge); >>> >>> + drm_bridge_remove(dpsub->bridge); >>> zynqmp_disp_remove(dpsub); >>> zynqmp_dp_remove(dpsub); >>> >> >> I sent a similar patch: >> >> https://lore.kernel.org/all/20240312-xilinx-dp-lock-fix-v1-1-1698f9f03bac@ideasonboard.com/ >> >> I have the drm_bridge_add() call in zynqmp_dp_probe(), as that's where >> the bridge is set up, so it felt like a logical place. You add it later, >> just before the bridge is used the first time. >> >> I like mine a bit more as it has all the bridge code in the same place, >> but I also wonder if there might be some risks in adding the bridge >> early (before zynqmp_disp_probe()), although I can't see any issue right >> away... > > Seems we have the same concerns :-) I've reviewed your patch and wrote > pretty much the same. I would be more comfortable with this version, > even if I like gathering all bridge code in the same location. I guess there's no reason to take the risk here, so I have pushed this one to drm-misc-next. Tomi >> In any case, as this works for me too: >> >> Reviewed-by: Tomi Valkeinen > > Reviewed-by: Laurent Pinchart >