From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 5AADA3B52FA for ; Tue, 29 Sep 2026 21:27:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790717230; cv=none; b=uwde3oF2hFEmzoJ1KvaI3JKtjLdjqH8qOuNkV0g/RTMKAonc+I6fO9DLLzue+Cf28ki/U71z79nHp6n306uIe6Kdc+IS5Z3GJIjgMnCYGF81CjIqSctOhI70PcmpPhQdXY1u/KkyDWOIwBtufQ1do4V2QjIGsMicgIB2XZVBGXg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790717230; c=relaxed/simple; bh=tyCWPKcs7/u/awFV7vdEON0Q6Y8m/fWoaG5L+nCraDc=; h=Mime-Version:Content-Type:Date:Message-Id:From:Subject:Cc:To: References:In-Reply-To; b=MChE3Sf4Ya27BugJVGmNELfjOp6X8iWxEbS0xZXzBYxapkaczs0FbxQkDGIvZ0HBoGhclQvvsFNJjSoNsJA6n5MOVdYtcQ00TQ6Cyp1NCnLecf8fpb6xVykKDTlwpujyiNXH9dDswi2/lv2cX3Uha9CH9YOufw9bqgQZqI9ceg8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=hEDAHwYa; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="hEDAHwYa" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 9F2604E410BD; Tue, 29 Sep 2026 21:27:05 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 527F9601BD; Tue, 29 Sep 2026 21:27:05 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 42A3E103295D5; Tue, 29 Sep 2026 23:26:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1790717218; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=tyCWPKcs7/u/awFV7vdEON0Q6Y8m/fWoaG5L+nCraDc=; b=hEDAHwYakn5fRG4BUqIJO2Nc30p4PMlNz2fj/hv9u5oIYxFTNITCpy13PVRNtyY3TfIP4D k7jJU1roWG08YKb+1I8DM4KpYXcjGdkvBVVnmNFMn5+EBn9jC6Uh0jXXV5PKV+GhHpJQsT S9iWGlmrD0ZOKOKCkpyyRoR7Ao382WBj9MX7dbQoYWZHjooOEl+IQvBYTAOTixSWzsHJc9 e5d+9lXIl5FrPOnUx1GVztDB5fjD4JBjpieZrAZa/M4aJuOhVPcFY0tDHEAl5pfc5S6c9p WxdZmPtYu1kfOZIBzqMvqblrCge95WF2E0SmMoPMsQqDkPM0SRajhSjVeMKaHg== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 29 Sep 2026 23:26:43 +0200 Message-Id: From: "Luca Ceresoli" Subject: Re: [PATCH v2 2/7] drm: verisilicon: stop using deprecated devm_drm_of_get_bridge() Cc: "Arnd Bergmann" , "Doug Anderson" , "Hui Pu" , "Ian Ray" , "Thomas Petazzoni" , , , , , , "kernel test robot" To: "Icenowy Zheng" , "Luca Ceresoli" , "Maarten Lankhorst" , "Maxime Ripard" , "Thomas Zimmermann" , "David Airlie" , "Simona Vetter" , "Frank Li" , "Sascha Hauer" , "Pengutronix Kernel Team" , "Fabio Estevam" , "Andrzej Hajda" , "Neil Armstrong" , "Robert Foss" , "Laurent Pinchart" , "Jonas Karlman" , "Jernej Skrabec" , "Dave Stevenson" , =?utf-8?q?Ma=C3=ADra_Canal?= , "Raspberry Pi Kernel Maintenance" , "Geert Uytterhoeven" X-Mailer: aerc 0.22.0 References: <20260929-drm-fix-of_get_bridge-build-regression-v2-0-6da431d8f180@bootlin.com> <20260929-drm-fix-of_get_bridge-build-regression-v2-2-6da431d8f180@bootlin.com> In-Reply-To: X-Last-TLS-Session-Version: TLSv1.3 Hello, On Tue Sep 29, 2026 at 4:42 PM CEST, Icenowy Zheng wrote: > =E5=9C=A8 2026-09-29=E4=BA=8C=E7=9A=84 15:39 +0200=EF=BC=8CLuca Ceresoli= =E5=86=99=E9=81=93=EF=BC=9A >> devm_drm_of_get_bridge() is deprecated, switch to >> of_drm_get_bridge_by_endpoint(). As of_drm_get_bridge_by_endpoint() >> returns >> a refcounted bridge, ensure it is put by using bridge.next_bridge. >> >> Fixes build failure when CONFIG_OF is disabled. >> >> Fixes: aa8a8c7e4641 ("drm/bridge: panel: move all code to >> drm_panel.c") >> Reported-by: Arnd Bergmann >> Closes: >> https://lore.kernel.org/r/20260928161605.2271412-1-arnd@kernel.org >> Reported-by: kernel test robot >> Closes: >> https://lore.kernel.org/oe-kbuild-all/202609291109.OIsGTysr-lkp@intel.co= m/ >> Closes: >> https://lore.kernel.org/oe-kbuild-all/202609290408.BOs7sk55-lkp@intel.co= m/ >> Signed-off-by: Luca Ceresoli > > Checked the code in drm_bridge.c, and it looks like the lifetime of > next_bridge should be indirectly managed by devm when > devm_drm_bridge_alloc() successes and the next_bridge field assigned, > so the only explicit put needed here should be in the alloc failure > path. Exactly. I think vs_bridge_init() could be simplified a bit by moving the 'next =3D ...;' statement (with error management trailer) to after devm_drm_bridge_alloc. This would avoid the explicit drm_bridge_put() call added by this patch. However for this regression fix I preferred to keep the diff minimal. The cleanup mentioned above can be done later. > Reviewed-by: Icenowy Zheng Thanks for reviewing! >> Changes in v2: >> - fix bridge reference leak on attach error path > > It should be `bridge alloc error` instead of `attach error`, but I > don't know how to correct the error in the changelog, and anyway it > won't be part of the final commit. Ah, right, that's a copy-paste leftover. It's correct that it won't appear in the commit, so I won't sent a new iteration for this. Luca -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com