Re: [PATCH] dmaengine: dw: synchronize completion callbacks

From: Andy Shevchenko

Date: Thu Oct 22 2026 - 12:58:36 EST


On Wed, Oct 21, 2026 at 03:14:14PM -0600, James Hilliard wrote:
> The controller tasklet can remove a descriptor from active_list and
> invoke its callback outside the channel lock. Terminating the channel
> does not wait for that callback, and there is no device_synchronize
> hook. A client can therefore reuse callback state or release its buffers
> after dmaengine_synchronize() while an old callback still uses them.
>
> Drain the controller tasklet from device_synchronize, outside the
> channel lock. This also waits for callbacks on the other channels
> because the tasklet is shared, without stopping their hardware
> transfers. Clients must continue to exclude new submissions on the
> channel being synchronized.

This doesn't change the driver behaviour and all on users to follow the correct
flow.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

--
With Best Regards,
Andy Shevchenko