Re: [PATCH] drm: Fixup locking WARNINGs in drm_mode_config_reset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 29, 2015 at 08:32:43AM +0200, Daniel Vetter wrote:
> With
> 
> commit 7a3f3d6667f5f9ffd1517f6b21d64bbf5312042c
> Author: Daniel Vetter <daniel.vetter@xxxxxxxx>
> Date:   Thu Jul 9 23:44:28 2015 +0200
> 
>     drm: Check locking in drm_for_each_connector
> 
> we started checking the locking in drm_for_each_connector but somehow
> I totally missed drm_mode_config_reset. There's no problem there since
> this function should only be called in single-threaded contexts
> (driver load or resume), so just wrap the loop with the right lock.
> 
> v2: Drink coffee and all that ...
> 
> Cc: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
> Reported-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
> Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxxx>

Tested-by: Jianwei Wang <jianwei.wang.chn@xxxxxxxxx>

> ---
>  drivers/gpu/drm/drm_crtc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index c91c18b2b1d4..10c1a0f6680c 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -5273,9 +5273,11 @@ void drm_mode_config_reset(struct drm_device *dev)
>  		if (encoder->funcs->reset)
>  			encoder->funcs->reset(encoder);
>  
> +	mutex_lock(&dev->mode_config.mutex);
>  	drm_for_each_connector(connector, dev)
>  		if (connector->funcs->reset)
>  			connector->funcs->reset(connector);
> +	mutex_unlock(&dev->mode_config.mutex);
>  }
>  EXPORT_SYMBOL(drm_mode_config_reset);
>  
> -- 
> 2.1.4
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux