Re: [PATCH 1/2] genirq: Introduce a new flag IRQ_IS_CHAINED for chained interrupts

From: Thomas Gleixner
Date: Fri Oct 02 2015 - 16:17:37 EST


On Fri, 2 Oct 2015, Mika Westerberg wrote:

> In some cases it is useful to know if the interrupt in question has chained
> handler installed. For example when a cpu is offlined the architecture code
> needs to know if it has any users so that it can fixup affinity
> accordingly.
>
> To make this possible we introduce a new flag IRQ_IS_CHAINED that is set by
> the core code when chained interrupt handler is installed. We also make it
> possible for core and architecture code to check the flag by introducing
> function irq_has_chained_handler() for this.

While looking at that patch it occured to me, that we can solve this
in a different way, which does not require any changes to the
migration code.

When we install the chained handler, we set the action of that irq
descriptor to a statically allocated chained_action which provides a
handler which emits a fat warning. chained handlers should never end
up calling an action and if they do, it's clearly a bug.

The availability of an action makes the migration code just pick it
and move it along. And that fixes all architectures in one go without
touching them.

Sorry, that I didn't think about this right away.

Thanks,

tglx

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/