Skip to content

Commit 683e9fa

Browse files
m-falkowskijlawryno
authored andcommitted
accel/ivpu: Flush pending jobs of device's workqueues
Use flush_work() instead of cancel_work_sync() for driver IRQ workqueues to guarantee that remaining pending work will be handled. This resolves two issues that were encountered where a driver was left in an incorrect state as the bottom-half was canceled: 1. Cancelling context-abort of a job that is still executing and is causing translation faults which is going to cause additional TDRs 2. Cancelling bottom-half of a DCT (duty-cycle throttling) request which will cause a device to not be adjusted to an external frequency request. Fixes: bc3e5f4 ("accel/ivpu: Use workqueue for IRQ handling") Signed-off-by: Maciej Falkowski <maciej.falkowski@linux.intel.com> Reviewed-by: Lizhi Hou <lizhi.hou@amd.com> Reviewed-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com> Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Link: https://lore.kernel.org/r/20250401155755.4049156-1-maciej.falkowski@linux.intel.com
1 parent dcdae6e commit 683e9fa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/accel/ivpu/ivpu_drv.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,9 @@ void ivpu_prepare_for_reset(struct ivpu_device *vdev)
421421
{
422422
ivpu_hw_irq_disable(vdev);
423423
disable_irq(vdev->irq);
424-
cancel_work_sync(&vdev->irq_ipc_work);
425-
cancel_work_sync(&vdev->irq_dct_work);
426-
cancel_work_sync(&vdev->context_abort_work);
424+
flush_work(&vdev->irq_ipc_work);
425+
flush_work(&vdev->irq_dct_work);
426+
flush_work(&vdev->context_abort_work);
427427
ivpu_ipc_disable(vdev);
428428
ivpu_mmu_disable(vdev);
429429
}

0 commit comments

Comments
 (0)