]> www.infradead.org Git - users/jedix/linux-maple.git/commit
genirq: Provide IRQCHIP_MOVE_DEFERRED
authorThomas Gleixner <tglx@linutronix.de>
Tue, 10 Dec 2024 10:34:14 +0000 (11:34 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 15 Jan 2025 09:56:22 +0000 (10:56 +0100)
commita648eb3a3f79e9736a59b28783700c2c691db419
treeecb09db8a16917bd448ad85a5b0cbb890478fada
parent65d09d269fc15b4d8bbeff950ecdc4dc36a6961a
genirq: Provide IRQCHIP_MOVE_DEFERRED

The logic of GENERIC_PENDING_IRQ is backwards for historical reasons. Most
interrupt controllers allow to move the interrupt from arbitrary
contexts. If GENERIC_PENDING_IRQ is enabled by an architecture to support a
chip, which requires the affinity change to happen in interrupt context,
all other chips have to be marked with IRQF_MOVE_PCNTXT.

That's tedious and there is no real good reason for the extra flags in the
irq descriptor and the irq data status fields. In fact the decision whether
interrupts can be moved in arbitrary context or not is a property of the
interrupt chip.

To simplify adoption for RISC-V provide a new mechanism which is enabled
via a config switch and allows to add a flag to irq_chip::flags to request
that interrupt affinity changes are deferred. Setting the top level chip of
an interrupt evaluates the flag and maps it into the existing logic.

The config switch and the various PCNTXT flags are temporary until x86 is
converted over to this scheme. This intermediate step also allows trivial
backporting of the mechanism to plug the affinity change race of various
RISC-V interrupt controllers.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20241210103335.500314436@linutronix.de
include/linux/irq.h
kernel/irq/Kconfig
kernel/irq/chip.c
kernel/irq/debugfs.c