ttm: Return -ERESTART when a signal interrupts bo eviction.
authorThomas Hellstrom <thellstrom@vmware.com>
Wed, 17 Jun 2009 10:29:55 +0000 (12:29 +0200)
committerDave Airlie <airlied@redhat.com>
Thu, 18 Jun 2009 23:01:02 +0000 (09:01 +1000)
A bug caused the ttm code to just terminate the wait when a signal
was received while waiting for the GPU to release a buffer object that
was to be evicted.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/ttm/ttm_bo.c

index 1587aeca7bea73d20ec27ced01de75bb28acdacf..b82ba6e5a58690a4648e2ba147e3201abd46f6ca 100644 (file)
@@ -527,9 +527,12 @@ static int ttm_bo_evict(struct ttm_buffer_object *bo, unsigned mem_type,
        ret = ttm_bo_wait(bo, false, interruptible, no_wait);
        spin_unlock(&bo->lock);
 
-       if (ret && ret != -ERESTART) {
-               printk(KERN_ERR TTM_PFX "Failed to expire sync object before "
-                      "buffer eviction.\n");
+       if (unlikely(ret != 0)) {
+               if (ret != -ERESTART) {
+                       printk(KERN_ERR TTM_PFX
+                              "Failed to expire sync object before "
+                              "buffer eviction.\n");
+               }
                goto out;
        }