[PATCH] accel/ivpu: Flush pending jobs of device's workqueues

Falkowski, Maciej maciej.falkowski at linux.intel.com
Tue Apr 8 13:44:22 UTC 2025


On 4/4/2025 5:00 PM, Jeff Hugo wrote:

> On 4/1/2025 9:57 AM, Maciej Falkowski wrote:
>> Use flush_work() instead of cancel_work_sync() for driver
>> workqueues to guarantee that remaining pending work
>> will be handled.
>>
>> Fixes: bc3e5f48b7ee ("accel/ivpu: Use workqueue for IRQ handling")
>> Signed-off-by: Maciej Falkowski <maciej.falkowski at linux.intel.com>
>
> The fixes tag suggests that this is a bug fix, but the commit text 
> doesn't really tell me why cancel_work_sync() is bad.  Does it leave 
> the driver in some incomplete state that prevents later recovery?
>
> Put another way, "why is it necessary for the pending work to be 
> handled?" appears unanswered.

You are right, thank you for pointing this out. FYI I will include the 
following explanation in the patch message:

This will resolve two issues that were encountered where a driver was 
left in an incomplete state as the bottom-half was canceled:
a) Cancelling context-abort of a job that is still executing and is 
causing translation faults which is going to cause additional TDRs,
b) Cancelling bottom-half of a DCT (duty-cycle throttling) request which 
will cause a device to not be adjusted to an external frequency request.

Best regards,
Maciej

>
> With that
> Reviewed-by: Jeff Hugo <jeff.hugo at oss.qualcomm.com>


More information about the dri-devel mailing list