All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	DRI Development <dri-devel@lists.freedesktop.org>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH] drm: Fixup locking WARNINGs in drm_mode_config_reset
Date: Wed, 29 Jul 2015 10:19:08 +0200	[thread overview]
Message-ID: <20150729081908.GP16722@phenom.ffwll.local> (raw)
In-Reply-To: <1438151563-8369-1-git-send-email-daniel.vetter@ffwll.ch>

On Wed, Jul 29, 2015 at 08:32:43AM +0200, Daniel Vetter wrote:
> With
> 
> commit 7a3f3d6667f5f9ffd1517f6b21d64bbf5312042c
> Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> 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@ideasonboard.com>
> Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

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

> ---
>  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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-07-29  8:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-29  6:27 [PATCH] drm: Fixup locking WARNINGs in drm_mode_config_reset Daniel Vetter
2015-07-29  6:32 ` Daniel Vetter
2015-07-29  8:19   ` Daniel Vetter [this message]
2015-07-29 20:15   ` Laurent Pinchart
2015-07-29 22:24     ` Daniel Vetter
2015-07-30  7:44   ` shuang.he

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150729081908.GP16722@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.