From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 3390C78F26 for ; Tue, 14 Apr 2026 07:02:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776150166; cv=none; b=XxrNcgMeHQKX8X3KwSbvURbNcgdkJLEQ+LIPBCMjZ8k1Celj1eePwKebdNQEWa+V9ZYdd30oppRSsG3Chm+cYiNUgzfY12rH6Dkff24r09LFriwqCa9HRirL6LOqefi9QLyXPUNNLpH4k4Kh31RLi0QNN0dDiBO+2PSQXvaIdDg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776150166; c=relaxed/simple; bh=GSwJySJHo0hT7GXeWrDOalz8cnz5bMLyfqqv3BHlXRA=; h=Mime-Version:Content-Type:Date:Message-Id:To:From:Subject:Cc: References:In-Reply-To; b=ewaJYcdJZUseZbabLTRPOPhqyBgLy9cqaB4xr3hqGi6JCLDDYErA3WyoVxtg7T8xf/x3zp6Gu2tfDuWFWGdCeMLGi5YyFchh2OqcEBMlqB11757ZW1qAhXDkq0cStNvCraLchTKJ4Sv/iSSzxJJCw+lHsKIB9geyQIB71FU08ng= 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=OJBuMBRn; arc=none smtp.client-ip=185.246.84.56 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="OJBuMBRn" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 8983F1A329A; Tue, 14 Apr 2026 07:02:42 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 4EA1C5FFBB; Tue, 14 Apr 2026 07:02:42 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id DE66810450D08; Tue, 14 Apr 2026 09:02:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1776150160; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=GSwJySJHo0hT7GXeWrDOalz8cnz5bMLyfqqv3BHlXRA=; b=OJBuMBRnZ+1k0pvNy34xrHqO2sDtPpDWaR5tU5nqeGGgWSkYmHpD2OCmU8elLppdM+FZfO w0DduviNhyxdv6HA5bPmhN6QWm7zZhJe9bpszUAgTALiVlrDx7Z/J1cBi/t/Ry5rdFzOqu R9JonwE28Dtat/FKH00kCLyUE0whYkGlR+uKNLDuDgfj/Rdw8vBC2f0BPneCgtCaLa/GIJ jH1rCkKR5yfbF2aexL9UkLhqJVKUEXAtibTr52l0hPNZ6RGKDm20chWzXLhfzHC4ky6OIq KWfO9iSdVGivMNMZCB0IM5Bz+oH6rKh94YLpmIIoLEF+6QQz3VK4UTlBsapH1A== 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, 14 Apr 2026 09:02:27 +0200 Message-Id: To: "Dmitry Baryshkov" From: "Luca Ceresoli" Subject: Re: [PATCH 10/10] drm: of: forbid bridge-only calls to drm_of_find_panel_or_bridge() Cc: "Maarten Lankhorst" , "Maxime Ripard" , "Thomas Zimmermann" , "David Airlie" , "Simona Vetter" , "Rob Clark" , "Dmitry Baryshkov" , "Abhinav Kumar" , "Jessica Zhang" , "Sean Paul" , "Marijn Suijten" , "Xinliang Liu" , "Tian Tao" , "Xinwei Kong" , "Sumit Semwal" , "Yongqin Liu" , "John Stultz" , "Andrzej Hajda" , "Neil Armstrong" , "Robert Foss" , "Laurent Pinchart" , "Jonas Karlman" , "Jernej Skrabec" , "Tomi Valkeinen" , "Michal Simek" , "Hui Pu" , "Ian Ray" , "Thomas Petazzoni" , , , , , X-Mailer: aerc 0.20.1 References: <20260413-drm-bridge-alloc-getput-panel_or_bridge-v1-0-acd01cd79a1f@bootlin.com> <20260413-drm-bridge-alloc-getput-panel_or_bridge-v1-10-acd01cd79a1f@bootlin.com> In-Reply-To: X-Last-TLS-Session-Version: TLSv1.3 Hello Dmitry, Maxime, On Mon Apr 13, 2026 at 8:04 PM CEST, Dmitry Baryshkov wrote: > On Mon, Apr 13, 2026 at 03:58:42PM +0200, Luca Ceresoli wrote: >> Up to now drm_of_find_panel_or_bridge() can be called with a bridge poin= ter >> only, a panel pointer only, or both a bridge and a panel pointers. The >> logic to handle all the three cases is somewhat complex to read however. >> >> Now all bridge-only callers have been converted to >> of_drm_get_bridge_by_endpoint(), which is simpler and handles bridge >> refcounting. So forbid new bridge-only users by mandating a non-NULL pan= el >> pointer in the docs and in the sanity checks along with a warning. > > Are there remaining users which still use either the bridge or the > panel? Would it be possible / better to drop the two-arg version? Yes. I counted ~20 panel+bridge and 4 panel-only callers with this series applied, and on top of those there are devm_drm_of_get_bridge() and drmm_of_get_bridge() which to me are the real issue because they make it impossible to correctly handle bridge lifetime. We discussed this with both you and Maxime a while back. AFAIK Maxime has a plan to make every panel automatically instantiate a panel_bridge. I think that's the only reasonable approach to get rid of drm_of_find_panel_or_bridge() + *_of_get_bridge() and make bridge lifetime easier and safe. @Maxime, do you have updates on that idea? Best regards, Luca -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com