Re: [PATCH v3 1/5] genirq: Synchronize in-flight handlers during NMI teardown

From: Thomas Gleixner

Date: Fri Sep 04 2026 - 12:46:59 EST


On Fri, Sep 04 2026 at 14:40, Marc Zyngier wrote:
> On Fri, 04 Sep 2026 10:17:42 +0100,
> Thomas Gleixner <tglx@xxxxxxxxxx> wrote:
>> > + /*
>> > + * Ensure all in-flight NMI handlers on other CPUs complete before
>> > + * clearing desc->action or tearing down NMI state.
>> > + */
>> > + __synchronize_hardirq(desc, true);
>>
>> NMIs are strictly per CPU interrupts. So how is this supposed to work
>> correctly when looking at irqchip_state(ACTIVE) ?
>>
>> Marc?
>
> I have no idea what this is trying to achieve.
>
> This can only work for a global interrupt, not for a CPU-private
> interrupt, since in general you can't observe the state of the
> interrupt on another CPU.
>
> My guess is that the OP is trying to trigger an NMI using a global
> interrupt, which we never intended to be supported. That's not to say
> that it cannot be supported, but this patch seems to be breaking the
> core use case...

As I suspected.

The driver change is here:

[1] https://lore.kernel.org/all/20260902-qcom-wdt-nmi-series-v3-5-f3999362a9ea@xxxxxxxxxx/

> @@ -311,10 +321,25 @@ static int qcom_wdt_probe(struct platform_device *pdev)
> if (irq < 0 && irq != -ENXIO)
> return irq;
> if (irq > 0) {
> - ret = devm_request_irq(dev, irq, qcom_wdt_isr, 0,
> - "wdt_bark", &wdt->wdd);
> - if (ret)
> - return ret;
> + wdt->irq = irq;
> + irq_flags = IRQF_PERCPU | IRQF_NOBALANCING |
> + IRQF_NO_AUTOEN | IRQF_NO_THREAD;
> +
> + ret = request_nmi(irq, qcom_wdt_isr, irq_flags,
> + "wdt_bark", &wdt->wdd);

Of course this is a regular global interrupt otherwise it couldn't be
requested normally. So this sets IRQF_PERCPU (it has to otherwise
request_nmi() would fail), but that looks like a hack to me.