Re: [PATCH v3 4/4] dmaengine: dw-axi-dmac: preserve pending pause requests
From: Andy Shevchenko
Date: Wed Nov 11 2026 - 09:37:04 EST
On Tue, Nov 10, 2026 at 08:15:15PM -0700, James Hilliard wrote:
> dma_chan_pause() clears SUSPENDED even when polling times out. Hardware
> can set that status after the last poll, and the unconditional clear then
> discards an acknowledgment the caller never observed. Another channel's
> interrupt can also consume the status because the shared IRQ handler
> clears every channel's status before taking its lock.
>
> Leave SUSPENDED to the pause and resume paths. Track the suspend request
> separately from its acknowledgment so a timeout can be followed by either
> a pause retry or a resume. Wait for acknowledgment before clearing the
> hardware request, since hardware ignores an earlier clear. If that wait
> also times out, return -EAGAIN with the request still pending.
>
> A completed transfer is also quiescent, but its completion handler may
> still need to advance a cyclic descriptor. Defer that restart while a
> pause is pending, and resume it without reprogramming the first LLI.
> Track the active descriptor until its completion handler runs so that
> resume and issue_pending cannot restart a completed cyclic segment or
> reissue a completed noncyclic descriptor while its IRQ is pending.
> Start queued work after the active descriptor is retired, respecting the
> pause request.
>
> Clear stale suspension status at the start of a new descriptor rather
> than at each cyclic restart. Reset the software state after successful
> termination and when allocating a channel for a new client.
>
> Store the lock-protected pause flags as bitfields in existing padding,
> keeping cyclic in a separate byte because it is set outside vc.lock.
...
> +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac.h
> @@ -42,6 +42,12 @@ struct axi_dma_chan {
> void __iomem *chan_regs;
> u8 id;
> u8 hw_handshake_num;
> + bool cyclic;
> - bool cyclic;
This move doesn't belong to this patch. Yes, I understand that `pahole`
suggested better layout, but make it in a separate patch.
--
With Best Regards,
Andy Shevchenko