From: sashiko-bot@kernel.org
To: "Pan Chuang" <panchuang@vivo.com>
Cc: vkoul@kernel.org, dmaengine@vger.kernel.org, Frank.Li@kernel.org
Subject: Re: [PATCH 10/26] dmaengine: qcom-gpi: Remove redundant dev_err()/dev_err_probe()
Date: Thu, 09 Jul 2026 14:19:44 +0000 [thread overview]
Message-ID: <20260709141944.804F41F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260709135846.97972-11-panchuang@vivo.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
Pre-existing issues:
- [High] The error cleanup paths in `gpi_ch_init()` use the wrong channel pointer when stopping and deallocating channels, leading to a leaked hardware state and redundant commands sent to the wrong channel.
- [High] The transfer ring memory (`gchan->ch_ring`) is permanently leaked if `gpi_ch_init()` fails during channel allocation in `gpi_alloc_chan_resources()`.
--
--- Patch [10]: [PATCH 10/26] dmaengine: qcom-gpi: Remove redundant dev_err()/dev_err_probe() ---
commit 2195d06ab56c88788ead88f1489a78636aee6d8b
Author: Pan Chuang <panchuang@vivo.com>
dmaengine: qcom-gpi: Remove redundant dev_err()/dev_err_probe()
This patch removes driver-specific error logging when devm_request_irq()
fails. The core already logs detailed error messages automatically, making
these manual prints redundant.
> diff --git a/drivers/dma/qcom/gpi.c b/drivers/dma/qcom/gpi.c
> index a5055a6273af6..af824682e64c8 100644
> --- a/drivers/dma/qcom/gpi.c
> +++ b/drivers/dma/qcom/gpi.c
[ ... ]
[Severity: High]
This is a pre-existing issue, but I noticed a potential problem in the error
cleanup path of gpi_ch_init() while reviewing this file:
drivers/dma/qcom/gpi.c:gpi_ch_init() {
...
error_start_chan:
for (i = i - 1; i >= 0; i--) {
gpi_stop_chan(&gpii->gchan[i]);
gpi_send_cmd(gpii, gchan, GPI_CH_CMD_RESET);
}
i = 2;
error_alloc_chan:
for (i = i - 1; i >= 0; i--)
gpi_reset_chan(gchan, GPI_CH_CMD_DE_ALLOC);
...
}
In both loops, the code calls gpi_send_cmd() and gpi_reset_chan() using the
fixed function argument gchan instead of the loop variable &gpii->gchan[i].
Does this leave the successfully initialized channels in an incorrect hardware
state and send duplicate reset and deallocate commands to the same channel?
[Severity: High]
This is also a pre-existing issue, but there appears to be a missing cleanup
step in the channel allocation path:
drivers/dma/qcom/gpi.c:gpi_alloc_chan_resources() {
...
/* allocate memory for transfer ring */
ret = gpi_alloc_ring(&gchan->ch_ring, CHAN_TRES,
sizeof(struct gpi_tre), gpii);
if (ret)
goto xfer_alloc_err;
ret = gpi_ch_init(gchan);
mutex_unlock(&gpii->ctrl_lock);
return ret;
...
}
If gpi_ch_init() returns an error, the function returns directly without calling
gpi_free_ring() to free the newly allocated gchan->ch_ring.
Since the dmaengine core aborts the allocation on failure and will not invoke
device_free_chan_resources(), does this permanently leak the DMA coherent
memory allocated for the transfer ring?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260709135846.97972-1-panchuang@vivo.com?part=10
next prev parent reply other threads:[~2026-07-09 14:19 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 13:58 [PATCH 00/26] dmaengine: Remove redundant error messages on IRQ request failure Pan Chuang
2026-07-09 13:58 ` Pan Chuang
2026-07-09 13:58 ` [PATCH 01/26] dmaengine: fsl-edma-main: Remove redundant dev_err()/dev_err_probe() Pan Chuang
2026-07-09 14:12 ` sashiko-bot
2026-07-09 14:33 ` Frank Li
2026-07-09 13:58 ` [PATCH 02/26] dmaengine: fsl-qdma: " Pan Chuang
2026-07-09 14:08 ` sashiko-bot
2026-07-09 14:34 ` Frank Li
2026-07-09 13:58 ` [PATCH 03/26] dmaengine: loongson-loongson1-apb-dma: " Pan Chuang
2026-07-09 14:11 ` sashiko-bot
2026-07-09 13:58 ` [PATCH 04/26] dmaengine: mediatek-mtk-cqdma: " Pan Chuang
2026-07-09 14:10 ` sashiko-bot
2026-07-09 13:58 ` [PATCH 05/26] dmaengine: mediatek-mtk-hsdma: " Pan Chuang
2026-07-09 14:10 ` sashiko-bot
2026-07-09 13:58 ` [PATCH 06/26] dmaengine: mmp_pdma: " Pan Chuang
2026-07-09 14:08 ` sashiko-bot
2026-07-09 13:58 ` [PATCH 07/26] dmaengine: moxart-dma: " Pan Chuang
2026-07-09 14:16 ` sashiko-bot
2026-07-09 13:58 ` [PATCH 08/26] dmaengine: owl-dma: " Pan Chuang
2026-07-09 14:16 ` sashiko-bot
2026-07-09 13:58 ` [PATCH 09/26] dmaengine: pxa_dma: " Pan Chuang
2026-07-09 14:20 ` sashiko-bot
2026-07-09 13:58 ` [PATCH 10/26] dmaengine: qcom-gpi: " Pan Chuang
2026-07-09 14:19 ` sashiko-bot [this message]
2026-07-09 13:58 ` [PATCH 11/26] dmaengine: sf-pdma-sf-pdma: " Pan Chuang
2026-07-09 13:58 ` Pan Chuang
2026-07-09 14:18 ` sashiko-bot
2026-07-09 13:58 ` [PATCH 12/26] dmaengine: sh-rcar-dmac: " Pan Chuang
2026-07-09 14:23 ` sashiko-bot
2026-07-09 14:31 ` Geert Uytterhoeven
2026-07-09 13:58 ` [PATCH 13/26] dmaengine: sh-rz-dmac: " Pan Chuang
2026-07-09 14:32 ` Geert Uytterhoeven
2026-07-09 13:58 ` [PATCH 14/26] dmaengine: sh-shdmac: " Pan Chuang
2026-07-09 14:24 ` sashiko-bot
2026-07-09 13:58 ` [PATCH 15/26] dmaengine: sh-usb-dmac: " Pan Chuang
2026-07-09 14:27 ` sashiko-bot
2026-07-09 14:33 ` Geert Uytterhoeven
2026-07-09 13:58 ` [PATCH 16/26] dmaengine: sprd-dma: " Pan Chuang
2026-07-09 14:27 ` sashiko-bot
2026-07-09 13:58 ` [PATCH 17/26] dmaengine: st_fdma: " Pan Chuang
2026-07-09 14:30 ` sashiko-bot
2026-07-09 13:58 ` [PATCH 18/26] dmaengine: stm32-stm32-dma: " Pan Chuang
2026-07-09 14:30 ` sashiko-bot
2026-07-09 13:58 ` [PATCH 19/26] dmaengine: stm32-stm32-dma3: " Pan Chuang
2026-07-09 14:33 ` sashiko-bot
2026-07-09 13:58 ` [PATCH 20/26] dmaengine: stm32-stm32-mdma: " Pan Chuang
2026-07-09 14:32 ` sashiko-bot
2026-07-09 13:58 ` [PATCH 21/26] dmaengine: sun4i-dma: " Pan Chuang
2026-07-09 14:35 ` sashiko-bot
2026-07-09 13:58 ` [PATCH 22/26] dmaengine: sun6i-dma: " Pan Chuang
2026-07-09 13:58 ` [PATCH 23/26] dmaengine: tegra20-apb-dma: " Pan Chuang
2026-07-09 13:58 ` [PATCH 24/26] dmaengine: ti-edma: " Pan Chuang
2026-07-09 14:38 ` sashiko-bot
2026-07-09 13:58 ` [PATCH 25/26] dmaengine: uniphier-xdmac: " Pan Chuang
2026-07-09 14:41 ` sashiko-bot
2026-07-09 13:58 ` [PATCH 26/26] dmaengine: xgene-dma: " Pan Chuang
2026-07-09 14:39 ` sashiko-bot
2026-07-09 14:26 ` [PATCH 00/26] dmaengine: Remove redundant error messages on IRQ request failure Wolfram Sang
2026-07-09 14:26 ` Wolfram Sang
2026-07-14 12:06 ` Vinod Koul
2026-07-14 12:06 ` Vinod Koul
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=20260709141944.804F41F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=panchuang@vivo.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.