From: Frank Li <Frank.li@oss.nxp.com>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: linux-renesas-soc@vger.kernel.org,
Koichiro Den <den@valinux.co.jp>, Vinod Koul <vkoul@kernel.org>,
Frank Li <Frank.Li@kernel.org>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Magnus Damm <magnus.damm@gmail.com>,
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
dmaengine@vger.kernel.org
Subject: Re: [PATCH v2 2/3] dmaengine: rcar-dmac: Add missing dma_descriptor_unmap()
Date: Mon, 12 Oct 2026 09:23:19 -0500 [thread overview]
Message-ID: <asztV3LhVU6OOdLn@SMW015318> (raw)
In-Reply-To: <20261012123020.11320-7-wsa+renesas@sang-engineering.com>
On Mon, Oct 12, 2026 at 02:30:22PM +0200, Wolfram Sang wrote:
> From: Koichiro Den <den@valinux.co.jp>
>
> Call dma_descriptor_unmap() right before dma_cookie_complete() in the
> threaded IRQ completion path. Without this, streaming DMA mappings
> attached to the descriptor are never released and may eventually exhaust
> DMA mapping resources (e.g. IOVA with an IOMMU or bounce-buffer slots
> with SWIOTLB), leading to dma_map_* failures.
>
> Also ensure dma_descriptor_unmap() is called in rcar_dmac_chan_reinit()
> (error/terminate path) to avoid the same type of leaks.
>
> Fixes: 87244fe5abdf ("dmaengine: rcar-dmac: Add Renesas R-Car Gen2 DMA Controller (DMAC) driver")
> Signed-off-by: Koichiro Den <den@valinux.co.jp>
> [wsa: moved unmap before cookie completion, added Fixes tag]
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
>
> Change since v1:
> * moved unmap before cookie_complete (Sashiko + humans)
> * adjusted commit message
>
> drivers/dma/sh/rcar-dmac.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
> index 5b54f1c4ce15..78a913c4c0d8 100644
> --- a/drivers/dma/sh/rcar-dmac.c
> +++ b/drivers/dma/sh/rcar-dmac.c
> @@ -844,6 +844,7 @@ static void rcar_dmac_chan_reinit(struct rcar_dmac_chan *chan)
>
> list_for_each_entry_safe(desc, _desc, &descs, node) {
> list_del(&desc->node);
> + dma_descriptor_unmap(&desc->async_tx);
> rcar_dmac_desc_put(chan, desc);
> }
> }
> @@ -1653,6 +1654,7 @@ static irqreturn_t rcar_dmac_isr_channel_thread(int irq, void *dev)
> while (!list_empty(&chan->desc.done)) {
> desc = list_first_entry(&chan->desc.done, struct rcar_dmac_desc,
> node);
> + dma_descriptor_unmap(&desc->async_tx);
> dma_cookie_complete(&desc->async_tx);
> list_del(&desc->node);
>
> --
> 2.53.0
>
next prev parent reply other threads:[~2026-10-12 14:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-12 12:30 [PATCH v2 0/3] dmaengine: rcar-dmac: collection of small missed fixes Wolfram Sang
2026-10-12 12:30 ` [PATCH v2 1/3] dmaengine: rcar-dmac: Fix PM usage counter imbalance Wolfram Sang
2026-10-12 12:30 ` [PATCH v2 2/3] dmaengine: rcar-dmac: Add missing dma_descriptor_unmap() Wolfram Sang
2026-10-12 14:23 ` Frank Li [this message]
2026-10-12 12:30 ` [PATCH v2 3/3] dmaengine: rcar-dmac: Remove redundant dev_err()/dev_err_probe() Wolfram Sang
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=asztV3LhVU6OOdLn@SMW015318 \
--to=frank.li@oss.nxp.com \
--cc=Frank.Li@kernel.org \
--cc=den@valinux.co.jp \
--cc=dmaengine@vger.kernel.org \
--cc=geert+renesas@glider.be \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=vkoul@kernel.org \
--cc=wsa+renesas@sang-engineering.com \
/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