Skip to contentSkip to conversation

drm/amdkfd: Copy wave state only for compute queue

PATCH In review Philip Yang 2 participants 2 messages Oct 3, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdkfd: Copy wave state only for compute queue

get_wave_state is not defined for sdma queue, copy_context_work_handler calls it for sdma queue will crash.

---
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +4 -1
index 648f40091aa3..b2b16a812e73 100644
@@ -3173,7 +3173,7 @@ struct copy_context_work_handler_workarea {
 	struct kfd_process *p;
 };
 
-static void copy_context_work_handler (struct work_struct *work)
+static void copy_context_work_handler(struct work_struct *work)
 {
 	struct copy_context_work_handler_workarea *workarea;
 	struct mqd_manager *mqd_mgr;
@@ -3200,6 +3200,9 @@ static void copy_context_work_handler (struct work_struct *work)
 		struct qcm_process_device *qpd = &pdd->qpd;
 
 		list_for_each_entry(q, &qpd->queues_list, list) {
+			if (q->properties.type != KFD_QUEUE_TYPE_COMPUTE)
+				continue;
+
 			mqd_mgr = dqm->mqd_mgrs[KFD_MQD_TYPE_CP];
 
 			/* We ignore the return value from get_wave_state
Signature · 1 line
2.43.2
#1 lore raw

[Public]

Quoted 8 lines

-----Original Message-----
From: Yang, Philip <[email protected]>
Sent: Thursday, October 3, 2024 12:29 PM
To: [email protected]
Cc: Joshi, Mukul <[email protected]>; Kim, Jonathan <[email protected]>; Yang, Philip <[email protected]>
Subject: [PATCH] drm/amdkfd: Copy wave state only for compute queue

Quoted 4 lines

get_wave_state is not defined for sdma queue, copy_context_work_handler calls it for sdma queue will crash.

Reviewed-and-tested-by Jonathan Kim <[email protected]>
Quoted 31 lines
---
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +4 -1
index 648f40091aa3..b2b16a812e73 100644
@@ -3173,7 +3173,7 @@ struct copy_context_work_handler_workarea {
      struct kfd_process *p;
 };
 
-static void copy_context_work_handler (struct work_struct *work)
+static void copy_context_work_handler(struct work_struct *work)
 {
      struct copy_context_work_handler_workarea *workarea;
      struct mqd_manager *mqd_mgr;
@@ -3200,6 +3200,9 @@ static void copy_context_work_handler (struct
 work_struct *work)
              struct qcm_process_device *qpd = &pdd->qpd;
 
              list_for_each_entry(q, &qpd->queues_list, list) {
+                     if (q->properties.type != KFD_QUEUE_TYPE_COMPUTE)
+                             continue;
+
                      mqd_mgr = dqm->mqd_mgrs[KFD_MQD_TYPE_CP];
 
                      /* We ignore the return value from get_wave_state

--
2.43.2