drm/ttm: Fix spinlock imbalance
authorThomas Hellstrom <thellstrom@vmware.com>
Fri, 1 Jun 2012 13:39:11 +0000 (15:39 +0200)
committerDave Airlie <airlied@redhat.com>
Fri, 1 Jun 2012 16:00:19 +0000 (17:00 +0100)
This imbalance may cause hangs when TTM is trying to swap out a buffer
that is already on the delayed delete list.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/ttm/ttm_bo.c

index 36792bd4da77598e69dad490b3cf4b4ac39828f1..b67cfcaa661f87bffbb84d3f0ed9786efb591e5a 100644 (file)
@@ -1834,6 +1834,7 @@ static int ttm_bo_swapout(struct ttm_mem_shrink *shrink)
                        spin_unlock(&glob->lru_lock);
                        (void) ttm_bo_cleanup_refs(bo, false, false, false);
                        kref_put(&bo->list_kref, ttm_bo_release_list);
+                       spin_lock(&glob->lru_lock);
                        continue;
                }