Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Vishnu Santhosh" <vishnu.santhosh@oss.qualcomm.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH net-next v2 2/2] net: wwan: qcom_bam_dmux: Assign restricted DMA pool to remote processor
Date: Mon, 21 Sep 2026 03:03:15 +0000	[thread overview]
Message-ID: <20260921030315.BDF9B1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260920-qcom-bam-dmux-vmid-ext-v2-2-ef5ca2178378@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] wwan: qcom_bam_dmux: probe error path reclaims DMA pool before disabling IRQ
--

commit 4ad4e0793e663284df130f5d11d5a4f0bb1754cc
Author: Vishnu Santhosh <vishnu.santhosh@oss.qualcomm.com>

net: wwan: qcom_bam_dmux: Assign restricted DMA pool to remote processor

This commit introduces restricted DMA pool support to the BAM-DMUX WWAN
network driver for Qualcomm SoCs. It assigns the pool to local and remote
execution environments during probe and reclaims it on driver removal
or probe failure.

> diff --git a/drivers/net/wwan/qcom_bam_dmux.c b/drivers/net/wwan/qcom_bam_dmux.c
> index cc6ace8d64371..c81e668d4e961 100644
> --- a/drivers/net/wwan/qcom_bam_dmux.c
> +++ b/drivers/net/wwan/qcom_bam_dmux.c

[ ... ]

> @@ -845,6 +938,7 @@ static int bam_dmux_probe(struct platform_device *pdev)
>  err_disable_pm:
>  	pm_runtime_disable(dev);
>  	pm_runtime_dont_use_autosuspend(dev);
> +	bam_dmux_reclaim_dma_pool(dmux);
>  	return ret;
>  }

[Severity: High]
Could reclaiming the DMA pool here lead to an XPU violation and resource
leak if an interrupt fires concurrently?

If probe fails late (for example, if irq_get_irqchip_state() returns an
error), the code jumps to the err_disable_pm label. At this point, the
pc_irq has already been requested via devm_request_threaded_irq() and
is active. 

If the remote processor triggers this interrupt, the threaded handler
(bam_dmux_pc_irq) could be executing bam_dmux_power_on() while we are
calling bam_dmux_reclaim_dma_pool().

This concurrent execution would cause the DMA pool to be reclaimed
while the BAM DMA controller is actively using it, resulting in a system
crash. Furthermore, when devres eventually frees the IRQ, any DMA
channels or mappings allocated by the racing handler would leak because
bam_dmux_power_off() is not called in this error path.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260920-qcom-bam-dmux-vmid-ext-v2-0-ef5ca2178378@oss.qualcomm.com?part=2

  reply	other threads:[~2026-09-21  3:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-20  3:02 [PATCH net-next v2 0/2] net: wwan: qcom_bam_dmux: Add restricted DMA pool support Vishnu Santhosh
2026-09-20  3:02 ` [PATCH net-next v2 1/2] dt-bindings: net: qcom,bam-dmux: Add memory-region and qcom,vmid properties Vishnu Santhosh
2026-09-20 10:36   ` Krzysztof Kozlowski
2026-09-21  8:16     ` Loic Poulain
2026-10-01  5:58       ` Vishnu Santhosh
2026-09-21 11:04     ` Vishnu Santhosh
2026-09-21  3:48   ` netdev-bot+sashiko
2026-10-01 15:41     ` Vishnu Santhosh
2026-09-20  3:02 ` [PATCH net-next v2 2/2] net: wwan: qcom_bam_dmux: Assign restricted DMA pool to remote processor Vishnu Santhosh
2026-09-21  3:03   ` sashiko-bot [this message]
2026-10-01 14:48     ` Vishnu Santhosh
2026-10-01 14:49     ` Vishnu Santhosh
2026-09-21  3:48   ` netdev-bot+sashiko
2026-10-01 15:35     ` Vishnu Santhosh
2026-09-21  7:59   ` Loic Poulain
2026-09-21 11:13     ` Vishnu Santhosh
2026-09-28 10:32 ` [PATCH net-next v2 0/2] net: wwan: qcom_bam_dmux: Add restricted DMA pool support Vishnu Santhosh
2026-09-29  8:14   ` Stephan Gerhold
2026-09-29 14:58     ` Vishnu Santhosh

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=20260921030315.BDF9B1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vishnu.santhosh@oss.qualcomm.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