drm/amd/amdkfd: Fix kernel panic when reset failed and been triggered again
authorjsg <jsg@openbsd.org>
Wed, 8 Dec 2021 11:36:25 +0000 (11:36 +0000)
committerjsg <jsg@openbsd.org>
Wed, 8 Dec 2021 11:36:25 +0000 (11:36 +0000)
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

index 352a32d..2645ebc 100644 (file)
@@ -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;