Re: [PATCH] genirq/chip: Fix the warn for non-SMP system

From: Thomas Gleixner
Date: Thu May 23 2024 - 16:18:58 EST


On Fri, May 17 2024 at 01:00, Mukesh Ojha wrote:

We don't fix warnings. We fix the underlying problem.

> __irq_startup_managed() for !SMP system returns IRQ_STARTUP_NORMAL
> which may result in a WARNING during enablement of an irq i.e.,
> starting a irq while it is not activated.
>
> Fix this by appropriately returning IRQ_STARTUP_MANAGED.

What does that fix?

Absolutely nothing because both cases at the call site invoke
__irq_startup() which warns if the interrupt has not been activated yet.

It's not magically activated when __irq_startup_managed() returns
IRQ_STARTUP_MANAGED.

Also if you look at the SMP variant of that function then you might
notice that IRQ_STARTUP_MANAGED is not returned unconditionally. That
function can return IRQ_STARTUP_NORMAL too.

Just for the record. There are no managed interrupts on SMP=n. The code
which can initialize them is not even compiled in.

So I have no idea why you think that this has anything to do with
managed interrupts.

What's worse is that this does not even build on UP because
irq_do_set_affinity() does not exists for SMP=n. It builds today because
the IRQ_STARTUP_MANAGED case is optimized out by the compiler.

Sigh,

tglx