linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] drm/imx: imx-ldb: Accept drm_of_find_panel_or_bridge failure
@ 2017-05-10 13:17 Leonard Crestez
  2017-05-10 13:55 ` Philipp Zabel
  0 siblings, 1 reply; 3+ messages in thread
From: Leonard Crestez @ 2017-05-10 13:17 UTC (permalink / raw)
  To: Philipp Zabel, Rob Herring, David Airlie
  Cc: Leonard Crestez, Daniel Vetter, Jani Nikula, Sean Paul,
	Archit Taneja, Liu Ying, Lucas Stach, Steve Longerbeam,
	Peter Senna Tschudin, Cristina Ciocan, Octavian Purdila,
	dri-devel, linux-kernel

Not having an endpoint bound in DT should not cause a failure here,
there are fallbacks. So explicitly accept a missing endpoint.

This behavior change was introduced by refactoring in drm_of parsing
code and it should not require dts changes.

In particular this fixes imx6qdl-sabreauto boards.

Link: https://lists.freedesktop.org/archives/dri-devel/2017-May/141233.html
Fixes: ebc944613567 ("drm: convert drivers to use drm_of_find_panel_or_bridge")
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>

---

This relies on drm_of_find_panel_or_bridge returning -ENODEV
specifically if no remote is found for the endpoint. This behavior can
be seen by looking at the code but is not otherwise obviously
guaranteed.

Perhaps this should be explicitly mentioned in that function's
documentation?

Changes since v1:
* Fix returning if ret is 0.

 drivers/gpu/drm/imx/imx-ldb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c
index 8fb801f..8b05ecb 100644
--- a/drivers/gpu/drm/imx/imx-ldb.c
+++ b/drivers/gpu/drm/imx/imx-ldb.c
@@ -673,7 +673,7 @@ static int imx_ldb_bind(struct device *dev, struct device *master, void *data)
 		ret = drm_of_find_panel_or_bridge(child,
 						  imx_ldb->lvds_mux ? 4 : 2, 0,
 						  &channel->panel, &channel->bridge);
-		if (ret)
+		if (ret && ret != -ENODEV)
 			return ret;
 
 		/* panel ddc only if there is no bridge */
-- 
2.7.4

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

* Re: [PATCH v2] drm/imx: imx-ldb: Accept drm_of_find_panel_or_bridge failure
  2017-05-10 13:17 [PATCH v2] drm/imx: imx-ldb: Accept drm_of_find_panel_or_bridge failure Leonard Crestez
@ 2017-05-10 13:55 ` Philipp Zabel
  2017-06-07 10:35   ` Leonard Crestez
  0 siblings, 1 reply; 3+ messages in thread
From: Philipp Zabel @ 2017-05-10 13:55 UTC (permalink / raw)
  To: Leonard Crestez
  Cc: Rob Herring, David Airlie, Daniel Vetter, Jani Nikula, Sean Paul,
	Archit Taneja, Liu Ying, Lucas Stach, Steve Longerbeam,
	Peter Senna Tschudin, Cristina Ciocan, Octavian Purdila,
	dri-devel, linux-kernel

On Wed, 2017-05-10 at 16:17 +0300, Leonard Crestez wrote:
> Not having an endpoint bound in DT should not cause a failure here,
> there are fallbacks. So explicitly accept a missing endpoint.
> 
> This behavior change was introduced by refactoring in drm_of parsing
> code and it should not require dts changes.
> 
> In particular this fixes imx6qdl-sabreauto boards.
> 
> Link: https://lists.freedesktop.org/archives/dri-devel/2017-May/141233.html
> Fixes: ebc944613567 ("drm: convert drivers to use drm_of_find_panel_or_bridge")
> Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
> 
> ---
> 
> This relies on drm_of_find_panel_or_bridge returning -ENODEV
> specifically if no remote is found for the endpoint. This behavior can
> be seen by looking at the code but is not otherwise obviously
> guaranteed.
> 
> Perhaps this should be explicitly mentioned in that function's
> documentation?
> 
> Changes since v1:
> * Fix returning if ret is 0.
> 
>  drivers/gpu/drm/imx/imx-ldb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c
> index 8fb801f..8b05ecb 100644
> --- a/drivers/gpu/drm/imx/imx-ldb.c
> +++ b/drivers/gpu/drm/imx/imx-ldb.c
> @@ -673,7 +673,7 @@ static int imx_ldb_bind(struct device *dev, struct device *master, void *data)
>  		ret = drm_of_find_panel_or_bridge(child,
>  						  imx_ldb->lvds_mux ? 4 : 2, 0,
>  						  &channel->panel, &channel->bridge);
> -		if (ret)
> +		if (ret && ret != -ENODEV)
>  			return ret;
>  
>  		/* panel ddc only if there is no bridge */

Thank you, applied to imx-drm/fixes.

regards
Philipp

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

* Re: [PATCH v2] drm/imx: imx-ldb: Accept drm_of_find_panel_or_bridge failure
  2017-05-10 13:55 ` Philipp Zabel
@ 2017-06-07 10:35   ` Leonard Crestez
  0 siblings, 0 replies; 3+ messages in thread
From: Leonard Crestez @ 2017-06-07 10:35 UTC (permalink / raw)
  To: Philipp Zabel; +Cc: David Airlie, dri-devel, linux-kernel

On Wed, 2017-05-10 at 15:55 +0200, Philipp Zabel wrote:
> On Wed, 2017-05-10 at 16:17 +0300, Leonard Crestez wrote:
> > 
> > Not having an endpoint bound in DT should not cause a failure here,
> > there are fallbacks. So explicitly accept a missing endpoint.
> > 
> > This behavior change was introduced by refactoring in drm_of parsing
> > code and it should not require dts changes.
> > 
> > In particular this fixes imx6qdl-sabreauto boards.
> > 
> > diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c
> > index 8fb801f..8b05ecb 100644
> > --- a/drivers/gpu/drm/imx/imx-ldb.c
> > +++ b/drivers/gpu/drm/imx/imx-ldb.c
> > @@ -673,7 +673,7 @@ static int imx_ldb_bind(struct device *dev, struct device *master, void *data)
> >  		ret = drm_of_find_panel_or_bridge(child,
> >  						  imx_ldb->lvds_mux ? 4 : 2, 0,
> >  						  &channel->panel, &channel->bridge);
> > -		if (ret)
> > +		if (ret && ret != -ENODEV)
> >  			return ret;
> >  
> >  		/* panel ddc only if there is no bridge */
> Thank you, applied to imx-drm/fixes.
> 
> regards
> Philipp

How are such fixes going to make their way upstream? It's been almost a
month and this patch did not get into either linux-next or
torvalds/master or anywhere other than pza/imx-drm/fixes.

--
Regards,
Leonard

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

end of thread, other threads:[~2017-06-07 10:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-10 13:17 [PATCH v2] drm/imx: imx-ldb: Accept drm_of_find_panel_or_bridge failure Leonard Crestez
2017-05-10 13:55 ` Philipp Zabel
2017-06-07 10:35   ` Leonard Crestez

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).