[Intel-gfx] [PATCH 2/3] drm: Sync errno values for property lookup errors

Daniel Vetter daniel at ffwll.ch
Tue Jan 29 08:49:10 UTC 2019


On Fri, Jan 25, 2019 at 11:01:48PM +0200, Ville Syrjälä wrote:
> On Tue, Jan 22, 2019 at 10:39:38AM +0100, Daniel Vetter wrote:
> > On Mon, Jan 21, 2019 at 10:24:29PM +0200, Ville Syrjala wrote:
> > > From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > > 
> > > Use ENOENT consistently for the case where the requested property
> > > isn't found, and EINVAL for the case where the object has no
> > > properties whatsoever. Currenrly these are handled differently
> > > in the atomic and legacy codepaths.
> > > 
> > > Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > 
> > Matches https://dri.freedesktop.org/docs/drm/gpu/drm-uapi.html#recommended-ioctl-return-values
> > 
> > Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> > 
> > Any igts that blow up with this? We should have at least some trying to do
> > invalid stuff ...
> 
> Looks like there was something caught by ci. I'll have to look those
> over.
> 
> Also the logs seem to full of my
> <7> [625.952666] [drm:drm_modeset_backoff] Retrying to avoid deadlock
> 
> Not sure if that debug print is a good idea after all :/

Make it conditional on !CONFIG_WW_MUTEX_DEBUG_SLOWPATH. With that set
(which CI does) you'll get tons of retries.

Or maybe that's the point of all this? We do an awful lot of retries in
CI, to make sure all the error paths work correctly. ww_mutex locking is
essntially our kms error injection tool :-)
-Daniel

> 
> > -Daniel
> > 
> > > ---
> > >  drivers/gpu/drm/drm_atomic_uapi.c | 2 +-
> > >  drivers/gpu/drm/drm_mode_object.c | 1 +
> > >  2 files changed, 2 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
> > > index 06390307e5a3..2a54f826cf65 100644
> > > --- a/drivers/gpu/drm/drm_atomic_uapi.c
> > > +++ b/drivers/gpu/drm/drm_atomic_uapi.c
> > > @@ -1330,7 +1330,7 @@ int drm_mode_atomic_ioctl(struct drm_device *dev,
> > >  			DRM_DEBUG_ATOMIC("Object ID %d has no properties\n",
> > >  					 obj_id);
> > >  			drm_mode_object_put(obj);
> > > -			ret = -ENOENT;
> > > +			ret = -EINVAL;
> > >  			goto out;
> > >  		}
> > >  
> > > diff --git a/drivers/gpu/drm/drm_mode_object.c b/drivers/gpu/drm/drm_mode_object.c
> > > index e8dac94d576d..31730d935842 100644
> > > --- a/drivers/gpu/drm/drm_mode_object.c
> > > +++ b/drivers/gpu/drm/drm_mode_object.c
> > > @@ -527,6 +527,7 @@ int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data,
> > >  	property = drm_mode_obj_find_prop_id(arg_obj, arg->prop_id);
> > >  	if (!property) {
> > >  		DRM_DEBUG_KMS("Unknown property ID %d\n", arg->prop_id);
> > > +		ret = -ENOENT;
> > >  		goto out_unref;
> > >  	}
> > >  
> > > -- 
> > > 2.19.2
> > > 
> > > _______________________________________________
> > > Intel-gfx mailing list
> > > Intel-gfx at lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> > 
> > -- 
> > Daniel Vetter
> > Software Engineer, Intel Corporation
> > http://blog.ffwll.ch
> 
> -- 
> Ville Syrjälä
> Intel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the dri-devel mailing list