Re: [PATCH 1/2] linux/interrupt.h: allow "guard" notation to disable and reenable IRQ with valid IRQ check

From: Dmitry Torokhov

Date: Sun Jan 25 2026 - 00:30:24 EST


Hi Thomas,

On Fri, Jan 23, 2026 at 11:52:58AM +0100, Thomas Gleixner wrote:
> On Thu, Jan 22 2026 at 17:22, Sebastian Andrzej Siewior wrote:
>
> > On 2026-01-22 00:23:47 [+0100], Marek Vasut wrote:
> >> @@ -242,6 +242,21 @@ extern void irq_wake_thread(unsigned int irq, void *dev_id);
> >> DEFINE_LOCK_GUARD_1(disable_irq, int,
> >> disable_irq(*_T->lock), enable_irq(*_T->lock))
> >>
> >> +static inline void disable_valid_irq(unsigned int irq)
> >> +{
> >> + if (irq > 0)
> >> + disable_irq(irq);
> >> +}
> >
> > | $ grep " 0:" /proc/interrupts
> > | 0: 43 0 IO-APIC 2-edge timer
> >
> > in other words, interrupt 0 is valid.
>
> No. It's not really.
>
> Interrupt number zero is a historic leftover and a mistake which is only
> relevant to some oddball archaic architectures like x86 and others which
> tried to mimic that.
>
> The general agreement is that interrupt 0 is a legacy oddity and only
> supported in very special cases. Everything else treats 0 as invalid.

Could you ack this new guard if you agree with it please?

Thanks.

--
Dmitry