Re: [PATCH v2 1/3] dmaengine: dw-axi-dmac: poll the correct enable bit during termination

From: Andy Shevchenko

Date: Tue Nov 10 2026 - 02:39:40 EST


On Mon, Nov 09, 2026 at 08:06:00PM -0700, James Hilliard wrote:
> For channels 16 through 31, the channel enable bits occupy bits 32 through
> 47 of the extended DMAC_CHEN register. dma_chan_terminate_all() only reads
> the low word and tests BIT(chan->id), so it can conclude that an upper-bank
> channel has stopped while its actual enable bit remains set. Descriptors
> can then be freed while hardware still owns them.
>
> Poll axi_chan_is_hw_enable(), which already handles both register banks
> and the smaller channel layouts, instead of constructing another mask.

...

> - ret = readl_poll_timeout_atomic(chan->chip->regs + DMAC_CHEN, val,
> - !(val & chan_active), 1000, 50000);
> + ret = readx_poll_timeout_atomic(axi_chan_is_hw_enable, chan, enabled, !enabled,
> + 1 * USEC_PER_MSEC, 50 * USEC_PER_MSEC);

Indentation of the second line is broken, and the first one is too long, check
how I recommended to put in my reply to v1.

--
With Best Regards,
Andy Shevchenko