From: sashiko-bot@kernel.org
To: "Koichiro Den" <den@valinux.co.jp>
Cc: dmaengine@vger.kernel.org, linux-pci@vger.kernel.org,
vkoul@kernel.org, Frank.Li@kernel.org
Subject: Re: [PATCH v8 6/7] dmaengine: dw-edma: Dynamically append requests while running
Date: Sat, 07 Nov 2026 13:59:34 +0000 [thread overview]
Message-ID: <sashiko-outbox-202935@kernel.org> (raw)
In-Reply-To: <20261107133027.364237-7-den@valinux.co.jp>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] dmaengine: dw-edma: stranded or aborted queued descriptors on
LL reset
--
commit a60bb88e6010e30a59b85799859be8d9e37e8b49
Author: Frank Li <Frank.Li@nxp.com>
dmaengine: dw-edma: Dynamically append requests while running
This commit allows dw_edma_device_issue_pending() to append new linked-list
entries while a channel is running and aborts in-flight descriptors when
resetting the ring.
> diff --git a/drivers/dma/dw-edma/dw-edma-core.c b/drivers/dma/dw-edma/dw-edma-core.c
> index 1d13a25663eff..bcf4fca345914 100644
> --- a/drivers/dma/dw-edma/dw-edma-core.c
> +++ b/drivers/dma/dw-edma/dw-edma-core.c
> @@ -111,8 +111,22 @@ static void dw_edma_complete_vdesc(struct virt_dma_desc *vd,
>
> static void dw_edma_core_reset_ll(struct dw_edma_chan *chan)
> {
> + struct virt_dma_desc *vd, *tmp;
> u32 i;
>
> + /*
> + * We cannot tell which pending entries completed before the reset.
> + * Abort their descriptors to avoid repeating a transfer.
> + */
> + list_for_each_entry_safe(vd, tmp, &chan->vc.desc_issued, node) {
> + struct dw_edma_desc *desc = vd2dw_edma_desc(vd);
> +
> + if (desc->start_burst == desc->done_burst)
> + continue;
> +
> + dw_edma_complete_vdesc(vd, DMA_TRANS_ABORTED);
> + }
[Severity: Medium]
Does this leave unstarted descriptors in chan->vc.desc_issued stranded on an
idle channel after a hardware abort?
When issued descriptors exceed the free LL ring capacity, dw_edma_start_transfer()
stops once dw_edma_core_get_free_num(chan) reaches zero, leaving trailing
descriptors in chan->vc.desc_issued with start_burst == 0 and done_burst == 0.
When dw_edma_abort_interrupt() runs, dw_edma_core_reset_ll() skips those
unstarted descriptors, and dw_edma_abort_interrupt() then sets chan->status to
EDMA_ST_IDLE without starting them:
drivers/dma/dw-edma/dw-edma-core.c:dw_edma_abort_interrupt() {
...
if (!chan->non_ll)
dw_edma_core_reset_ll(chan);
dw_edma_set_request(chan, EDMA_REQ_NONE);
chan->status = EDMA_ST_IDLE;
spin_unlock_irqrestore(&chan->vc.lock, flags);
}
Because the client already called dma_async_issue_pending() for those
descriptors, they never execute or complete unless another transfer is issued
later.
Conversely, if both DW_EDMA_DEFERRED_DONE and DW_EDMA_DEFERRED_ABORT are
pending in dw_edma_irq_work(), dw_edma_ll_interrupt() runs first and calls
dw_edma_ll_advance() -> dw_edma_start_transfer(), which publishes those
waiting descriptors into the freed LL slots (setting start_burst > 0) right
before dw_edma_abort_interrupt() -> dw_edma_core_reset_ll() aborts them with
DMA_TRANS_ABORTED.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261107133027.364237-1-den@valinux.co.jp?part=6
next prev parent reply other threads:[~2026-11-07 13:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-07 13:30 [PATCH v8 0/7] dmaengine: dw-edma: Support dynamic LL appends Koichiro Den
2026-11-07 13:30 ` [PATCH v8 1/7] dmaengine: dw-edma: Add a channel transfer size operation Koichiro Den
2026-11-07 13:30 ` [PATCH v8 2/7] dmaengine: dw-edma: Avoid resetting an LL on stale stopped status Koichiro Den
2026-11-07 13:30 ` [PATCH v8 3/7] dmaengine: dw-edma: Factor out descriptor completion Koichiro Den
2026-11-07 13:30 ` [PATCH v8 4/7] dmaengine: dw-edma: Reclaim LL entries from hardware progress Koichiro Den
2026-11-07 13:30 ` [PATCH v8 5/7] dmaengine: dw-edma: Use HDMA watermark interrupts as LL progress Koichiro Den
2026-11-07 13:30 ` [PATCH v8 6/7] dmaengine: dw-edma: Dynamically append requests while running Koichiro Den
2026-11-07 13:59 ` sashiko-bot [this message]
2026-11-09 2:22 ` Koichiro Den
2026-11-07 13:30 ` [PATCH v8 7/7] dmaengine: dw-edma: Add trace support Koichiro Den
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=sashiko-outbox-202935@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=den@valinux.co.jp \
--cc=dmaengine@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--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