diff options
-rw-r--r-- | drivers/gpu/drm/drm_crtc.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index b7021069b078..e79c8d3700d8 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c | |||
@@ -3400,7 +3400,16 @@ void drm_fb_release(struct drm_file *priv) | |||
3400 | struct drm_device *dev = priv->minor->dev; | 3400 | struct drm_device *dev = priv->minor->dev; |
3401 | struct drm_framebuffer *fb, *tfb; | 3401 | struct drm_framebuffer *fb, *tfb; |
3402 | 3402 | ||
3403 | mutex_lock(&priv->fbs_lock); | 3403 | /* |
3404 | * When the file gets released that means no one else can access the fb | ||
3405 | * list any more, so no need to grab fpriv->fbs_lock. And we need to to | ||
3406 | * avoid upsetting lockdep since the universal cursor code adds a | ||
3407 | * framebuffer while holding mutex locks. | ||
3408 | * | ||
3409 | * Note that a real deadlock between fpriv->fbs_lock and the modeset | ||
3410 | * locks is impossible here since no one else but this function can get | ||
3411 | * at it any more. | ||
3412 | */ | ||
3404 | list_for_each_entry_safe(fb, tfb, &priv->fbs, filp_head) { | 3413 | list_for_each_entry_safe(fb, tfb, &priv->fbs, filp_head) { |
3405 | 3414 | ||
3406 | mutex_lock(&dev->mode_config.fb_lock); | 3415 | mutex_lock(&dev->mode_config.fb_lock); |
@@ -3413,7 +3422,6 @@ void drm_fb_release(struct drm_file *priv) | |||
3413 | /* This will also drop the fpriv->fbs reference. */ | 3422 | /* This will also drop the fpriv->fbs reference. */ |
3414 | drm_framebuffer_remove(fb); | 3423 | drm_framebuffer_remove(fb); |
3415 | } | 3424 | } |
3416 | mutex_unlock(&priv->fbs_lock); | ||
3417 | } | 3425 | } |
3418 | 3426 | ||
3419 | /** | 3427 | /** |