From mboxrd@z Thu Jan 1 00:00:00 1970 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 CCFD7C02198 for ; Mon, 10 Feb 2025 17:30:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EBi7fvn5PPMEBAZTEI/oc6Td7Rh4Sp2q4DZSjZkWn5Q=; b=I5s7JiEZV20mBN p3w45WebIJQvHqlJwyy+5YYSTNPTQVYTkuin1MirFwloH+R/ZE9uKhcKVrVC7nTKeNtfXeUqlOcYD IaHtdGLF+GFqs4dpU+E2iBVchxkbX45BPZCEKalDvjdiFlxw37j6e6bvVFqDoNSDcJ4lKqTz9N69y G/D2frHbwswi+DSk0VyIaY2IbxCHA0LtPGm9992PYlDR7A9LcKuO3VjbpH9aZ9a1gzffghn3cANkL fTFUuhDd9MNriqWLSQp88AeuQA6kc4NqPpZyOyxnTY5TbdBBgqKCKT8TLLg6IUPAcwllRCN0aMPK7 R6oXP3e4I4N0wAXnw+Mw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1thXbf-00000000jS6-25eF; Mon, 10 Feb 2025 17:30:03 +0000 Received: from relay4-d.mail.gandi.net ([2001:4b98:dc4:8::224]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1thXK9-00000000fjL-3Z5J for linux-arm-kernel@lists.infradead.org; Mon, 10 Feb 2025 17:11:59 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 4B7494444B; Mon, 10 Feb 2025 17:11:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1739207512; 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: in-reply-to:in-reply-to:references:references; bh=EBi7fvn5PPMEBAZTEI/oc6Td7Rh4Sp2q4DZSjZkWn5Q=; b=HpNC6MszIjG0ugXiyEhvQs4v3jS2z7Yroa5mVAn5qc57Kia7NGiNVDk0PWzfpcWNnahBOI /YoO/HuOmSmTzr6+0nOn+OvXx+E5ngH/PbqMHYZO2j4Xx6n+nv3eo0PTeqLKO79zjJsESJ LWom8BhaSJ3Iab3vkrbhMHvkx/OMDlh9ESnLLl0wmIVPzHbOky4fGmOzRFxREzLdgkZpZM MKoiqwO1h/OuCIAlTMdD3uoImTAd6YyQBX27Ep8axqL71HvQ/aR7wzyLIvmu1MmEwWn6Sp u+xDLsPTc0nTBcbvNHeWCa8V6FQu5zyT3ba4QdbAkV+hux/PwofN4rrvRidlDg== Date: Mon, 10 Feb 2025 18:11:46 +0100 From: Luca Ceresoli To: Dmitry Baryshkov Subject: Re: [PATCH v6 08/26] drm/bridge: panel: add a panel_bridge to every panel Message-ID: <20250210181146.232df79d@booty> In-Reply-To: References: <20250206-hotplug-drm-bridge-v6-0-9d6f2c9c3058@bootlin.com> <20250206-hotplug-drm-bridge-v6-8-9d6f2c9c3058@bootlin.com> <20250207095428.244f0f91@booty> Organization: Bootlin X-Mailer: Claws Mail 4.3.0 (GTK 3.24.43; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdefkeeigecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepfffhvfevuffkjghfohfogggtgfesthejredtredtvdenucfhrhhomhepnfhutggrucevvghrvghsohhlihcuoehluhgtrgdrtggvrhgvshholhhisegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeeglefffefghefhtddvfeeufeeiveekgffgleekieduteekkeetvdehudekgfdvvdenucffohhmrghinhepsghoohhtlhhinhdrtghomhenucfkphepvdgrtddvmeeijedtmedvtddvtdemvggrtddumegsvgegudemleehvgejmeefgeefmeeludefvgenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvrgdtvdemieejtdemvddtvddtmegvrgdtudemsggvgedumeelhegvjeemfeegfeemledufegvpdhhvghlohepsghoohhthidpmhgrihhlfhhrohhmpehluhgtrgdrtggvrhgvshholhhisegsohhothhlihhnrdgtohhmpdhnsggprhgtphhtthhopeefjedprhgtphhtthhopegumhhithhrhidrsggrrhihshhhkhhovheslhhinhgrrhhordhorhhgpdhrtghpthhtohepshhimhhonhgrsehffhiflhhlrdgthhdprhgtphhtthhopehinhhkihdruggrvgesshgrmhhsuhhnghdrtghom hdprhgtphhtthhopehjrghgrghnsegrmhgrrhhulhgrshholhhuthhiohhnshdrtghomhdprhgtphhtthhopehmrdhsiiihphhrohifshhkihesshgrmhhsuhhnghdrtghomhdprhgtphhtthhopegtrghtrghlihhnrdhmrghrihhnrghssegrrhhmrdgtohhmpdhrtghpthhtohepfihilhhlsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehshhgrfihnghhuoheskhgvrhhnvghlrdhorhhg X-GND-Sasl: luca.ceresoli@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250210_091158_035955_B00AFDD8 X-CRM114-Status: GOOD ( 22.04 ) 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: , Cc: Alexandre Belloni , =?UTF-8?B?SGVy?= =?UTF-8?B?dsOp?= Codina , Thomas Petazzoni , linux-doc@vger.kernel.org, Catalin Marinas , Paul Kocialkowski , dri-devel@lists.freedesktop.org, Claudiu Beznea , Laurent Pinchart , Andrzej Hajda , David Airlie , Fabio Estevam , Marek Szyprowski , Simona Vetter , Robert Foss , Jonathan Corbet , Sam Ravnborg , Jernej Skrabec , Daniel Thompson , Jagan Teki , Jessica Zhang , Thomas Zimmermann , Will Deacon , Jonas Karlman , Sascha Hauer , Maarten Lankhorst , Maxime Ripard , Inki Dae , linux-arm-kernel@lists.infradead.org, Neil Armstrong , Boris Brezillon , linux-kernel@vger.kernel.org, Paul Kocialkowski , Pengutronix Kernel Team , Shawn Guo Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Dmitry, On Fri, 7 Feb 2025 21:43:26 +0200 Dmitry Baryshkov wrote: > > > > @@ -1018,6 +1067,11 @@ struct drm_bridge *devm_drm_panel_bridge_add_typed(struct device *dev, > > > > { > > > > struct drm_bridge **ptr, *bridge; > > > > > > > > + if (panel->bridge) { > > > > + DRM_DEBUG("panel %s: returning existing bridge=%p", dev_name(dev), panel->bridge); > > > > + return panel->bridge; > > > > + } > > > > > > Shouldn't the rest of the function also be removed as you do in other > > > cases? > > > > Indeed it should. > > > > And even more, I now realize drm_panel_bridge_add_typed() should also > > become a simple 'return panel->bridge', like its devm and drmm > > variants, and its code, implementing the actual creation of a panel > > bridge, move to an internal function. Otherwise this patch is a bug: > > existing drivers which do call drm_panel_bridge_add_typed() would end > > up in having two panel_bridges for the same panel. > > > > I must say the process of developing this patch together with the > > hotplug work was "convoluted" to say the least, which probably explains > > why this got unnoticed so far. > > That's why I suggested to post this series separately - it saves you > from rebasing hotplug work on top. Yes, that's sure, but not keeping my hotplug patches on top of the panel_bridge ones makes it much harder for me to test on real hardware, so each way has pros and cons. However I might send only the panel_bridge patches at the next iteration. Luca -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com