|
@@ -3400,7 +3400,16 @@ void drm_fb_release(struct drm_file *priv)
|
|
|
struct drm_device *dev = priv->minor->dev;
|
|
|
struct drm_framebuffer *fb, *tfb;
|
|
|
|
|
|
- mutex_lock(&priv->fbs_lock);
|
|
|
+ /*
|
|
|
+ * When the file gets released that means no one else can access the fb
|
|
|
+ * list any more, so no need to grab fpriv->fbs_lock. And we need to to
|
|
|
+ * avoid upsetting lockdep since the universal cursor code adds a
|
|
|
+ * framebuffer while holding mutex locks.
|
|
|
+ *
|
|
|
+ * Note that a real deadlock between fpriv->fbs_lock and the modeset
|
|
|
+ * locks is impossible here since no one else but this function can get
|
|
|
+ * at it any more.
|
|
|
+ */
|
|
|
list_for_each_entry_safe(fb, tfb, &priv->fbs, filp_head) {
|
|
|
|
|
|
mutex_lock(&dev->mode_config.fb_lock);
|
|
@@ -3413,7 +3422,6 @@ void drm_fb_release(struct drm_file *priv)
|
|
|
/* This will also drop the fpriv->fbs reference. */
|
|
|
drm_framebuffer_remove(fb);
|
|
|
}
|
|
|
- mutex_unlock(&priv->fbs_lock);
|
|
|
}
|
|
|
|
|
|
/**
|