Skip to contentSkip to conversation

drm/msm: avoid double-attaching hdmi/edp bridges

PATCH In review Ilia Mirkin 4 participants 4 messages Mar 12, 2020 – Mar 19, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/msm: avoid double-attaching hdmi/edp bridges

Each of hdmi and edp are already attached in msm_*_bridge_init. A second attachment returns -EBUSY, failing the driver load.

Tested with HDMI on IFC6410 (APQ8064 / MDP4), but eDP case should be analogous.

Fixes 3ef2f119bd3ed (drm/msm: Use drm_attach_bridge() to attach a bridge to an encoder)
Cc Boris Brezillon <[email protected]>
---
 drivers/gpu/drm/msm/edp/edp.c   | 4 ----
 drivers/gpu/drm/msm/hdmi/hdmi.c | 4 ----
 2 files changed, 8 deletions(-)
drivers/gpu/drm/msm/edp/edp.c +0 -4
index ad4e963ccd9b..106a67473af5 100644
@@ -178,10 +178,6 @@ int msm_edp_modeset_init(struct msm_edp *edp, struct drm_device *dev,
 		goto fail;
 	}
 
-	ret = drm_bridge_attach(encoder, edp->bridge, NULL);
-	if (ret)
-		goto fail;
-
 	priv->bridges[priv->num_bridges++]       = edp->bridge;
 	priv->connectors[priv->num_connectors++] = edp->connector;
 
drivers/gpu/drm/msm/hdmi/hdmi.c +0 -4
index 1a9b6289637d..737453b6e596 100644
@@ -327,10 +327,6 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi,
 		goto fail;
 	}
 
-	ret = drm_bridge_attach(encoder, hdmi->bridge, NULL);
-	if (ret)
-		goto fail;
-
 	priv->bridges[priv->num_bridges++]       = hdmi->bridge;
 	priv->connectors[priv->num_connectors++] = hdmi->connector;
 
Signature · 6 lines
2.24.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Ilia Mirkin

Each of hdmi and edp are already attached in msm_*_bridge_init. A second attachment returns -EBUSY, failing the driver load.

Tested with HDMI on IFC6410 (APQ8064 / MDP4), but eDP case should be analogous.

Fixes 3ef2f119bd3ed (drm/msm: Use drm_attach_bridge() to attach a bridge to an encoder)
Cc Boris Brezillon <[email protected]>

Thanks

Quoted 38 lines
---
 drivers/gpu/drm/msm/edp/edp.c   | 4 ----
 drivers/gpu/drm/msm/hdmi/hdmi.c | 4 ----
 2 files changed, 8 deletions(-)
drivers/gpu/drm/msm/edp/edp.c +0 -4
index ad4e963ccd9b..106a67473af5 100644
@@ -178,10 +178,6 @@ int msm_edp_modeset_init(struct msm_edp *edp, struct drm_device *dev,
                goto fail;
        }
 
-       ret = drm_bridge_attach(encoder, edp->bridge, NULL);
-       if (ret)
-               goto fail;
-
        priv->bridges[priv->num_bridges++]       = edp->bridge;
        priv->connectors[priv->num_connectors++] = edp->connector;
 
drivers/gpu/drm/msm/hdmi/hdmi.c +0 -5
index 1a9b6289637d..737453b6e596 100644
@@ -327,10 +327,6 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi,
                goto fail;
        }
 
-       ret = drm_bridge_attach(encoder, hdmi->bridge, NULL);
-       if (ret)
-               goto fail;
-
        priv->bridges[priv->num_bridges++]       = hdmi->bridge;
        priv->connectors[priv->num_connectors++] = hdmi->connector;
 
--

2.24.1

Reviewed-by
#2 lore raw
Quoted 8 lines · On Thu, 12 Mar 2020 09:19:58 -0700 Rob Clark <[email protected]> wrote:
Quoted 7 lines · Ilia Mirkin

Each of hdmi and edp are already attached in msm_*_bridge_init. A second attachment returns -EBUSY, failing the driver load.

Tested with HDMI on IFC6410 (APQ8064 / MDP4), but eDP case should be analogous.

Quoted 7 lines
Quoted 3 lines
Fixes 3ef2f119bd3ed (drm/msm: Use drm_attach_bridge() to attach a bridge to an encoder)
Cc Boris Brezillon <[email protected]>

Thanks

Sorry for the regression. Looks like encoder->bridge was assigned twice before my patch, and I didn't check if there were other drm_bridge_attach() calls in the driver :-/.

Quoted 36 lines
Quoted 36 lines
---
 drivers/gpu/drm/msm/edp/edp.c   | 4 ----
 drivers/gpu/drm/msm/hdmi/hdmi.c | 4 ----
 2 files changed, 8 deletions(-)
drivers/gpu/drm/msm/edp/edp.c +0 -4
index ad4e963ccd9b..106a67473af5 100644
@@ -178,10 +178,6 @@ int msm_edp_modeset_init(struct msm_edp *edp, struct drm_device *dev,
                goto fail;
        }
 
-       ret = drm_bridge_attach(encoder, edp->bridge, NULL);
-       if (ret)
-               goto fail;
-
        priv->bridges[priv->num_bridges++]       = edp->bridge;
        priv->connectors[priv->num_connectors++] = edp->connector;
 
drivers/gpu/drm/msm/hdmi/hdmi.c +0 -4
index 1a9b6289637d..737453b6e596 100644
@@ -327,10 +327,6 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi,
                goto fail;
        }
 
-       ret = drm_bridge_attach(encoder, hdmi->bridge, NULL);
-       if (ret)
-               goto fail;
-
        priv->bridges[priv->num_bridges++]       = hdmi->bridge;
        priv->connectors[priv->num_connectors++] = hdmi->connector;
 
Quoted 3 lines
Quoted 3 lines

--
2.24.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Tested-by Reviewed-by on v1 1/1
#3 lore raw
In reply to Ilia Mirkin
Quoted 9 lines · Ilia Mirkin

Each of hdmi and edp are already attached in msm_*_bridge_init. A second attachment returns -EBUSY, failing the driver load.

Tested with HDMI on IFC6410 (APQ8064 / MDP4), but eDP case should be analogous.

Fixes 3ef2f119bd3ed (drm/msm: Use drm_attach_bridge() to attach a bridge to an encoder)
Cc Boris Brezillon <[email protected]>

Had to manually apply this, as the drm_bridge_attach() prototype changed since this patch was written - but this was trivial. This is needed on db820c as well.

Regards,
Bjorn

Quoted 38 lines
---
 drivers/gpu/drm/msm/edp/edp.c   | 4 ----
 drivers/gpu/drm/msm/hdmi/hdmi.c | 4 ----
 2 files changed, 8 deletions(-)
drivers/gpu/drm/msm/edp/edp.c +0 -4
index ad4e963ccd9b..106a67473af5 100644
@@ -178,10 +178,6 @@ int msm_edp_modeset_init(struct msm_edp *edp, struct drm_device *dev,
 		goto fail;
 	}
 
-	ret = drm_bridge_attach(encoder, edp->bridge, NULL);
-	if (ret)
-		goto fail;
-
 	priv->bridges[priv->num_bridges++]       = edp->bridge;
 	priv->connectors[priv->num_connectors++] = edp->connector;
 
drivers/gpu/drm/msm/hdmi/hdmi.c +0 -4
index 1a9b6289637d..737453b6e596 100644
@@ -327,10 +327,6 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi,
 		goto fail;
 	}
 
-	ret = drm_bridge_attach(encoder, hdmi->bridge, NULL);
-	if (ret)
-		goto fail;
-
 	priv->bridges[priv->num_bridges++]       = hdmi->bridge;
 	priv->connectors[priv->num_connectors++] = hdmi->connector;
 
Signature · 1 line
2.24.1