diff mbox series

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

Message ID 20200312035154.1621-1-imirkin@alum.mit.edu (mailing list archive)
State Accepted
Commit c479017faa3a9f6c60ea18ffe44e20b33487e10e
Headers show
Series drm/msm: avoid double-attaching hdmi/edp bridges | expand

Commit Message

Ilia Mirkin March 12, 2020, 3:51 a.m. UTC
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 <boris.brezillon@collabora.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
---
 drivers/gpu/drm/msm/edp/edp.c   | 4 ----
 drivers/gpu/drm/msm/hdmi/hdmi.c | 4 ----
 2 files changed, 8 deletions(-)

Comments

Rob Clark March 12, 2020, 4:19 p.m. UTC | #1
On Wed, Mar 11, 2020 at 8:52 PM Ilia Mirkin <imirkin@alum.mit.edu> wrote:
>
> 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 <boris.brezillon@collabora.com>
> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>

Thanks

Reviewed-by: Rob Clark <robdclark@gmail.com>

> ---
>  drivers/gpu/drm/msm/edp/edp.c   | 4 ----
>  drivers/gpu/drm/msm/hdmi/hdmi.c | 4 ----
>  2 files changed, 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/edp/edp.c b/drivers/gpu/drm/msm/edp/edp.c
> index ad4e963ccd9b..106a67473af5 100644
> --- a/drivers/gpu/drm/msm/edp/edp.c
> +++ b/drivers/gpu/drm/msm/edp/edp.c
> @@ -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;
>
> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
> index 1a9b6289637d..737453b6e596 100644
> --- a/drivers/gpu/drm/msm/hdmi/hdmi.c
> +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
> @@ -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
>
Boris Brezillon March 12, 2020, 4:44 p.m. UTC | #2
On Thu, 12 Mar 2020 09:19:58 -0700
Rob Clark <robdclark@gmail.com> wrote:

> On Wed, Mar 11, 2020 at 8:52 PM Ilia Mirkin <imirkin@alum.mit.edu> wrote:
> >
> > 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 <boris.brezillon@collabora.com>
> > Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>  
> 
> Thanks
> 
> Reviewed-by: Rob Clark <robdclark@gmail.com>


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 :-/.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>


> 
> > ---
> >  drivers/gpu/drm/msm/edp/edp.c   | 4 ----
> >  drivers/gpu/drm/msm/hdmi/hdmi.c | 4 ----
> >  2 files changed, 8 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/msm/edp/edp.c b/drivers/gpu/drm/msm/edp/edp.c
> > index ad4e963ccd9b..106a67473af5 100644
> > --- a/drivers/gpu/drm/msm/edp/edp.c
> > +++ b/drivers/gpu/drm/msm/edp/edp.c
> > @@ -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;
> >
> > diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
> > index 1a9b6289637d..737453b6e596 100644
> > --- a/drivers/gpu/drm/msm/hdmi/hdmi.c
> > +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
> > @@ -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
> >
Bjorn Andersson March 19, 2020, 6:52 p.m. UTC | #3
On Wed 11 Mar 20:51 PDT 2020, Ilia Mirkin wrote:

> 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 <boris.brezillon@collabora.com>
> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>

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.

Tested-by: Bjorn Andersson <bjorn.andersson@linaro.org> (hdmi part)
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

> ---
>  drivers/gpu/drm/msm/edp/edp.c   | 4 ----
>  drivers/gpu/drm/msm/hdmi/hdmi.c | 4 ----
>  2 files changed, 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/edp/edp.c b/drivers/gpu/drm/msm/edp/edp.c
> index ad4e963ccd9b..106a67473af5 100644
> --- a/drivers/gpu/drm/msm/edp/edp.c
> +++ b/drivers/gpu/drm/msm/edp/edp.c
> @@ -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;
>  
> diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
> index 1a9b6289637d..737453b6e596 100644
> --- a/drivers/gpu/drm/msm/hdmi/hdmi.c
> +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
> @@ -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
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/edp/edp.c b/drivers/gpu/drm/msm/edp/edp.c
index ad4e963ccd9b..106a67473af5 100644
--- a/drivers/gpu/drm/msm/edp/edp.c
+++ b/drivers/gpu/drm/msm/edp/edp.c
@@ -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;
 
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
index 1a9b6289637d..737453b6e596 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
@@ -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;