drm/nouveau: Move the fence wait before migration resource clean-up.
authorFrancisco Jerez <currojerez@riseup.net>
Sun, 4 Jul 2010 10:54:23 +0000 (12:54 +0200)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 13 Jul 2010 00:13:27 +0000 (10:13 +1000)
Avoids an oops in the fence wait failure path (bug 26521).

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Tested-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_bo.c

index 9f5ab46..1371c77 100644 (file)
@@ -461,9 +461,9 @@ nouveau_bo_move_accel_cleanup(struct nouveau_channel *chan,
                return ret;
 
        ret = ttm_bo_move_accel_cleanup(&nvbo->bo, fence, NULL,
-                                       evict, no_wait_reserve, no_wait_gpu, new_mem);
-       if (nvbo->channel && nvbo->channel != chan)
-               ret = nouveau_fence_wait(fence, NULL, false, false);
+                                       evict || (nvbo->channel &&
+                                                 nvbo->channel != chan),
+                                       no_wait_reserve, no_wait_gpu, new_mem);
        nouveau_fence_unref((void *)&fence);
        return ret;
 }