summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
diff options
context:
space:
mode:
authorChunming Zhou <David1.Zhou@amd.com>2016-06-12 15:41:58 +0800
committerAlex Deucher <alexander.deucher@amd.com>2016-07-07 14:54:43 -0400
commit0875dc9e80eb3b01406b21947c140265527488ba (patch)
tree95f73a81c6aefbfc0649918b3acbceee7d514093 /drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
parenteafc9c2704aa71806771f809233c4f374d0a0a22 (diff)
downloadlwn-0875dc9e80eb3b01406b21947c140265527488ba.tar.gz
lwn-0875dc9e80eb3b01406b21947c140265527488ba.zip
drm/amdgpu: block scheduler when gpu reset
Signed-off-by: Chunming Zhou <David1.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_device.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index ae801e9cec94..a7a84286a06f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -25,6 +25,7 @@
* Alex Deucher
* Jerome Glisse
*/
+#include <linux/kthread.h>
#include <linux/console.h>
#include <linux/slab.h>
#include <linux/debugfs.h>
@@ -1895,6 +1896,14 @@ int amdgpu_gpu_reset(struct amdgpu_device *adev)
atomic_inc(&adev->gpu_reset_counter);
+ /* block scheduler */
+ for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
+ struct amdgpu_ring *ring = adev->rings[i];
+
+ if (!ring)
+ continue;
+ kthread_park(ring->sched.thread);
+ }
/* block TTM */
resched = ttm_bo_lock_delayed_workqueue(&adev->mman.bdev);
@@ -1928,7 +1937,7 @@ retry:
struct amdgpu_ring *ring = adev->rings[i];
if (!ring)
continue;
-
+ kthread_unpark(ring->sched.thread);
amdgpu_ring_restore(ring, ring_sizes[i], ring_data[i]);
ring_sizes[i] = 0;
ring_data[i] = NULL;
@@ -1946,8 +1955,10 @@ retry:
} else {
amdgpu_fence_driver_force_completion(adev);
for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
- if (adev->rings[i])
+ if (adev->rings[i]) {
+ kthread_unpark(adev->rings[i]->sched.thread);
kfree(ring_data[i]);
+ }
}
}