[PATCH v2 1/2] wifi: ath12k: make external IRQ control idempotent
Baochen Qiang
baochen.qiang at oss.qualcomm.com
Fri Oct 9 03:15:41 PDT 2026
On 10/8/2026 5:38 AM, Nikolai Semendiaev wrote:
> The AHB external IRQ helpers change the hardware IRQ state even when
> NAPI is already in the requested state. PCI has a device-wide enabled
> bit guard, but also changes each group's IRQ state outside its NAPI
> state check.
>
> Tie each group's hardware IRQ transition to its NAPI state transition.
> Mask IRQs before disabling NAPI and enable NAPI before unmasking IRQs.
> This permits an extra IRQ disable before crash-recovery RXDMA teardown
> without increasing the IRQ disable depth.
>
first of all, did you see any issues with current code?
second, the idempotency predicate is bound to the per-group irq_grp->napi_enabled, which
answers "is NAPI poll enabled?", not "is the IRQ line enabled?", so semantically this is
not proper. PCI already has a semantically correct and atomic state bit for exactly this,
ATH12K_FLAG_EXT_IRQ_ENABLED, why not just use it? The current approach leaves two sources
of truth — per-group napi_enabled and device-level EXT_IRQ_ENABLED — that must stay
perfectly consistent, which is fragile. As for AHB, can we also use
ATH12K_FLAG_EXT_IRQ_ENABLED?
More information about the ath12k
mailing list