aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau
diff options
context:
space:
mode:
authorMaarten Lankhorst <m.b.lankhorst@gmail.com>2013-06-27 07:38:22 -0400
committerDave Airlie <airlied@redhat.com>2013-06-27 21:56:11 -0400
commit27f06b2dbb84cf44b9ff404db1b93f14796ba559 (patch)
treed591dd1ce42326cb61b27f258d6665f03fccbfac /drivers/gpu/drm/nouveau
parent1e2bd5f53b6282e711e9f074765911868f8e7dc1 (diff)
drm/nouveau: complain loudly if buffer is pinned during destruction
Shouldn't happen, and we invert the struct_mutex with reservation here, potentially leading to deadlocks. Once reservations become lockdep annotated, lockdep will go splat on this. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Acked-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_gem.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
index b4b4d0c1f4af..705470600e48 100644
--- a/drivers/gpu/drm/nouveau/nouveau_gem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
@@ -50,7 +50,8 @@ nouveau_gem_object_del(struct drm_gem_object *gem)
50 return; 50 return;
51 nvbo->gem = NULL; 51 nvbo->gem = NULL;
52 52
53 if (unlikely(nvbo->pin_refcnt)) { 53 /* Lockdep hates you for doing reserve with gem object lock held */
54 if (WARN_ON_ONCE(nvbo->pin_refcnt)) {
54 nvbo->pin_refcnt = 1; 55 nvbo->pin_refcnt = 1;
55 nouveau_bo_unpin(nvbo); 56 nouveau_bo_unpin(nvbo);
56 } 57 }