From: sashiko-bot@kernel.org
To: "Bartosz Golaszewski" <bartosz.golaszewski@oss.qualcomm.com>
Cc: dmaengine@vger.kernel.org, vkoul@kernel.org, Frank.Li@kernel.org
Subject: Re: [PATCH v28] dmaengine: qcom: bam_dma: free interrupt before the clock in error path
Date: Thu, 08 Oct 2026 10:08:48 +0000 [thread overview]
Message-ID: <sashiko-outbox-163999@kernel.org> (raw)
In-Reply-To: <20261008-bam-dma-free-irq-v28-1-5e5b10de441e@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] dmaengine: qcom: bam_dma: IRQ storm and PM usage leak due to early request_irq
--
commit 6d143e987eb1a2023f5265042274ca78fbb524c0
Author: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
dmaengine: qcom: bam_dma: free interrupt before the clock in error path
The BAM interrupt is requested with a devres helper and freed after probe()
returns, but the clock is disabled before freeing it, which can lead to
reading BAM registers with the clock disabled. This patch stops using the
devres helper and manually frees the interrupt before disabling the clock
in the error path and in remove().
Closes: https://sashiko.dev/#/patchset/20260427-qcom-qce-cmd-descr-v16-0-945fd1cafbbc%40oss.qualcomm.com?part=2
> diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c
> index 94cb957d4b187..f67a93a37d48c 100644
> --- a/drivers/dma/qcom/bam_dma.c
> +++ b/drivers/dma/qcom/bam_dma.c
> @@ -1332,8 +1332,8 @@ static int bam_dma_probe(struct platform_device *pdev)
> for (i = 0; i < bdev->num_channels; i++)
> bam_channel_init(bdev, &bdev->channels[i], i);
>
> - ret = devm_request_irq(bdev->dev, bdev->irq, bam_dma_irq,
> - IRQF_TRIGGER_NONE, "bam_dma", bdev);
> + ret = request_irq(bdev->irq, bam_dma_irq, IRQF_TRIGGER_NONE,
> + "bam_dma", bdev);
[Severity: High]
Could this request_irq() lead to an IRQ storm if an interrupt fires
immediately?
Looking at bam_dma_probe(), request_irq() is called here, but runtime PM is
configured and enabled much later in the function:
drivers/dma/qcom/bam_dma.c:bam_dma_probe() {
...
pm_runtime_set_active(&pdev->dev);
pm_runtime_enable(&pdev->dev);
...
}
If the BAM hardware asserts an interrupt before PM is enabled,
bam_dma_irq() will execute and call pm_runtime_get_sync():
drivers/dma/qcom/bam_dma.c:bam_dma_irq() {
...
ret = pm_runtime_get_sync(bdev->dev);
if (ret < 0)
return IRQ_NONE;
...
}
Since PM is not active yet, pm_runtime_get_sync() will fail. The handler
returns IRQ_NONE without clearing the pending hardware interrupt, leaving
the level-triggered interrupt asserted and causing an IRQ storm.
Additionally, does this early return leak the PM runtime usage counter?
pm_runtime_get_sync() increments the usage counter even on failure, so
returning early without putting the counter would leak it on every
spurious execution.
> if (ret)
> goto err_bam_channel_exit;
>
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261008-bam-dma-free-irq-v28-1-5e5b10de441e@oss.qualcomm.com?part=1
next prev parent reply other threads:[~2026-10-08 10:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-08 9:54 [PATCH v28] dmaengine: qcom: bam_dma: free interrupt before the clock in error path Bartosz Golaszewski
2026-10-08 10:08 ` sashiko-bot [this message]
2026-10-08 12:43 ` 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=sashiko-outbox-163999@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=bartosz.golaszewski@oss.qualcomm.com \
--cc=dmaengine@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 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.