From: Aaradhana Sahu <aaradhana.sahu@oss.qualcomm.com>
To: sashiko-reviews@lists.linux.dev
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH ath-next v2 12/17] wifi: ath12k: Enable MSI interrupt support for DP interrupt
Date: Wed, 21 Oct 2026 16:14:54 +0530 [thread overview]
Message-ID: <3fee0897-a878-459d-89c8-c9dd772c1976@oss.qualcomm.com> (raw)
In-Reply-To: <sashiko-outbox-173689@kernel.org>
On 10/16/2026 9:11 AM, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [High] wifi: ath12k: TOCTOU race drops edge-triggered MSI DP interrupts causing permanent stall
> --
>
> commit d922087bb1f873dbadddf00fcba276c1d612d2d7
> Author: Sowmiya Sree Elavalagan <quic_ssreeela@quicinc.com>
>
> wifi: ath12k: Enable MSI interrupt support for DP interrupt
>
> This commit configures and requests external MSI interrupts for DP ring groups.
> It creates a NAPI context for each active external interrupt group and disables
> the corresponding IRQs while NAPI polling is in progress.
>
>> diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/ath/ath12k/pci.c
>> index a26fdb3c0ad27..4bb14a95aec98 100644
>> --- a/drivers/net/wireless/ath/ath12k/pci.c
>> +++ b/drivers/net/wireless/ath/ath12k/pci.c
> [ ... ]
>> @@ -1118,7 +1122,7 @@ void ath12k_pci_ext_irq_enable(struct ath12k_base *ab)
>> for (i = 0; i < ATH12K_EXT_IRQ_GRP_NUM_MAX; i++) {
>> struct ath12k_ext_irq_grp *irq_grp = &ab->ext_irq_grp[i];
>>
>> - if (!irq_grp->napi_enabled) {
>> + if (irq_grp->napi_ndev && !irq_grp->napi_enabled) {
>> napi_enable(&irq_grp->napi);
>> irq_grp->napi_enabled = true;
>> }
>
> [Severity: High]
> Can unmasking the hardware IRQs race with setting the software flag?
>
> In ath12k_pci_ext_irq_enable(), ath12k_pci_ext_grp_enable() is called just
> after this block to unmask the hardware IRQs, but the software flag
> ATH12K_FLAG_EXT_IRQ_ENABLED is only set after the loop completes:
>
> ath12k_pci_ext_grp_enable(irq_grp);
> }
> set_bit(ATH12K_FLAG_EXT_IRQ_ENABLED, &ab->dev_flags);
>
> If an MSI interrupt fires immediately after unmasking,
> ath12k_pci_ext_interrupt_handler() drops it because the flag is still clear:
>
> if (!test_bit(ATH12K_FLAG_EXT_IRQ_ENABLED, &ab->dev_flags))
> return IRQ_HANDLED;
>
> Since MSI interrupts are edge-triggered, dropping the interrupt without
> scheduling NAPI leaves the hardware condition unacknowledged. No further MSI
> will be generated, which could permanently stall the DP ring.
>
> Since NAPI is already enabled for the group before unmasking the hardware IRQ,
> is it safe to drop this interrupt, or could the flag be set earlier?
>
The expectation is that ATH12K_FLAG_EXT_IRQ_ENABLED is set after the IRQ
configuration and enable sequence is completed. NAPI is already enabled before
the hardware IRQs are unmasked.
next prev parent reply other threads:[~2026-10-21 10:45 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 3:21 [PATCH ath-next v2 00/17] wifi: ath12k: Add support for QCN6432 Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 01/17] dt-bindings: net: wireless: Add QCN6432 device tree binding documentation Aaradhana Sahu
2026-10-17 17:00 ` Krzysztof Kozlowski
2026-10-21 5:27 ` Aaradhana Sahu
2026-10-17 17:01 ` Krzysztof Kozlowski
2026-10-21 5:27 ` Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 02/17] wifi: ath12k: Refactor PCI operations and MSI config structure Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 03/17] wifi: ath12k: Add hardware parameter for QCN6432 Aaradhana Sahu
2026-10-16 3:41 ` sashiko-bot
2026-10-21 6:40 ` Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 04/17] wifi: ath12k: Add hardware ring mask " Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 05/17] wifi: ath12k: add hardware registers " Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 06/17] wifi: ath12k: move multi MSI vector flag to ath12k_dev_flags Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 07/17] wifi: ath12k: Add hybrid_bus_type in ath12k_hw_params Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 08/17] wifi: ath12k: Add hif operation support for QCN6432 Aaradhana Sahu
2026-10-16 3:46 ` sashiko-bot
2026-10-21 10:09 ` Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 09/17] wifi: ath12k: add support for unified data-region memory allocation Aaradhana Sahu
2026-10-16 3:35 ` sashiko-bot
2026-10-21 10:15 ` Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 10/17] wifi: ath12k: move MSI config to pci.c Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 11/17] wifi: ath12k: Add platform MSI support for CE Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 12/17] wifi: ath12k: Enable MSI interrupt support for DP interrupt Aaradhana Sahu
2026-10-16 3:41 ` sashiko-bot
2026-10-21 10:44 ` Aaradhana Sahu [this message]
2026-10-16 3:21 ` [PATCH ath-next v2 13/17] wifi: ath12k: use CMEM write for PPT on hybrid bus devices Aaradhana Sahu
2026-10-16 3:41 ` sashiko-bot
2026-10-21 10:01 ` Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 14/17] wifi: ath12k: store and use MSI data per CE and DP interrupt group for QCN6432 Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 15/17] wifi: ath12k: Derive QMI service instance ID per protection domain Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 16/17] wifi: ath12k: Resolve userPD ID per device Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 17/17] wifi: ath12k: Add QCN6432 AHB support Aaradhana Sahu
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=3fee0897-a878-459d-89c8-c9dd772c1976@oss.qualcomm.com \
--to=aaradhana.sahu@oss.qualcomm.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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