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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Xiaogang Chen <xiaogang.chen@xxxxxxx>

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.

Signed-off-by: Xiaogang Chen<Xiaogang.Chen@xxxxxxx>
---
 drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c b/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c
index 9b6b6e882593..1847b9290a84 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c
@@ -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);
 
-- 
2.25.1




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux