DMA Engine development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "James Hilliard" <james.hilliard1@gmail.com>
Cc: dmaengine@vger.kernel.org, vkoul@kernel.org, Frank.Li@kernel.org
Subject: Re: [PATCH v3 4/4] dmaengine: dw-axi-dmac: preserve pending pause requests
Date: Wed, 11 Nov 2026 03:39:32 +0000	[thread overview]
Message-ID: <sashiko-outbox-208213@kernel.org> (raw)
In-Reply-To: <20261110-submit-dw-axi-dma-stop-pause-v1-v3-4-35fdfba8b61d@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] dmaengine: dw-axi-dmac: stale chan->cyclic across alloc,
  error, and prep failure
--

commit 9842b102714b426daae54ae8ebc997ef84ba1d86
Author: James Hilliard <james.hilliard1@gmail.com>

dmaengine: dw-axi-dmac: preserve pending pause requests

This commit tracks pending channel suspend requests, active descriptors, and
deferred cyclic restarts so pause and resume operations do not lose
hardware suspend acknowledgments or race with transfer completion.

> 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 bb305ab94d02b..6f15fcb790a80 100644
> --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
> +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c

[ ... ]

> @@ -543,6 +548,10 @@ static int dma_chan_alloc_chan_resources(struct dma_chan *dchan)
>  		pm_runtime_put(chan->chip->dev);
>  		return -ENOMEM;
>  	}
> +	chan->desc = NULL;
> +	chan->pause_requested = false;
> +	chan->is_paused = false;
> +	chan->cyclic_restart = false;
>  	dev_vdbg(dmaengine_chan_dev(dchan), "%s: allocating\n", axi_chan_name(chan));
>  
>  	return 0;
> @@ -1087,6 +1096,8 @@ static noinline void axi_chan_handle_err(struct axi_dma_chan *chan, u32 status)
>  	vchan_cookie_complete(vd);
>  
>  	/* Try to restart the controller */
> +	chan->desc = NULL;
> +	chan->cyclic_restart = false;
>  	axi_chan_start_first_queued(chan);
>  
>  out:

[Severity: Medium]
Should dma_chan_alloc_chan_resources() and axi_chan_handle_err() also reset
chan->cyclic to false?

chan->cyclic is only cleared on a successful dma_chan_terminate_all(), and
neither dw_axi_dma_chan_prep_slave_sg() nor dma_chan_prep_dma_memcpy()
resets it.  If a prior dma_chan_terminate_all() timed out or was skipped
before channel release, or if a cyclic transfer fails in
axi_chan_handle_err(), chan->cyclic stays true.  Any subsequent non-cyclic
transfer then takes the cyclic branch in axi_chan_block_xfer_complete(),
which skips vchan_cookie_complete() and clearing chan->desc, leaving the
completed descriptor on vc.desc_issued, blocking further queued descriptors,
and re-enabling the hardware channel.

Similarly, dw_axi_dma_chan_prep_cyclic() sets chan->cyclic = true before the
dw_axi_dma_set_hw_desc() loop and leaves it set if the err_desc_get error
path is taken.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261110-submit-dw-axi-dma-stop-pause-v1-v3-0-35fdfba8b61d@gmail.com?part=4

  reply	other threads:[~2026-11-11  3:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11  3:15 [PATCH v3 0/4] dmaengine: dw-axi-dmac: fix termination and pause acknowledgment James Hilliard
2026-11-11  3:15 ` [PATCH v3 1/4] dmaengine: dw-axi-dmac: poll the correct enable bit during termination James Hilliard
2026-11-11  3:15 ` [PATCH v3 2/4] dmaengine: dw-axi-dmac: retain descriptors when termination times out James Hilliard
2026-11-11  3:15 ` [PATCH v3 3/4] dmaengine: dw-axi-dmac: use atomic polling for suspend acknowledgment James Hilliard
2026-11-11  3:15 ` [PATCH v3 4/4] dmaengine: dw-axi-dmac: preserve pending pause requests James Hilliard
2026-11-11  3:39   ` sashiko-bot [this message]
2026-11-11 14:36   ` Andy Shevchenko

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-208213@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=james.hilliard1@gmail.com \
    --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