From nobody Wed Dec 17 17:39:13 2025 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 7C47826F2AD for ; Fri, 3 Oct 2025 09:00:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759482048; cv=none; b=olaJ+jChiirnhH0voMi64iFtoboGVLtKnb4USyJj+i3euaZw3Fj6bERbpl50/xGoAC7JY8McSnSP6CQwnMEE3ZwuAd6seo2GJ2iRVB+41lYGhJB78QHRjKdc7+LNrAjjmPBXWxiyQuJ6v16Y38mhD/1HGsbLfQCNkd+9WOddyX8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759482048; c=relaxed/simple; bh=kLoCyULXnAwRMYE7yzuvW8s2/zTfNQjHIgvV1n0Bc38=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=c4CpkTMtF+knFpStQ8tgs7z8FaXhmns/7KZpkZMODQuMhdwRl3YnLkZ98eUhNrb+J+0MpTqUBfe40G98KEyrQrxcMBVqxKDbRfY2hXcai5WIPyU5z9HRtFLPNIEivEKGI6AGwer+eSxbPQ9/gjCm+ct3uL+xTZ4uN1ABlbv0GIo= 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=ApqGFf2Q; arc=none smtp.client-ip=185.171.202.116 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="ApqGFf2Q" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id E89DFC00D98; Fri, 3 Oct 2025 09:00:26 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id E7A2E60683; Fri, 3 Oct 2025 09:00:44 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 0A47D102F1C24; Fri, 3 Oct 2025 11:00:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1759482043; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=w/wMDW+ORc4IMlsm9YNmK+hs7D2/6cQwBTxkTz703Fk=; b=ApqGFf2QVFtIC4jXGJmWPKeuVCliDaErNZgd8yq3fINh2qnqkx+xp8BAksynsjcC3gA78I cXZ9b7nadeQQsdKelBS/XHwPsGH3lSdIP4fCLbqDmmBgcNjtpyW85ZMpOdMUplbsaDeUIn 3H2frNCuAIy3goJy0A9Hu0RQ0cPXVni21TdpkYuoV4EO/8Kc8LIw+T/KZv7PVAuke9x+3Y VRu8XKpet9roen1fR5n6MfKwnl0gysfU0I7+k0lXCrr3TtH3o6piOky8CcUl/FXBAlXYPg 4oqdFegOZabnbiPm8/CbSkifDUXvIguPgX3ol8MJ+Fq3FJflHpqv/udHX/fKgA== From: Luca Ceresoli Date: Fri, 03 Oct 2025 10:59:55 +0200 Subject: [PATCH 1/4] drm/sti: hda: add bridge before attaching 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: quoted-printable Message-Id: <20251003-b4-drm-bridge-alloc-add-before-attach-v1-1-92fb40d27704@bootlin.com> References: <20251003-b4-drm-bridge-alloc-add-before-attach-v1-0-92fb40d27704@bootlin.com> In-Reply-To: <20251003-b4-drm-bridge-alloc-add-before-attach-v1-0-92fb40d27704@bootlin.com> To: Alain Volmat , Raphael Gallais-Pou , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec Cc: Hui Pu , Thomas Petazzoni , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Luca Ceresoli X-Mailer: b4 0.14.2 X-Last-TLS-Session-Version: TLSv1.3 DRM bridges should be always added to the global bridge list before being attached. Link: https://lore.kernel.org/all/20250709-sophisticated-loon-of-rain-6ccdd= 8@houat/ Signed-off-by: Luca Ceresoli Acked-by: Raphael Gallais-Pou --- drivers/gpu/drm/sti/sti_hda.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c index 2c015f563de96ae58959801493ead870c49f70e5..b7397827889c94d6f8e8c2a48b0= 9f06e29ceeaf7 100644 --- a/drivers/gpu/drm/sti/sti_hda.c +++ b/drivers/gpu/drm/sti/sti_hda.c @@ -779,6 +779,8 @@ static int sti_hda_probe(struct platform_device *pdev) return PTR_ERR(hda->clk_hddac); } =20 + drm_bridge_add(&hda->bridge); + platform_set_drvdata(pdev, hda); =20 return component_add(&pdev->dev, &sti_hda_ops); @@ -786,7 +788,10 @@ static int sti_hda_probe(struct platform_device *pdev) =20 static void sti_hda_remove(struct platform_device *pdev) { + struct sti_hda *hda =3D platform_get_drvdata(pdev); + component_del(&pdev->dev, &sti_hda_ops); + drm_bridge_remove(&hda->bridge); } =20 static const struct of_device_id hda_of_match[] =3D { --=20 2.51.0 From nobody Wed Dec 17 17:39:13 2025 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 B3F7828369A for ; Fri, 3 Oct 2025 09:00:49 +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=1759482051; cv=none; b=r5YYzkP9u3v0oZtM221kyPfiyxhUzkRKawcEoWMNOXCLFiocIwmZJRzbUMwiPV2jIFTb2DCVS0jQnpsQG87VWi+1ZjzxzkYllvJXBfyHEPFQRCwElALmPnpEGFgUQblUyfVoSZ55AWcoy6BtmI0ZwwaEhTYiFQ9lWr3+n7YNxx8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759482051; c=relaxed/simple; bh=elKj5SGKRdahCPeqKBzJ7FplJSvKMwYHgJcE0grd/rk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JLz9drmmY6eMR0lBKmOox0trc8nnLjrYBNdaX7y47V9kKnqEelcbqzamNtg6OaiypPyLOEaitqnxJ8bA30aiycETKD5aLkaGczSx98/VWbspXpPffjpaX+sVpq9FXPuekFpxhsAgBJuH/Zi1NF+t3EuH2lWFkiowCKu4aBsLCjw= 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=xH7vQ5m/; 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="xH7vQ5m/" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id B322F4E40E90; Fri, 3 Oct 2025 09:00:47 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 89D7F60683; Fri, 3 Oct 2025 09:00:47 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 7BDB2102F1C33; Fri, 3 Oct 2025 11:00:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1759482046; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=ebfUGkYH5pGjBKB+Sf434xFBeiTl0SZ+ny8lNc0QXfU=; b=xH7vQ5m/dsvHtjScC488kOPlgbneze3g9Xbx0zuE4G4meEKLY/IGuzDaKTeGJT2UByCXHM SxBF9ZivjWXs5m+tOlJZ39gAPkNfDVC7rE76kTq7wvh9/r1sdOZAU4SPwUA0XJUHEmd5KQ Y7exiY3dgKKXlv6WC+jBmrkFhUtyrf6Z9P17IO9knzwKz99/9Dq2Z02BjyToC1Bk5GhVYn DrDKsgtaBls8lBHKGL0gAyUXYJh6XL3zlfEG5YoUWb+lG71BD9mlNNJR/sSEztomNMrr+y qBtO7rgUSdGvQqxt0USJF6hSdMScGhGPu3prU4w6cbn3qvfgeDkLTxhgXpNqaw== From: Luca Ceresoli Date: Fri, 03 Oct 2025 10:59:56 +0200 Subject: [PATCH 2/4] drm/sti: hdmi: add bridge before attaching 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: quoted-printable Message-Id: <20251003-b4-drm-bridge-alloc-add-before-attach-v1-2-92fb40d27704@bootlin.com> References: <20251003-b4-drm-bridge-alloc-add-before-attach-v1-0-92fb40d27704@bootlin.com> In-Reply-To: <20251003-b4-drm-bridge-alloc-add-before-attach-v1-0-92fb40d27704@bootlin.com> To: Alain Volmat , Raphael Gallais-Pou , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec Cc: Hui Pu , Thomas Petazzoni , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Luca Ceresoli X-Mailer: b4 0.14.2 X-Last-TLS-Session-Version: TLSv1.3 DRM bridges should be always added to the global bridge list before being attached. Link: https://lore.kernel.org/all/20250709-sophisticated-loon-of-rain-6ccdd= 8@houat/ Signed-off-by: Luca Ceresoli Acked-by: Raphael Gallais-Pou --- drivers/gpu/drm/sti/sti_hdmi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c index 4e7c3d78b2b971f8083deae96f3967b44a6499cb..f8222e60b1e01afb6d93f816915= f17056c060f22 100644 --- a/drivers/gpu/drm/sti/sti_hdmi.c +++ b/drivers/gpu/drm/sti/sti_hdmi.c @@ -1459,6 +1459,7 @@ static int sti_hdmi_probe(struct platform_device *pde= v) =20 platform_set_drvdata(pdev, hdmi); =20 + drm_bridge_add(&hdmi->bridge); return component_add(&pdev->dev, &sti_hdmi_ops); =20 release_adapter: @@ -1475,6 +1476,7 @@ static void sti_hdmi_remove(struct platform_device *p= dev) if (hdmi->audio_pdev) platform_device_unregister(hdmi->audio_pdev); component_del(&pdev->dev, &sti_hdmi_ops); + drm_bridge_remove(&hdmi->bridge); } =20 struct platform_driver sti_hdmi_driver =3D { --=20 2.51.0 From nobody Wed Dec 17 17:39:13 2025 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 E9D892877DE for ; Fri, 3 Oct 2025 09:00:52 +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=1759482054; cv=none; b=MVVwu4kcttuGf3flFmMaD0WzyB1AtEW8ArVOKsXQnS6D0mo6goQE6PpfuHWaBfjYuMBtNtvYJQP37ZQz+pq7oN9+ik62gOjBQnrBSaNdjoIhdnW7GqjeCoDd88i33RRFGqWUvOmwXtj4iG2EszdbOTeW2rgjgAs/DR3hiP/2dN4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759482054; c=relaxed/simple; bh=xm8X/GLhCWp1FyrgmRUqIhUsFhKVDdNLI6XtuaFMby8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=paq3qVn3upWp5TsxoobDpykLjDhMRqHfK/Pg8guTUus8ne5/H+GiOJWrjEiDY4Spmb86jNNCjEK3okCr4YGxSCa35QsK26a6OmU/+sF2JZKqXOpRfFmEY0qqMelULn/PILNMzfSCh8lqgR4YwSTkPOENbi87HNsetl9JIWeuB9k= 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=gSoxTYEe; 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="gSoxTYEe" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 318BF1A10BF; Fri, 3 Oct 2025 09:00:51 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 0217660683; Fri, 3 Oct 2025 09:00:51 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 44B57102F1C39; Fri, 3 Oct 2025 11:00:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1759482049; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=vewxcAfVxOb+fFtrTVXZN0dTk5mEyTYPA5Q0ZxBR6lc=; b=gSoxTYEe3GdQiqsSL/5zMSUEM5D0PLLpwO1obxET5mTXN1d3KgI56K6vcqG+DAq0ttMMup kAG20NzrSeDrr2QhIdjSL4NqQ/1Um4V1xBorlvYQ6N64dbI/b7XZMpYjHL2MkHrXaf1ySv zbEuTcMk0031W7EAP3LfDhLKPdfAwXfERPb1ryHKeskJlYNj/yCFG9riQa7u4ihe7ck5MG UDnMeVESCxfYr+3M2Et3E+jRCIKOrysL5mkjG08kckOkqlRWBfm0LnZCCVGZvW2vUyzB00 oH2/n9I5hkmCL/aysX2KADGW7UwyUcoudOpZsxXROxz2goauuLe3Xeg8+r3CfA== From: Luca Ceresoli Date: Fri, 03 Oct 2025 10:59:57 +0200 Subject: [PATCH 3/4] drm/bridge: document that adding a bridge is mandatory before attach 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: quoted-printable Message-Id: <20251003-b4-drm-bridge-alloc-add-before-attach-v1-3-92fb40d27704@bootlin.com> References: <20251003-b4-drm-bridge-alloc-add-before-attach-v1-0-92fb40d27704@bootlin.com> In-Reply-To: <20251003-b4-drm-bridge-alloc-add-before-attach-v1-0-92fb40d27704@bootlin.com> To: Alain Volmat , Raphael Gallais-Pou , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec Cc: Hui Pu , Thomas Petazzoni , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Luca Ceresoli X-Mailer: b4 0.14.2 X-Last-TLS-Session-Version: TLSv1.3 At the moment it's not documented that you need to add a bridge before attaching it. Clarify that. Suggested-by: Maxime Ripard Link: https://lore.kernel.org/all/20250709-sophisticated-loon-of-rain-6ccdd= 8@houat/ Signed-off-by: Luca Ceresoli Reviewed-by: Raphael Gallais-Pou --- drivers/gpu/drm/drm_bridge.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index 53e7ece36dd940aabd1c0880f296fce7224a12ac..1246a52f8767b52c5f10139aa89= 7824b3c2f28da 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -422,6 +422,9 @@ static bool drm_bridge_is_atomic(struct drm_bridge *bri= dge) * If non-NULL the previous bridge must be already attached by a call to t= his * function. * + * The bridge to be attached must have been previously added by + * drm_bridge_add(). + * * Note that bridges attached to encoders are auto-detached during encoder * cleanup in drm_encoder_cleanup(), so drm_bridge_attach() should general= ly * *not* be balanced with a drm_bridge_detach() in driver code. --=20 2.51.0 From nobody Wed Dec 17 17:39:13 2025 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 4F4D3288C89 for ; Fri, 3 Oct 2025 09:00:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759482057; cv=none; b=uCp5hsey9OdxT9EPSigw6qun1liVKq9UpW8xvLAhJveQUcxwAqe6M3JqGbtdl5Culf6E86f/PXVRNCxARXHgckfetpNzZ6PjIMKt5OVX664fVH7gYT5cLhRrlKT+gR8/U4SbYp3Ve1BZp5Dlg9GIz1vT1Hw1rj20pYxt65maZ6c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759482057; c=relaxed/simple; bh=ebnwyZ92XBfrC87y4vHvaA6sN1g21WrKrf/tOG+0dn4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SRVJ0zRyQ2hXbdyzrDSwmYE9J+tJ0fJBS+XlHEegswPKLqk85+tNAg0+N94PHB0YCXeVgXa5/qrcXLob2zl0+5l10IK0QiWer2R3Q8icnSp4gdR46AVrqtJc1sZOICqHS7b++woUqh4sKk6iqbldR2vS1pCFeIHJ29Y0u3gI9vM= 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=ObAWEyCX; arc=none smtp.client-ip=185.171.202.116 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="ObAWEyCX" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id BF4EDC00D93; Fri, 3 Oct 2025 09:00:35 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id BD8D360683; Fri, 3 Oct 2025 09:00:53 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 7A1E7102F1C33; Fri, 3 Oct 2025 11:00:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1759482052; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=ieiQe/8Bss9tI8naQDPEum9VPw8wY17XSTnksOOgxkg=; b=ObAWEyCXotcBuCrFfYanIqOZ7uT7LApr0EjRpVNSK5CUNW6ggTBk9Yl3BbZWM3DuUD13LZ jWeIkrqq4IpYYV6KTfVIQM5959FyeBrEGVqyThZhqR5CwD1MaeOrN932XYZkHMBk0+wHP6 plfObkAez1laKJRhtEulLvrzS3Zw2K67Adqriv3buL3G3P57AAqOUrQRcrVnACby3+vMwY UO31I0EaC5SkCeVfXNOG8QV2m8R1aMr0CY6BDVI1ctMyi7Ce1lbKesWRUU+rSXxmsgdixV iKiPtyfE3Ta1SCo4khbqn/T2cdpz4gvk7SkTdVcCAFHShBU9mxhHsKptpziGWg== From: Luca Ceresoli Date: Fri, 03 Oct 2025 10:59:58 +0200 Subject: [PATCH 4/4] drm/bridge: add warning for bridges attached without being added 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: quoted-printable Message-Id: <20251003-b4-drm-bridge-alloc-add-before-attach-v1-4-92fb40d27704@bootlin.com> References: <20251003-b4-drm-bridge-alloc-add-before-attach-v1-0-92fb40d27704@bootlin.com> In-Reply-To: <20251003-b4-drm-bridge-alloc-add-before-attach-v1-0-92fb40d27704@bootlin.com> To: Alain Volmat , Raphael Gallais-Pou , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec Cc: Hui Pu , Thomas Petazzoni , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Luca Ceresoli X-Mailer: b4 0.14.2 X-Last-TLS-Session-Version: TLSv1.3 DRM bridges must be added before they are attached. Add a warning to catch violations. The warning is based on the bridge not being part of any list, so it will trigger if the bridge is being attached without ever having been added. It won't catch cases of bridges attached after having been added and then removed, because in that case the bridge will be in bridge_lingering_list. However such a case is both more demanding to detect and less likely to happen, so it can be left unchecked, at least for now. Link: https://lore.kernel.org/all/20250709-sophisticated-loon-of-rain-6ccdd= 8@houat/ Signed-off-by: Luca Ceresoli Reviewed-by: Raphael Gallais-Pou --- drivers/gpu/drm/drm_bridge.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index 1246a52f8767b52c5f10139aa897824b3c2f28da..6dba601a056bb3cff8b8dd5b1ec= 46299235b2d85 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -441,6 +441,9 @@ int drm_bridge_attach(struct drm_encoder *encoder, stru= ct drm_bridge *bridge, if (!encoder || !bridge) return -EINVAL; =20 + if (list_empty(&bridge->list)) + DRM_WARN("Missing drm_bridge_add() before attach\n"); + drm_bridge_get(bridge); =20 if (previous && (!previous->dev || previous->encoder !=3D encoder)) { --=20 2.51.0