Re: [PATCH v5] dmaengine: dw-axi-dmac: report paused state and residue in tx_status

From: Rui Wang

Date: Sun Sep 27 2026 - 23:52:12 EST


Hi Frank,

On Thu, Sep 24, 2026 at 01:38:34PM -0500, Frank Li wrote:
> Look like possible. Caller may reuse prevous DMA buffer. But I don't know
> how to resolve it.

How about pre-loading the pointer registers when programming the
channel? In v6, axi_chan_block_xfer_start() writes the first block's
SAR/DAR into CH_SAR/CH_DAR before setting the channel enable bit. The
hardware reloads them with the same values once it fetches the first
LLI, and in the window in between a reader observes the start of the
first block, i.e. a full residue, which is the truth for a transfer
that has not begun. A stale end-of-transfer pointer left by a previous
run can no longer be observed, so the buffer-reuse race is closed at
the source and tx_status stays free of special cases.

Best regards,
Rui Wang