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 8CBDC2FDC57; Sat, 31 Jan 2026 15:58:48 +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=1769875131; cv=none; b=oTRQAJ2XFBtzcj+dkhq4uDWSiqCBcO+Xl8H/PP35aTe3Br9XR0lndtR88exuy0MAbK02milpjL/roGtB/mVUR438Coy0/T7RpCy0BfNgMzbAKN7rVSism8kKY29Fay2mqTWh+WlkOdl/bq0LHPpSgieutj/UY/RE6QyKRiz8cls= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769875131; c=relaxed/simple; bh=thiupvH6sQSVh3N5SayiwfEAHIywDqPurRPaAnDLfGM=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=uGdW2WXdqS7ypkKAd1snbIgXz6bo5JS2sTLfQ8ge/QQvlW+VMkADO8P+ft2GA8LNk6QtdFkFbBuDjZ1LFdW9f/yDPOUwy3o11CAHOetXotCBlwvpCVM/Mk01AGLFdhgJ86r/B4kmVcF7algti2XHVG2HE12ajrBZ8/UHbQ0IhEI= 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=1hmM5zBw; 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="1hmM5zBw" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 0B6971A2B5F; Sat, 31 Jan 2026 15:58:47 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id C5CF3606B6; Sat, 31 Jan 2026 15:58:46 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id D26AA119A888D; Sat, 31 Jan 2026 16:58:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1769875125; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding; bh=OyfmZsnpNc4sO7Qq1hqJxEZF85pwWQoMUaAKVhgeE+o=; b=1hmM5zBwcvRISCjUN8SaKFBpEOIHWAGZiwb0SuQW0GNYPcjqzjm5q3OCl7E0G3Xi8MsmoR u6p8kRLQoMYybzOs09jMCllM/Mp/jBG/AePDCo5kel2uCJbW3D1qysy5gMUOdyvgchntnI 1h742PId236cDfH1WTtBSO7yVsrOq3XAVIqE1dNQOdhZD2hVov0reoGFVVCDPKYclB2hv4 kzMh/eOe1qkJuGYbY6KG23zg4+ARU6FAtl5t0S1yhzaLSi72F5gaQDagc1pspVU5KOD4Py l1MmADYSEJbmrN2xQhZuyZ3aKXylwf9Pxn9Lf4Rvh8IFA0POzlZ7WgkWT7mAtg== From: Luca Ceresoli Subject: [PATCH v2 0/6] drm/bridge: convert users of of_drm_find_bridge(), part 4 Date: Sat, 31 Jan 2026 16:58:32 +0100 Message-Id: <20260131-drm-bridge-alloc-getput-drm_of_find_bridge-4-v2-0-e081bcdc1467@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-B4-Tracking: v=1; b=H4sIAKgmfmkC/5WNQQ6DIBQFr2JYlwbQau2q92iMEfnoTxQMUNLGe Pei8QJdzrzkzUo8OARPHtlKHET0aE0CcclIP3ZmAIoqMRFMlIyziio3U+lQpaWbJtvTAcLyDrt vrW41GtWee0FZVwuZl1xDrUi6XBxo/By5V5N4RB+s+x71yHd7hnj5Xyhyyijkhczv+saUqJ7S2 jChufZ2Js22bT8WZjiT6gAAAA== X-Change-ID: 20260107-drm-bridge-alloc-getput-drm_of_find_bridge-4-0a92b361fe9d To: Biju Das , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Anitha Chrisanthus , Linus Walleij , Laurent Pinchart , Tomi Valkeinen , Kieran Bingham , Geert Uytterhoeven , Magnus Damm , Tomi Valkeinen Cc: Hui Pu , Ian Ray , Thomas Petazzoni , dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Ceresoli X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 This series converts many DRM drivers from the now deprecated of_drm_find_bridge() to its replacement of_drm_find_and_get_bridge() which allows correct bridge refcounting. Where applicable it also converts per-driver "next_bridge" pointers to the unified drm_bridge::next_bridge which puts the reference automatically on bridge deallocation. This is part of the work to support hotplug of DRM bridges. The grand plan was discussed in [0]. Here's the work breakdown (➜ marks the current series): 1. ➜ add refcounting to DRM bridges struct drm_bridge, based on devm_drm_bridge_alloc() A. ✔ add new alloc API and refcounting (v6.16) B. ✔ convert all bridge drivers to new API (v6.17) C. ✔ kunit tests (v6.17) D. ✔ add get/put to drm_bridge_add/remove() + attach/detach() and warn on old allocation pattern (v6.17) E. ➜ add get/put on drm_bridge accessors 1. ✔ drm_bridge_chain_get_first_bridge(), add cleanup action (v6.18) 2. ✔ drm_bridge_get_prev_bridge() (v6.18) 3. ✔ drm_bridge_get_next_bridge() (v6.19) 4. ✔ drm_for_each_bridge_in_chain() (v6.19) 5. ✔ drm_bridge_connector_init (v6.19) 6. … protect encoder bridge chain with a mutex 7. ➜ of_drm_find_bridge a. ✔… add of_drm_get_bridge(), convert basic direct users (v6.20?, one driver still pending) b. ✔ convert direct of_drm_get_bridge() users, part 2 (v6.20?) c. ✔ convert direct of_drm_get_bridge() users, part 3 (v6.20?) d. ➜ convert direct of_drm_get_bridge() users, part 4 e. convert bridge-only drm_of_find_panel_or_bridge() users 8. drm_of_find_panel_or_bridge, *_of_get_bridge 9. ✔ enforce drm_bridge_add before drm_bridge_attach (v6.19) F. ✔ debugfs improvements 1. ✔ add top-level 'bridges' file (v6.16) 2. ✔ show refcount and list lingering bridges (v6.19) 2. … handle gracefully atomic updates during bridge removal A. ✔ Add drm_dev_enter/exit() to protect device resources (v6.20?) B. … protect private_obj removal from list 3. … DSI host-device driver interaction 4. ✔ removing the need for the "always-disconnected" connector 5. finish the hotplug bridge work, moving code to the core and potentially removing the hotplug-bridge itself (this needs to be clarified as points 1-3 are developed) [0] https://lore.kernel.org/lkml/20250206-hotplug-drm-bridge-v6-0-9d6f2c9c3058@bootlin.com/#t This work is a continuation of the work to correctly handle bridge refcounting for existing of_drm_find_bridge(). The ground work is in: - commit 293a8fd7721a ("drm/bridge: add of_drm_find_and_get_bridge()") - commit 9da0e06abda8 ("drm/bridge: deprecate of_drm_find_bridge()") - commit 3fdeae134ba9 ("drm/bridge: add next_bridge pointer to struct drm_bridge") The whole conversion is split in multiple series to make the review process a bit smoother: - Part 2: mostly drivers in drivers/gpu/drm/bridge [2], applied - Part 3: other drivers, low-medium complexity [3], applied - Part 4: other drivers, converting the most complex cases [this series] [2] https://lore.kernel.org/lkml/20260109-drm-bridge-alloc-getput-drm_of_find_bridge-2-v2-0-8bad3ef90b9f@bootlin.com/ [3] https://lore.kernel.org/lkml/20260109-drm-bridge-alloc-getput-drm_of_find_bridge-3-v2-0-8d7a3dbacdf4@bootlin.com/ Signed-off-by: Luca Ceresoli --- Changes in v2: - Removed bouncing recipient: Edmund Dea - used break instead of a warning patch 3, adapted patch 4 as a consequence - Link to v1: https://lore.kernel.org/r/20260116-drm-bridge-alloc-getput-drm_of_find_bridge-4-v1-0-e34b38f50d27@bootlin.com --- Luca Ceresoli (6): drm: renesas: rz-du: rzg2l_du_encoder: convert to of_drm_find_and_get_bridge() drm/kmb/dsi: convert to of_drm_find_and_get_bridge() drm/mcde: dsi: mcde_dsi_bind: break when a panel or bridge is found drm/mcde: dsi: convert to of_drm_find_and_get_bridge() drm: rcar-du: encoder: convert to of_drm_find_and_get_bridge() drm/omap: dss: convert to of_drm_find_and_get_bridge() drivers/gpu/drm/kmb/kmb_dsi.c | 2 +- drivers/gpu/drm/mcde/mcde_dsi.c | 17 +++++++++----- drivers/gpu/drm/omapdrm/dss/output.c | 11 ++++++--- drivers/gpu/drm/renesas/rcar-du/rcar_du_encoder.c | 28 ++++++++++++++++++----- drivers/gpu/drm/renesas/rcar-du/rcar_du_encoder.h | 1 + drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c | 2 ++ drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c | 14 ++++++++---- 7 files changed, 55 insertions(+), 20 deletions(-) --- base-commit: c423b48c57902f456695bd6e5452546b11c2d5f3 change-id: 20260107-drm-bridge-alloc-getput-drm_of_find_bridge-4-0a92b361fe9d Best regards, -- Luca Ceresoli