[PATCH] drm: Paper over locking inversion after registration rework

Chris Wilson chris at chris-wilson.co.uk
Thu Aug 4 16:13:58 UTC 2016


On Thu, Aug 04, 2016 at 12:15:14PM +0200, Daniel Vetter wrote:
> drm_connector_register_all requires a few too many locks because our
> connector_list locking is busted. Add another FIXME+hack to work
> around this. This should address the below lockdep splat:
> 
> Cc: Imre Deak <imre.deak at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> ---
>  drivers/gpu/drm/drm_connector.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index ef921fa09a84..d9104d8b3c6b 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -401,16 +401,14 @@ int drm_connector_register_all(struct drm_device *dev)
>  	struct drm_connector *connector;
>  	int ret;
>  
> -	mutex_lock(&dev->mode_config.mutex);
> -
> -	drm_for_each_connector(connector, dev) {
> +	/* FIXME: taking the mode config mutex ends up in a clash with
> +	 * fbcon/backlight registration */
> +	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {

Ok, double checked that the only time we delete from this list
(currently) is in cleanup. That's highly unlikely to be running at the
same time as the register, so

Acked-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the dri-devel mailing list