drm/nouveau: complain loudly if buffer is pinned during destruction
authorMaarten Lankhorst <m.b.lankhorst@gmail.com>
Thu, 27 Jun 2013 11:38:22 +0000 (13:38 +0200)
committerDave Airlie <airlied@redhat.com>
Fri, 28 Jun 2013 01:56:11 +0000 (11:56 +1000)
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>
drivers/gpu/drm/nouveau/nouveau_gem.c

index b4b4d0c1f4aff944f2a260fe9ba2754b4ac58723..705470600e483dbc0c729fafb7e5bd8205d8ab25 100644 (file)
@@ -50,7 +50,8 @@ nouveau_gem_object_del(struct drm_gem_object *gem)
                return;
        nvbo->gem = NULL;
 
-       if (unlikely(nvbo->pin_refcnt)) {
+       /* Lockdep hates you for doing reserve with gem object lock held */
+       if (WARN_ON_ONCE(nvbo->pin_refcnt)) {
                nvbo->pin_refcnt = 1;
                nouveau_bo_unpin(nvbo);
        }