Skip to contentSkip to conversation

drm/amd/amdkfd: Fix kernel panic when reset failed and been triggered again

PATCH In review shaoyunl 2 participants 2 messages Nov 15, 2021

Subsystems (3)
lore
Share & tools
lore

shaoyunl

author
#0 lore raw

PATCH 1/1 drm/amd/amdkfd: Fix kernel panic when reset failed and been triggered again

In SRIOV configuration, the reset may failed to bring asic back to normal but stop cpsch already been called, the start_cpsch will not be called since there is no resume in this case. When reset been triggered again, driver should avoid to do uninitialization again.

---
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +5 -0
index 42b2cc999434..62fe28244a80 100644
@@ -1225,6 +1225,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;
Signature · 1 line
2.17.1
maintainer Reviewed-by on v1 1/1
#1 lore raw

Am 2021-11-15 um 11:20 a.m. schrieb shaoyunl:

Quoted 5 lines

In SRIOV configuration, the reset may failed to bring asic back to normal but stop cpsch already been called, the start_cpsch will not be called since there is no resume in this case. When reset been triggered again, driver should avoid to do uninitialization again.

Quoted 20 lines
---
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +5 -0
index 42b2cc999434..62fe28244a80 100644
@@ -1225,6 +1225,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;