drm/radeon/kms: don't allow ERESTART to hit userspace.
authorDave Airlie <airlied@linux.ie>
Tue, 8 Sep 2009 04:38:45 +0000 (14:38 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 8 Sep 2009 04:43:27 +0000 (14:43 +1000)
the pre-r600 fence code returns ebusy if we get hit by a signal
so we should continue to do that.

Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/radeon_fence.c

index 506dd4dd3a244dbf173cf5ea526b75a6a471ce6e..01a89633e2659f0dba8f48098ed4e6de947e9451 100644 (file)
@@ -199,7 +199,7 @@ int r600_fence_wait(struct radeon_fence *fence,  bool intr, bool lazy)
                        schedule_timeout(1);
 
                if (intr && signal_pending(current)) {
-                       ret = -ERESTART;
+                       ret = -ERESTARTSYS;
                        break;
                }
        }
@@ -225,8 +225,12 @@ int radeon_fence_wait(struct radeon_fence *fence, bool intr)
                return 0;
        }
 
-       if (rdev->family >= CHIP_R600)
-               return r600_fence_wait(fence, intr, 0);
+       if (rdev->family >= CHIP_R600) {
+               r = r600_fence_wait(fence, intr, 0);
+               if (r == -ERESTARTSYS)
+                       return -EBUSY;
+               return r;
+       }
 
 retry:
        cur_jiffies = jiffies;