linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] drm: fix missing conversions of bridge drivers to devm_drm_bridge_alloc()
@ 2025-07-08 15:24 Luca Ceresoli
  2025-07-08 15:24 ` [PATCH 1/2] drm/sti: hdmi: convert to devm_drm_bridge_alloc() API Luca Ceresoli
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Luca Ceresoli @ 2025-07-08 15:24 UTC (permalink / raw)
  To: Alain Volmat, Raphael Gallais-Pou, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: Marek Szyprowski, Hui Pu, Thomas Petazzoni, dri-devel,
	linux-kernel, Luca Ceresoli

Most DRM bridge drivers have been converted to devm_drm_bridge_alloc() by
[0], but a few drivers were missed. One got converted by [1], this series
converts all the (known) remaining ones.

Thanks Marek for having found and reported them!

[0] https://lore.kernel.org/all/20250528-drm-bridge-convert-to-alloc-api-v4-1-f04e698c9a77@bootlin.com/
[1] https://lore.kernel.org/all/20250627165652.580798-1-m.szyprowski@samsung.com/

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
---
Luca Ceresoli (2):
      drm/sti: hdmi: convert to devm_drm_bridge_alloc() API
      drm/sti: hda: convert to devm_drm_bridge_alloc() API

 drivers/gpu/drm/sti/sti_hda.c  | 27 +++++++++++++--------------
 drivers/gpu/drm/sti/sti_hdmi.c | 26 ++++++++++++--------------
 drivers/gpu/drm/sti/sti_hdmi.h |  2 ++
 3 files changed, 27 insertions(+), 28 deletions(-)
---
base-commit: 482c7e296edc0f594e8869a789a40be53c49bd6a
change-id: 20250708-drm-bridge-convert-to-alloc-api-leftovers-6c8e2734b5e9

Best regards,
-- 
Luca Ceresoli <luca.ceresoli@bootlin.com>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/2] drm/sti: hdmi: convert to devm_drm_bridge_alloc() API
  2025-07-08 15:24 [PATCH 0/2] drm: fix missing conversions of bridge drivers to devm_drm_bridge_alloc() Luca Ceresoli
@ 2025-07-08 15:24 ` Luca Ceresoli
  2025-07-09  7:30   ` Maxime Ripard
  2025-07-08 15:24 ` [PATCH 2/2] drm/sti: hda: " Luca Ceresoli
  2025-07-09  9:35 ` [PATCH 0/2] drm: fix missing conversions of bridge drivers to devm_drm_bridge_alloc() Luca Ceresoli
  2 siblings, 1 reply; 9+ messages in thread
From: Luca Ceresoli @ 2025-07-08 15:24 UTC (permalink / raw)
  To: Alain Volmat, Raphael Gallais-Pou, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: Marek Szyprowski, Hui Pu, Thomas Petazzoni, dri-devel,
	linux-kernel, Luca Ceresoli

devm_drm_bridge_alloc() is the new API to be used for allocating (and
partially initializing) a private driver struct embedding a struct
drm_bridge.

This driver was missed during the automated conversion in commit
9c399719cfb9 ("drm: convert many bridge drivers from devm_kzalloc() to
devm_drm_bridge_alloc() API") and following commits.

The lack of conversion for this driver is a bug since commit a7748dd127ea
("drm/bridge: get/put the bridge reference in drm_bridge_add/remove()")
which is the first commmit having added a drm_bridge_get/put() pair and
thus exposing the incorrect initial refcount issue.

Fix this by switching the driver to the new API.

Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Closes: https://lore.kernel.org/all/ce9c6aa3-5372-468f-a4bf-5a261259e459@samsung.com/
Fixes: a7748dd127ea ("drm/bridge: get/put the bridge reference in drm_bridge_add/remove()")
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
---
 drivers/gpu/drm/sti/sti_hdmi.c | 26 ++++++++++++--------------
 drivers/gpu/drm/sti/sti_hdmi.h |  2 ++
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
index 37b8d619066ef14a2def26e2e4f90a9c2194238d..4e7c3d78b2b971f8083deae96f3967b44a6499cb 100644
--- a/drivers/gpu/drm/sti/sti_hdmi.c
+++ b/drivers/gpu/drm/sti/sti_hdmi.c
@@ -168,6 +168,11 @@ struct sti_hdmi_connector {
 #define to_sti_hdmi_connector(x) \
 	container_of(x, struct sti_hdmi_connector, drm_connector)
 
+static struct sti_hdmi *drm_bridge_to_sti_hdmi(struct drm_bridge *bridge)
+{
+	return container_of(bridge, struct sti_hdmi, bridge);
+}
+
 static const struct drm_prop_enum_list colorspace_mode_names[] = {
 	{ HDMI_COLORSPACE_RGB, "rgb" },
 	{ HDMI_COLORSPACE_YUV422, "yuv422" },
@@ -749,7 +754,7 @@ static void hdmi_debugfs_init(struct sti_hdmi *hdmi, struct drm_minor *minor)
 
 static void sti_hdmi_disable(struct drm_bridge *bridge)
 {
-	struct sti_hdmi *hdmi = bridge->driver_private;
+	struct sti_hdmi *hdmi = drm_bridge_to_sti_hdmi(bridge);
 
 	u32 val = hdmi_read(hdmi, HDMI_CFG);
 
@@ -881,7 +886,7 @@ static int hdmi_audio_configure(struct sti_hdmi *hdmi)
 
 static void sti_hdmi_pre_enable(struct drm_bridge *bridge)
 {
-	struct sti_hdmi *hdmi = bridge->driver_private;
+	struct sti_hdmi *hdmi = drm_bridge_to_sti_hdmi(bridge);
 
 	DRM_DEBUG_DRIVER("\n");
 
@@ -936,7 +941,7 @@ static void sti_hdmi_set_mode(struct drm_bridge *bridge,
 			      const struct drm_display_mode *mode,
 			      const struct drm_display_mode *adjusted_mode)
 {
-	struct sti_hdmi *hdmi = bridge->driver_private;
+	struct sti_hdmi *hdmi = drm_bridge_to_sti_hdmi(bridge);
 	int ret;
 
 	DRM_DEBUG_DRIVER("\n");
@@ -1273,7 +1278,6 @@ static int sti_hdmi_bind(struct device *dev, struct device *master, void *data)
 	struct sti_hdmi_connector *connector;
 	struct cec_connector_info conn_info;
 	struct drm_connector *drm_connector;
-	struct drm_bridge *bridge;
 	int err;
 
 	/* Set the drm device handle */
@@ -1289,13 +1293,7 @@ static int sti_hdmi_bind(struct device *dev, struct device *master, void *data)
 
 	connector->hdmi = hdmi;
 
-	bridge = devm_kzalloc(dev, sizeof(*bridge), GFP_KERNEL);
-	if (!bridge)
-		return -EINVAL;
-
-	bridge->driver_private = hdmi;
-	bridge->funcs = &sti_hdmi_bridge_funcs;
-	drm_bridge_attach(encoder, bridge, NULL, 0);
+	drm_bridge_attach(encoder, &hdmi->bridge, NULL, 0);
 
 	connector->encoder = encoder;
 
@@ -1385,9 +1383,9 @@ static int sti_hdmi_probe(struct platform_device *pdev)
 
 	DRM_INFO("%s\n", __func__);
 
-	hdmi = devm_kzalloc(dev, sizeof(*hdmi), GFP_KERNEL);
-	if (!hdmi)
-		return -ENOMEM;
+	hdmi = devm_drm_bridge_alloc(dev, struct sti_hdmi, bridge, &sti_hdmi_bridge_funcs);
+	if (IS_ERR(hdmi))
+		return PTR_ERR(hdmi);
 
 	ddc = of_parse_phandle(pdev->dev.of_node, "ddc", 0);
 	if (ddc) {
diff --git a/drivers/gpu/drm/sti/sti_hdmi.h b/drivers/gpu/drm/sti/sti_hdmi.h
index 6d4c3f57bc46ea7d685682e6635840aaedd94fba..91d43dd46f1393ff182ee19804140897f216a260 100644
--- a/drivers/gpu/drm/sti/sti_hdmi.h
+++ b/drivers/gpu/drm/sti/sti_hdmi.h
@@ -12,6 +12,7 @@
 
 #include <media/cec-notifier.h>
 
+#include <drm/drm_bridge.h>
 #include <drm/drm_modes.h>
 #include <drm/drm_property.h>
 
@@ -86,6 +87,7 @@ struct sti_hdmi {
 	struct hdmi_audio_params audio;
 	struct drm_connector *drm_connector;
 	struct cec_notifier *notifier;
+	struct drm_bridge bridge;
 };
 
 u32 hdmi_read(struct sti_hdmi *hdmi, int offset);

-- 
2.50.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] drm/sti: hda: convert to devm_drm_bridge_alloc() API
  2025-07-08 15:24 [PATCH 0/2] drm: fix missing conversions of bridge drivers to devm_drm_bridge_alloc() Luca Ceresoli
  2025-07-08 15:24 ` [PATCH 1/2] drm/sti: hdmi: convert to devm_drm_bridge_alloc() API Luca Ceresoli
@ 2025-07-08 15:24 ` Luca Ceresoli
  2025-07-09  7:32   ` Maxime Ripard
  2025-07-09  9:35 ` [PATCH 0/2] drm: fix missing conversions of bridge drivers to devm_drm_bridge_alloc() Luca Ceresoli
  2 siblings, 1 reply; 9+ messages in thread
From: Luca Ceresoli @ 2025-07-08 15:24 UTC (permalink / raw)
  To: Alain Volmat, Raphael Gallais-Pou, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: Marek Szyprowski, Hui Pu, Thomas Petazzoni, dri-devel,
	linux-kernel, Luca Ceresoli

devm_drm_bridge_alloc() is the new API to be used for allocating (and
partially initializing) a private driver struct embedding a struct
drm_bridge.

This driver was missed during the automated conversion in commit
9c399719cfb9 ("drm: convert many bridge drivers from devm_kzalloc() to
devm_drm_bridge_alloc() API") and following commits.

The lack of conversion for this driver is a bug since commit a7748dd127ea
("drm/bridge: get/put the bridge reference in drm_bridge_add/remove()")
which is the first commmit having added a drm_bridge_get/put() pair and
thus exposing the incorrect initial refcount issue.

Fix this by switching the driver to the new API.

Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Closes: https://lore.kernel.org/all/ce9c6aa3-5372-468f-a4bf-5a261259e459@samsung.com/
Fixes: a7748dd127ea ("drm/bridge: get/put the bridge reference in drm_bridge_add/remove()")
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
---
 drivers/gpu/drm/sti/sti_hda.c | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c
index d202b6c1eb8f6032fef547c9f00ca9cd2a914520..2c015f563de96ae58959801493ead870c49f70e5 100644
--- a/drivers/gpu/drm/sti/sti_hda.c
+++ b/drivers/gpu/drm/sti/sti_hda.c
@@ -246,6 +246,7 @@ struct sti_hda {
 	struct device dev;
 	struct drm_device *drm_dev;
 	struct drm_display_mode mode;
+	struct drm_bridge bridge;
 	void __iomem *regs;
 	void __iomem *video_dacs_ctrl;
 	struct clk *clk_pix;
@@ -262,6 +263,11 @@ struct sti_hda_connector {
 #define to_sti_hda_connector(x) \
 	container_of(x, struct sti_hda_connector, drm_connector)
 
+static struct sti_hda *drm_bridge_to_sti_hda(struct drm_bridge *bridge)
+{
+	return container_of(bridge, struct sti_hda, bridge);
+}
+
 static u32 hda_read(struct sti_hda *hda, int offset)
 {
 	return readl(hda->regs + offset);
@@ -401,7 +407,7 @@ static void sti_hda_configure_awg(struct sti_hda *hda, u32 *awg_instr, int nb)
 
 static void sti_hda_disable(struct drm_bridge *bridge)
 {
-	struct sti_hda *hda = bridge->driver_private;
+	struct sti_hda *hda = drm_bridge_to_sti_hda(bridge);
 	u32 val;
 
 	if (!hda->enabled)
@@ -426,7 +432,7 @@ static void sti_hda_disable(struct drm_bridge *bridge)
 
 static void sti_hda_pre_enable(struct drm_bridge *bridge)
 {
-	struct sti_hda *hda = bridge->driver_private;
+	struct sti_hda *hda = drm_bridge_to_sti_hda(bridge);
 	u32 val, i, mode_idx;
 	u32 src_filter_y, src_filter_c;
 	u32 *coef_y, *coef_c;
@@ -517,7 +523,7 @@ static void sti_hda_set_mode(struct drm_bridge *bridge,
 			     const struct drm_display_mode *mode,
 			     const struct drm_display_mode *adjusted_mode)
 {
-	struct sti_hda *hda = bridge->driver_private;
+	struct sti_hda *hda = drm_bridge_to_sti_hda(bridge);
 	u32 mode_idx;
 	int hddac_rate;
 	int ret;
@@ -677,7 +683,6 @@ static int sti_hda_bind(struct device *dev, struct device *master, void *data)
 	struct drm_encoder *encoder;
 	struct sti_hda_connector *connector;
 	struct drm_connector *drm_connector;
-	struct drm_bridge *bridge;
 	int err;
 
 	/* Set the drm device handle */
@@ -693,13 +698,7 @@ static int sti_hda_bind(struct device *dev, struct device *master, void *data)
 
 	connector->hda = hda;
 
-	bridge = devm_kzalloc(dev, sizeof(*bridge), GFP_KERNEL);
-	if (!bridge)
-		return -ENOMEM;
-
-	bridge->driver_private = hda;
-	bridge->funcs = &sti_hda_bridge_funcs;
-	drm_bridge_attach(encoder, bridge, NULL, 0);
+	drm_bridge_attach(encoder, &hda->bridge, NULL, 0);
 
 	connector->encoder = encoder;
 
@@ -745,9 +744,9 @@ static int sti_hda_probe(struct platform_device *pdev)
 
 	DRM_INFO("%s\n", __func__);
 
-	hda = devm_kzalloc(dev, sizeof(*hda), GFP_KERNEL);
-	if (!hda)
-		return -ENOMEM;
+	hda = devm_drm_bridge_alloc(dev, struct sti_hda, bridge, &sti_hda_bridge_funcs);
+	if (IS_ERR(hda))
+		return PTR_ERR(hda);
 
 	hda->dev = pdev->dev;
 	hda->regs = devm_platform_ioremap_resource_byname(pdev, "hda-reg");

-- 
2.50.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] drm/sti: hdmi: convert to devm_drm_bridge_alloc() API
  2025-07-08 15:24 ` [PATCH 1/2] drm/sti: hdmi: convert to devm_drm_bridge_alloc() API Luca Ceresoli
@ 2025-07-09  7:30   ` Maxime Ripard
  0 siblings, 0 replies; 9+ messages in thread
From: Maxime Ripard @ 2025-07-09  7:30 UTC (permalink / raw)
  To: Luca Ceresoli
  Cc: dri-devel, linux-kernel, Alain Volmat, David Airlie, Hui Pu,
	Maarten Lankhorst, Marek Szyprowski, Maxime Ripard,
	Raphael Gallais-Pou, Simona Vetter, Thomas Petazzoni,
	Thomas Zimmermann

On Tue, 8 Jul 2025 17:24:42 +0200, Luca Ceresoli wrote:
> devm_drm_bridge_alloc() is the new API to be used for allocating (and
> partially initializing) a private driver struct embedding a struct
> drm_bridge.
> 
> This driver was missed during the automated conversion in commit
> 
> [ ... ]

Reviewed-by: Maxime Ripard <mripard@kernel.org>

Thanks!
Maxime

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] drm/sti: hda: convert to devm_drm_bridge_alloc() API
  2025-07-08 15:24 ` [PATCH 2/2] drm/sti: hda: " Luca Ceresoli
@ 2025-07-09  7:32   ` Maxime Ripard
  2025-07-09  9:22     ` Luca Ceresoli
  0 siblings, 1 reply; 9+ messages in thread
From: Maxime Ripard @ 2025-07-09  7:32 UTC (permalink / raw)
  To: Luca Ceresoli
  Cc: Alain Volmat, Raphael Gallais-Pou, Maarten Lankhorst,
	Thomas Zimmermann, David Airlie, Simona Vetter, Marek Szyprowski,
	Hui Pu, Thomas Petazzoni, dri-devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 4120 bytes --]

Hi,

On Tue, Jul 08, 2025 at 05:24:43PM +0200, Luca Ceresoli wrote:
> devm_drm_bridge_alloc() is the new API to be used for allocating (and
> partially initializing) a private driver struct embedding a struct
> drm_bridge.
> 
> This driver was missed during the automated conversion in commit
> 9c399719cfb9 ("drm: convert many bridge drivers from devm_kzalloc() to
> devm_drm_bridge_alloc() API") and following commits.
> 
> The lack of conversion for this driver is a bug since commit a7748dd127ea
> ("drm/bridge: get/put the bridge reference in drm_bridge_add/remove()")
> which is the first commmit having added a drm_bridge_get/put() pair and
> thus exposing the incorrect initial refcount issue.
> 
> Fix this by switching the driver to the new API.
> 
> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Closes: https://lore.kernel.org/all/ce9c6aa3-5372-468f-a4bf-5a261259e459@samsung.com/
> Fixes: a7748dd127ea ("drm/bridge: get/put the bridge reference in drm_bridge_add/remove()")
> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
> ---
>  drivers/gpu/drm/sti/sti_hda.c | 27 +++++++++++++--------------
>  1 file changed, 13 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c
> index d202b6c1eb8f6032fef547c9f00ca9cd2a914520..2c015f563de96ae58959801493ead870c49f70e5 100644
> --- a/drivers/gpu/drm/sti/sti_hda.c
> +++ b/drivers/gpu/drm/sti/sti_hda.c
> @@ -246,6 +246,7 @@ struct sti_hda {
>  	struct device dev;
>  	struct drm_device *drm_dev;
>  	struct drm_display_mode mode;
> +	struct drm_bridge bridge;
>  	void __iomem *regs;
>  	void __iomem *video_dacs_ctrl;
>  	struct clk *clk_pix;
> @@ -262,6 +263,11 @@ struct sti_hda_connector {
>  #define to_sti_hda_connector(x) \
>  	container_of(x, struct sti_hda_connector, drm_connector)
>  
> +static struct sti_hda *drm_bridge_to_sti_hda(struct drm_bridge *bridge)
> +{
> +	return container_of(bridge, struct sti_hda, bridge);
> +}
> +
>  static u32 hda_read(struct sti_hda *hda, int offset)
>  {
>  	return readl(hda->regs + offset);
> @@ -401,7 +407,7 @@ static void sti_hda_configure_awg(struct sti_hda *hda, u32 *awg_instr, int nb)
>  
>  static void sti_hda_disable(struct drm_bridge *bridge)
>  {
> -	struct sti_hda *hda = bridge->driver_private;
> +	struct sti_hda *hda = drm_bridge_to_sti_hda(bridge);
>  	u32 val;
>  
>  	if (!hda->enabled)
> @@ -426,7 +432,7 @@ static void sti_hda_disable(struct drm_bridge *bridge)
>  
>  static void sti_hda_pre_enable(struct drm_bridge *bridge)
>  {
> -	struct sti_hda *hda = bridge->driver_private;
> +	struct sti_hda *hda = drm_bridge_to_sti_hda(bridge);
>  	u32 val, i, mode_idx;
>  	u32 src_filter_y, src_filter_c;
>  	u32 *coef_y, *coef_c;
> @@ -517,7 +523,7 @@ static void sti_hda_set_mode(struct drm_bridge *bridge,
>  			     const struct drm_display_mode *mode,
>  			     const struct drm_display_mode *adjusted_mode)
>  {
> -	struct sti_hda *hda = bridge->driver_private;
> +	struct sti_hda *hda = drm_bridge_to_sti_hda(bridge);
>  	u32 mode_idx;
>  	int hddac_rate;
>  	int ret;
> @@ -677,7 +683,6 @@ static int sti_hda_bind(struct device *dev, struct device *master, void *data)
>  	struct drm_encoder *encoder;
>  	struct sti_hda_connector *connector;
>  	struct drm_connector *drm_connector;
> -	struct drm_bridge *bridge;
>  	int err;
>  
>  	/* Set the drm device handle */
> @@ -693,13 +698,7 @@ static int sti_hda_bind(struct device *dev, struct device *master, void *data)
>  
>  	connector->hda = hda;
>  
> -	bridge = devm_kzalloc(dev, sizeof(*bridge), GFP_KERNEL);
> -	if (!bridge)
> -		return -ENOMEM;
> -
> -	bridge->driver_private = hda;
> -	bridge->funcs = &sti_hda_bridge_funcs;
> -	drm_bridge_attach(encoder, bridge, NULL, 0);
> +	drm_bridge_attach(encoder, &hda->bridge, NULL, 0);

It's not entirely related, but the connector is also allocated right
before and could be moved into the structure instead of storing a
pointer.

Either way,
Reviewed-by: Maxime Ripard <mripard@kernel.org>

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] drm/sti: hda: convert to devm_drm_bridge_alloc() API
  2025-07-09  7:32   ` Maxime Ripard
@ 2025-07-09  9:22     ` Luca Ceresoli
  0 siblings, 0 replies; 9+ messages in thread
From: Luca Ceresoli @ 2025-07-09  9:22 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Alain Volmat, Raphael Gallais-Pou, Maarten Lankhorst,
	Thomas Zimmermann, David Airlie, Simona Vetter, Marek Szyprowski,
	Hui Pu, Thomas Petazzoni, dri-devel, linux-kernel

Hi Maxime,

On Wed, 9 Jul 2025 09:32:28 +0200
Maxime Ripard <mripard@kernel.org> wrote:

...

> > @@ -677,7 +683,6 @@ static int sti_hda_bind(struct device *dev, struct device *master, void *data)
> >  	struct drm_encoder *encoder;
> >  	struct sti_hda_connector *connector;
> >  	struct drm_connector *drm_connector;
> > -	struct drm_bridge *bridge;
> >  	int err;
> >  
> >  	/* Set the drm device handle */
> > @@ -693,13 +698,7 @@ static int sti_hda_bind(struct device *dev, struct device *master, void *data)
> >  
> >  	connector->hda = hda;
> >  
> > -	bridge = devm_kzalloc(dev, sizeof(*bridge), GFP_KERNEL);
> > -	if (!bridge)
> > -		return -ENOMEM;
> > -
> > -	bridge->driver_private = hda;
> > -	bridge->funcs = &sti_hda_bridge_funcs;
> > -	drm_bridge_attach(encoder, bridge, NULL, 0);
> > +	drm_bridge_attach(encoder, &hda->bridge, NULL, 0);  
> 
> It's not entirely related, but the connector is also allocated right
> before and could be moved into the structure instead of storing a
> pointer.
> 
> Either way,
> Reviewed-by: Maxime Ripard <mripard@kernel.org>

Given this patch as-is is fixing a (potentially invisible) bug due to
using the old bridge allocation policy, and the connector allocation
change is an improvements but not a fix, I'll apply as is.

BTW, as a side effect, this series is removing two users of
bridge->driver_private :)

Luca

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] drm: fix missing conversions of bridge drivers to devm_drm_bridge_alloc()
  2025-07-08 15:24 [PATCH 0/2] drm: fix missing conversions of bridge drivers to devm_drm_bridge_alloc() Luca Ceresoli
  2025-07-08 15:24 ` [PATCH 1/2] drm/sti: hdmi: convert to devm_drm_bridge_alloc() API Luca Ceresoli
  2025-07-08 15:24 ` [PATCH 2/2] drm/sti: hda: " Luca Ceresoli
@ 2025-07-09  9:35 ` Luca Ceresoli
  2025-07-09 12:05   ` Maxime Ripard
  2 siblings, 1 reply; 9+ messages in thread
From: Luca Ceresoli @ 2025-07-09  9:35 UTC (permalink / raw)
  To: Alain Volmat, Raphael Gallais-Pou, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
	Luca Ceresoli
  Cc: Marek Szyprowski, Hui Pu, Thomas Petazzoni, dri-devel,
	linux-kernel


On Tue, 08 Jul 2025 17:24:41 +0200, Luca Ceresoli wrote:
> Most DRM bridge drivers have been converted to devm_drm_bridge_alloc() by
> [0], but a few drivers were missed. One got converted by [1], this series
> converts all the (known) remaining ones.
> 
> Thanks Marek for having found and reported them!
> 
> [0] https://lore.kernel.org/all/20250528-drm-bridge-convert-to-alloc-api-v4-1-f04e698c9a77@bootlin.com/
> [1] https://lore.kernel.org/all/20250627165652.580798-1-m.szyprowski@samsung.com/
> 
> [...]

Applied, thanks!

[1/2] drm/sti: hdmi: convert to devm_drm_bridge_alloc() API
      commit: ac4531424d907f3983e919a7bda2b90ea0cede4f
[2/2] drm/sti: hda: convert to devm_drm_bridge_alloc() API
      commit: 602d565d3c10dfb2dfd397f65078cb603a26a513

Best regards,
-- 
Luca Ceresoli <luca.ceresoli@bootlin.com>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] drm: fix missing conversions of bridge drivers to devm_drm_bridge_alloc()
  2025-07-09  9:35 ` [PATCH 0/2] drm: fix missing conversions of bridge drivers to devm_drm_bridge_alloc() Luca Ceresoli
@ 2025-07-09 12:05   ` Maxime Ripard
  2025-07-09 15:17     ` Luca Ceresoli
  0 siblings, 1 reply; 9+ messages in thread
From: Maxime Ripard @ 2025-07-09 12:05 UTC (permalink / raw)
  To: Luca Ceresoli
  Cc: Alain Volmat, Raphael Gallais-Pou, Maarten Lankhorst,
	Thomas Zimmermann, David Airlie, Simona Vetter, Marek Szyprowski,
	Hui Pu, Thomas Petazzoni, dri-devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1000 bytes --]

On Wed, Jul 09, 2025 at 11:35:42AM +0200, Luca Ceresoli wrote:
> 
> On Tue, 08 Jul 2025 17:24:41 +0200, Luca Ceresoli wrote:
> > Most DRM bridge drivers have been converted to devm_drm_bridge_alloc() by
> > [0], but a few drivers were missed. One got converted by [1], this series
> > converts all the (known) remaining ones.
> > 
> > Thanks Marek for having found and reported them!
> > 
> > [0] https://lore.kernel.org/all/20250528-drm-bridge-convert-to-alloc-api-v4-1-f04e698c9a77@bootlin.com/
> > [1] https://lore.kernel.org/all/20250627165652.580798-1-m.szyprowski@samsung.com/
> > 
> > [...]
> 
> Applied, thanks!
> 
> [1/2] drm/sti: hdmi: convert to devm_drm_bridge_alloc() API
>       commit: ac4531424d907f3983e919a7bda2b90ea0cede4f
> [2/2] drm/sti: hda: convert to devm_drm_bridge_alloc() API
>       commit: 602d565d3c10dfb2dfd397f65078cb603a26a513

You sent the patches yesterday, it would have been nice to wait a few
days for the maintainers to answer.

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] drm: fix missing conversions of bridge drivers to devm_drm_bridge_alloc()
  2025-07-09 12:05   ` Maxime Ripard
@ 2025-07-09 15:17     ` Luca Ceresoli
  0 siblings, 0 replies; 9+ messages in thread
From: Luca Ceresoli @ 2025-07-09 15:17 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Alain Volmat, Raphael Gallais-Pou, Maarten Lankhorst,
	Thomas Zimmermann, David Airlie, Simona Vetter, Marek Szyprowski,
	Hui Pu, Thomas Petazzoni, dri-devel, linux-kernel

On Wed, 9 Jul 2025 14:05:51 +0200
Maxime Ripard <mripard@kernel.org> wrote:

> On Wed, Jul 09, 2025 at 11:35:42AM +0200, Luca Ceresoli wrote:
> > 
> > On Tue, 08 Jul 2025 17:24:41 +0200, Luca Ceresoli wrote:  
> > > Most DRM bridge drivers have been converted to devm_drm_bridge_alloc() by
> > > [0], but a few drivers were missed. One got converted by [1], this series
> > > converts all the (known) remaining ones.
> > > 
> > > Thanks Marek for having found and reported them!
> > > 
> > > [0] https://lore.kernel.org/all/20250528-drm-bridge-convert-to-alloc-api-v4-1-f04e698c9a77@bootlin.com/
> > > [1] https://lore.kernel.org/all/20250627165652.580798-1-m.szyprowski@samsung.com/
> > > 
> > > [...]  
> > 
> > Applied, thanks!
> > 
> > [1/2] drm/sti: hdmi: convert to devm_drm_bridge_alloc() API
> >       commit: ac4531424d907f3983e919a7bda2b90ea0cede4f
> > [2/2] drm/sti: hda: convert to devm_drm_bridge_alloc() API
> >       commit: 602d565d3c10dfb2dfd397f65078cb603a26a513  
> 
> You sent the patches yesterday, it would have been nice to wait a few
> days for the maintainers to answer.

Apologies. Being a fix, I thought it would make sense to apply them
quickly. Note taken.

Luca

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-07-09 15:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-08 15:24 [PATCH 0/2] drm: fix missing conversions of bridge drivers to devm_drm_bridge_alloc() Luca Ceresoli
2025-07-08 15:24 ` [PATCH 1/2] drm/sti: hdmi: convert to devm_drm_bridge_alloc() API Luca Ceresoli
2025-07-09  7:30   ` Maxime Ripard
2025-07-08 15:24 ` [PATCH 2/2] drm/sti: hda: " Luca Ceresoli
2025-07-09  7:32   ` Maxime Ripard
2025-07-09  9:22     ` Luca Ceresoli
2025-07-09  9:35 ` [PATCH 0/2] drm: fix missing conversions of bridge drivers to devm_drm_bridge_alloc() Luca Ceresoli
2025-07-09 12:05   ` Maxime Ripard
2025-07-09 15:17     ` Luca Ceresoli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).