From: Frank Li <Frank.li@oss.nxp.com>
To: Roland Dreier <rolanddreier@rivian.com>
Cc: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>,
Vinod Koul <vkoul@kernel.org>, Frank Li <Frank.Li@kernel.org>,
dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] dmaengine: dw-axi-dmac: Decode errors in the transfer failure log
Date: Wed, 21 Oct 2026 12:49:04 -0400 [thread overview]
Message-ID: <atjtALwK3XWAlCkm@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20261006-dw-axi-fixes-v1-3-3b319e456d93@rivian.com>
On Tue, Oct 06, 2026 at 01:03:09AM +0000, Roland Dreier wrote:
> axi_chan_handle_err() reports every error with "Bad descriptor
> submitted" and dumps the transfer's LLIs. Common errors are source and
> destination decode or slave errors, from an undecoded address or a
> target returning an error response. These errors do not necessarily
> indicate a malformed descriptor, so the message is misleading. The
> dump also has one line per LLI without any indication where the
> transfer failed.
>
> Report the first matching error name while retaining the raw interrupt
> status so additional error bits remain visible. Include SAR, DAR and
> LLP to provide hardware progress and linked-list context without
> dumping every LLI. These registers are diagnostic snapshots, not
> necessarily the exact addresses of the failing transactions.
>
> Dump the LLIs only when a descriptor or programming error is present.
> Leave the transfer result and recovery path unchanged.
>
> Assisted-by: LLM
> Signed-off-by: Roland Dreier <rolanddreier@rivian.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 46 +++++++++++++++++++++++---
> 1 file changed, 42 insertions(+), 4 deletions(-)
>
> 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 88362f181207..e5a259e79a38 100644
> --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
> +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
> @@ -1059,6 +1059,36 @@ static void axi_chan_list_dump_lli(struct axi_dma_chan *chan,
> axi_chan_dump_lli(chan, &desc_head->hw_desc[i]);
> }
>
> +#define AXI_DMA_DATA_ERR (DWAXIDMAC_IRQ_SRC_DEC_ERR | \
> + DWAXIDMAC_IRQ_SRC_SLV_ERR | \
> + DWAXIDMAC_IRQ_DST_DEC_ERR | \
> + DWAXIDMAC_IRQ_DST_SLV_ERR)
> +
> +static const char *axi_chan_err_str(u32 status)
> +{
> + if (status & DWAXIDMAC_IRQ_SRC_DEC_ERR)
> + return "source decode error";
> + if (status & DWAXIDMAC_IRQ_SRC_SLV_ERR)
> + return "source slave error";
> + if (status & DWAXIDMAC_IRQ_DST_DEC_ERR)
> + return "destination decode error";
> + if (status & DWAXIDMAC_IRQ_DST_SLV_ERR)
> + return "destination slave error";
> + if (status & DWAXIDMAC_IRQ_LLI_RD_DEC_ERR)
> + return "LLI read decode error";
> + if (status & DWAXIDMAC_IRQ_LLI_RD_SLV_ERR)
> + return "LLI read slave error";
> + if (status & DWAXIDMAC_IRQ_LLI_WR_DEC_ERR)
> + return "LLI write-back decode error";
> + if (status & DWAXIDMAC_IRQ_LLI_WR_SLV_ERR)
> + return "LLI write-back slave error";
> + if (status & DWAXIDMAC_IRQ_INVALID_ERR)
> + return "invalid LLI or shadow register";
> + if (status & DWAXIDMAC_IRQ_MULTIBLKTYPE_ERR)
> + return "invalid multi-block transfer type";
> + return "slave interface error";
> +}
> +
> static noinline void axi_chan_handle_err(struct axi_dma_chan *chan, u32 status)
> {
> struct virt_dma_desc *vd;
> @@ -1078,11 +1108,19 @@ static noinline void axi_chan_handle_err(struct axi_dma_chan *chan, u32 status)
> /* Remove the completed descriptor from issued list */
> list_del(&vd->node);
>
> - /* WARN about bad descriptor */
> + /*
> + * SAR and DAR advance as each burst is issued, so with bursts still
> + * outstanding they can be a little past the one that failed.
> + */
> dev_err(chan2dev(chan),
> - "Bad descriptor submitted for %s, cookie: %d, irq: 0x%08x\n",
> - axi_chan_name(chan), vd->tx.cookie, status);
> - axi_chan_list_dump_lli(chan, vd_to_axi_desc(vd));
> + "%s for %s, cookie: %d, irq: 0x%08x, SAR: 0x%llx DAR: 0x%llx LLP: 0x%llx\n",
> + axi_chan_err_str(status), axi_chan_name(chan), vd->tx.cookie,
> + status, lo_hi_readq(chan->chan_regs + CH_SAR),
> + lo_hi_readq(chan->chan_regs + CH_DAR),
> + lo_hi_readq(chan->chan_regs + CH_LLP));
> + /* Only dump LLIs on non-data errors */
> + if (status & (DWAXIDMAC_IRQ_ALL_ERR & ~AXI_DMA_DATA_ERR))
> + 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;
>
> --
> 2.54.0
>
prev parent reply other threads:[~2026-10-21 16:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-06 1:03 [PATCH 0/3] dmaengine: dw-axi-dmac: Fix LLP search, error reporting, and error dump Roland Dreier via B4 Relay
2026-10-06 1:03 ` [PATCH 1/3] dmaengine: dw-axi-dmac: Bound the cyclic LLP search to the descriptor Roland Dreier via B4 Relay
2026-10-21 16:44 ` Frank Li
2026-10-06 1:03 ` [PATCH 2/3] dmaengine: dw-axi-dmac: Report failed transfers in the descriptor result Roland Dreier via B4 Relay
2026-10-21 16:45 ` Frank Li
2026-10-06 1:03 ` [PATCH 3/3] dmaengine: dw-axi-dmac: Decode errors in the transfer failure log Roland Dreier via B4 Relay
2026-10-21 16:49 ` Frank Li [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=atjtALwK3XWAlCkm@lizhi-Precision-Tower-5810 \
--to=frank.li@oss.nxp.com \
--cc=Eugeniy.Paltsev@synopsys.com \
--cc=Frank.Li@kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rolanddreier@rivian.com \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®