[PATCH 1/1] drm/bridge: Silence error messages upon probe deferral

Alexander Stein alexander.stein at ew.tq-group.com
Wed Jun 7 11:26:03 UTC 2023


Hi Laurent,

Am Dienstag, 6. Juni 2023, 17:12:29 CEST schrieb Laurent Pinchart:
> Hi Alexander,
> 
> Thank you for the patch.
> 
> On Tue, Jun 06, 2023 at 04:48:33PM +0200, Alexander Stein wrote:
> > When -EPROBE_DEFER is returned do not raise an error, but silently return
> > this error instead. Fixes error like this:
> > [drm:drm_bridge_attach] *ERROR* failed to attach bridge
> > /soc at 0/bus at 30800000/mipi-dsi at 30a00000 to encoder None-34: -517
> > [drm:drm_bridge_attach] *ERROR* failed to attach bridge
> > /soc at 0/bus at 30800000/mipi-dsi at 30a00000 to encoder None-34: -517
> > 
> > Signed-off-by: Alexander Stein <alexander.stein at ew.tq-group.com>
> > ---
> > dev_err_probe() would be the best, but I am not sure if this function is
> > always used within a driver's probe() call.
> > 
> >  drivers/gpu/drm/drm_bridge.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c
> > index c3d69af02e79d..07773d6441a1f 100644
> > --- a/drivers/gpu/drm/drm_bridge.c
> > +++ b/drivers/gpu/drm/drm_bridge.c
> > @@ -350,6 +350,7 @@ int drm_bridge_attach(struct drm_encoder *encoder,
> > struct drm_bridge *bridge,> 
> >  	bridge->encoder = NULL;
> >  	list_del(&bridge->chain_node);
> > 
> > +	if (ret != -EPROBE_DEFER) {
> > 
> >  #ifdef CONFIG_OF
> >  
> >  	DRM_ERROR("failed to attach bridge %pOF to encoder %s: %d\n",
> >  	
> >  		  bridge->of_node, encoder->name, ret);
> 
> Wrong indentation.

Ah, right. Thanks for pointing out.

> dev_err_probe() could be useful, but this function is likely not called
> from probe paths only :-S

I was afraid this might be the cause. But I'm wondering in which situation 
this can be the case, hence -EPROBE_DEFER could be returned then.

> When not called from a probe path, dropping the message will result in a
> silent error, which would be hard to debug :-(

On the other hand -EPROBE_DEFER is invalid on non-probe path also.
Assuming dev_err_probe is used here, an error will still be raised, -
EPROBE_DEFER should not occur then.

Best regards,
Alexander

> > @@ -357,6 +358,7 @@ int drm_bridge_attach(struct drm_encoder *encoder,
> > struct drm_bridge *bridge,> 
> >  	DRM_ERROR("failed to attach bridge to encoder %s: %d\n",
> >  	
> >  		  encoder->name, ret);
> >  
> >  #endif
> > 
> > +	}
> > 
> >  	return ret;
> >  
> >  }


-- 
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/




More information about the dri-devel mailing list