Re: [PATCH 2/3] dmaengine: dw-axi-dmac: Report failed transfers in the descriptor result

From: Frank Li

Date: Wed Oct 21 2026 - 12:45:58 EST


On Tue, Oct 06, 2026 at 01:03:08AM +0000, Roland Dreier wrote:
> axi_chan_handle_err() completes a failed descriptor without updating
> vd->tx_result. So clients using tx_result always get DMA_TRANS_NOERROR,
> even for incomplete / failed transfers (bus error or other reason).
>
> Set the result so a client can detect failures:
> - DMA_TRANS_READ_FAILED for source decode or slave errors
> - DMA_TRANS_WRITE_FAILED for destination decode or slave errors
> - DMA_TRANS_ABORTED for everything else
>
> Assisted-by: LLM
> Signed-off-by: Roland Dreier <rolanddreier@xxxxxxxxxx>
> ---

Reviewed-by: Frank Li <Frank.Li@xxxxxxx>

> drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
> index 813d17a278e7..88362f181207 100644
> --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
> +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
> @@ -1084,6 +1084,13 @@ static noinline void axi_chan_handle_err(struct axi_dma_chan *chan, u32 status)
> axi_chan_name(chan), vd->tx.cookie, status);
> axi_chan_list_dump_lli(chan, vd_to_axi_desc(vd));
>
> + if (status & (DWAXIDMAC_IRQ_SRC_DEC_ERR | DWAXIDMAC_IRQ_SRC_SLV_ERR))
> + vd->tx_result.result = DMA_TRANS_READ_FAILED;
> + else if (status & (DWAXIDMAC_IRQ_DST_DEC_ERR | DWAXIDMAC_IRQ_DST_SLV_ERR))
> + vd->tx_result.result = DMA_TRANS_WRITE_FAILED;
> + else
> + vd->tx_result.result = DMA_TRANS_ABORTED;
> +
> vchan_cookie_complete(vd);
>
> /* Try to restart the controller */
>
> --
> 2.54.0
>