From 38326f19181840fbe95a65bdc1861dc52c55cc6b Mon Sep 17 00:00:00 2001 From: jsg Date: Wed, 8 Dec 2021 11:36:25 +0000 Subject: [PATCH] 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 --- sys/dev/pci/drm/amd/amdkfd/kfd_device_queue_manager.c | 5 +++++ 1 file changed, 5 insertions(+) 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; -- 2.20.1