summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2021-12-08 11:36:26 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2021-12-08 11:36:26 +0000
commit4a8d6320d1d6cea7a9427e7b0e09c845ac4b8432 (patch)
treea0d28e5341c4de83582e2244ee495aacb26ee2e7 /sys/dev
parentccf2f81fae9228b20439588d976b016b5fb66c63 (diff)
drm/amd/amdkfd: Fix kernel panic when reset failed and been triggered again
From shaoyunl 74aafe99efb68f15e50be9f7032c2168512f98a8 in linux 5.10.y/5.10.84 2cf49e00d40d5132e3d067b5aa6d84791929ab15 in mainline linux
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/drm/amd/amdkfd/kfd_device_queue_manager.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/dev/pci/drm/amd/amdkfd/kfd_device_queue_manager.c b/sys/dev/pci/drm/amd/amdkfd/kfd_device_queue_manager.c
index 352a32dc609..2645ebc63a1 100644
--- a/sys/dev/pci/drm/amd/amdkfd/kfd_device_queue_manager.c
+++ b/sys/dev/pci/drm/amd/amdkfd/kfd_device_queue_manager.c
@@ -1207,6 +1207,11 @@ static int stop_cpsch(struct device_queue_manager *dqm)
bool hanging;
dqm_lock(dqm);
+ if (!dqm->sched_running) {
+ dqm_unlock(dqm);
+ return 0;
+ }
+
if (!dqm->is_hws_hang)
unmap_queues_cpsch(dqm, KFD_UNMAP_QUEUES_FILTER_ALL_QUEUES, 0);
hanging = dqm->is_hws_hang || dqm->is_resetting;