Skip to contentSkip to conversation

amd/kfd: cancle work iterms at ih_wq in kfd_interrupt_exit

PATCH New Xiaogang.Chen 1 participant 1 message Apr 11, 2024

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

PATCH 1/1 amd/kfd: cancle work iterms at ih_wq in kfd_interrupt_exit

From: Xiaogang Chen <[email protected]>

When kfd/amdgpu driver is tearing down cannot handle callback from ih_wq. If there is still work items left cancle them instead of flush that would wait until they got served.

---
 drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c +4 -3
index 9b6b6e882593..1847b9290a84 100644
@@ -98,11 +98,12 @@ void kfd_interrupt_exit(struct kfd_node *node)
 	spin_unlock_irqrestore(&node->interrupt_lock, flags);
 
 	/*
-	 * flush_work ensures that there are no outstanding
-	 * work-queue items that will access interrupt_ring. New work items
+	 * cancel work items still at ih_wq ensures that there are no outstanding
+	 * work-queue items that will access interrupt_ring. At this stage kfd/amd
+	 * driver is tearing down, cannot handle call back from wq. New work itemst
 	 * can't be created because we stopped interrupt handling above.
 	 */
-	flush_workqueue(node->ih_wq);
+	cancel_work(&node->interrupt_work);
 
 	destroy_workqueue(node->ih_wq);
 
Signature · 1 line
2.25.1