Skip to contentSkip to conversation

genirq: Allow NULL affinity for setup_percpu_irq()

PATCH Applied Marc Zyngier 2 participants 2 messages Dec 5, 2025 – Dec 10, 2025 IRQ

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 genirq: Allow NULL affinity for setup_percpu_irq()

setup_percpu_irq() was forgotten when the percpu_devid infrastructure was updated to deal with CPU affinities.

In order to keep ignoring users of this legacy API, provide sensible defaults by setting the affinity to cpu_online_mask if none was provided by the caller.

Fixes bdf4e2ac295fe ("genirq: Allow per-cpu interrupt sharing for non-overlapping affinities")
---
 kernel/irq/manage.c | 3 +++
 1 file changed, 3 insertions(+)
kernel/irq/manage.c +3 -0
index 0bb29316b4362..8b1b4c8a4f54c 100644
@@ -2470,6 +2470,9 @@ int setup_percpu_irq(unsigned int irq, struct irqaction *act)
 	if (retval < 0)
 		return retval;
 
+	if (!act->affinity)
+		act->affinity = cpu_online_mask;
+
 	retval = __setup_irq(irq, desc, act);
 
 	if (retval)
Signature · 1 line
2.47.3
merge bot Applied
#1 lore raw
The following commit has been merged into the irq/urgent branch of tip:

The following commit has been merged into the irq/urgent branch of tip:

Commit-ID:     89acaa5537a29c742d7a6ed7241fc4cf5e2ef818
Gitweb:        https://git.kernel.org/tip/89acaa5537a29c742d7a6ed7241fc4cf5e2ef818
Author:        Marc Zyngier <[email protected]>
AuthorDate:    Fri, 05 Dec 2025 09:18:14 
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Wed, 10 Dec 2025 09:47:33 +09:00

genirq: Allow NULL affinity for setup_percpu_irq()

setup_percpu_irq() was forgotten when the percpu_devid infrastructure was updated to deal with CPU affinities.

In order to keep ignoring users of this legacy API, provide sensible defaults by setting the affinity to cpu_online_mask if none was provided by the caller.

Fixes bdf4e2ac295fe ("genirq: Allow per-cpu interrupt sharing for non-overlapping affinities")
---
 kernel/irq/manage.c | 3 +++
 1 file changed, 3 insertions(+)
kernel/irq/manage.c +3 -0
index 0bb2931..8b1b4c8 100644
@@ -2470,6 +2470,9 @@ int setup_percpu_irq(unsigned int irq, struct irqaction *act)
 	if (retval < 0)
 		return retval;
 
+	if (!act->affinity)
+		act->affinity = cpu_online_mask;
+
 	retval = __setup_irq(irq, desc, act);
 
 	if (retval)