aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2012-12-17 10:29:06 -0500
committerAlex Deucher <alexander.deucher@amd.com>2012-12-19 17:44:05 -0500
commit76903b96adbfbb38b049765add21e02e44c387a5 (patch)
tree2dadaf5ec55c26195fb8c33cc5a4300f86bf01fc /drivers/gpu/drm/radeon
parent0953e76e91f4b6206cef50bd680696dc6bf1ef99 (diff)
drm/radeon: don't leave fence blocked process on failed GPU reset
Force all fence to signal if GPU reset failed so no process get stuck on waiting fence. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/gpu/drm/radeon')
-rw-r--r--drivers/gpu/drm/radeon/radeon.h1
-rw-r--r--drivers/gpu/drm/radeon/radeon_device.c1
-rw-r--r--drivers/gpu/drm/radeon/radeon_fence.c19
3 files changed, 21 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index 5dc744d43d12..aae73141d63a 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -225,6 +225,7 @@ struct radeon_fence {
225int radeon_fence_driver_start_ring(struct radeon_device *rdev, int ring); 225int radeon_fence_driver_start_ring(struct radeon_device *rdev, int ring);
226int radeon_fence_driver_init(struct radeon_device *rdev); 226int radeon_fence_driver_init(struct radeon_device *rdev);
227void radeon_fence_driver_fini(struct radeon_device *rdev); 227void radeon_fence_driver_fini(struct radeon_device *rdev);
228void radeon_fence_driver_force_completion(struct radeon_device *rdev);
228int radeon_fence_emit(struct radeon_device *rdev, struct radeon_fence **fence, int ring); 229int radeon_fence_emit(struct radeon_device *rdev, struct radeon_fence **fence, int ring);
229void radeon_fence_process(struct radeon_device *rdev, int ring); 230void radeon_fence_process(struct radeon_device *rdev, int ring);
230bool radeon_fence_signaled(struct radeon_fence *fence); 231bool radeon_fence_signaled(struct radeon_fence *fence);
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index 49b06590001e..e81d6cab9959 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -1358,6 +1358,7 @@ retry:
1358 } 1358 }
1359 } 1359 }
1360 } else { 1360 } else {
1361 radeon_fence_driver_force_completion(rdev);
1361 for (i = 0; i < RADEON_NUM_RINGS; ++i) { 1362 for (i = 0; i < RADEON_NUM_RINGS; ++i) {
1362 kfree(ring_data[i]); 1363 kfree(ring_data[i]);
1363 } 1364 }
diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c
index 410a975a8eec..a9b0fa5608eb 100644
--- a/drivers/gpu/drm/radeon/radeon_fence.c
+++ b/drivers/gpu/drm/radeon/radeon_fence.c
@@ -868,6 +868,25 @@ void radeon_fence_driver_fini(struct radeon_device *rdev)
868 mutex_unlock(&rdev->ring_lock); 868 mutex_unlock(&rdev->ring_lock);
869} 869}
870 870
871/**
872 * radeon_fence_driver_force_completion - force all fence waiter to complete
873 *
874 * @rdev: radeon device pointer
875 *
876 * In case of GPU reset failure make sure no process keep waiting on fence
877 * that will never complete.
878 */
879void radeon_fence_driver_force_completion(struct radeon_device *rdev)
880{
881 int ring;
882
883 for (ring = 0; ring < RADEON_NUM_RINGS; ring++) {
884 if (!rdev->fence_drv[ring].initialized)
885 continue;
886 radeon_fence_write(rdev, rdev->fence_drv[ring].sync_seq[ring], ring);
887 }
888}
889
871 890
872/* 891/*
873 * Fence debugfs 892 * Fence debugfs