Skip to contentSkip to conversation

genirq: Post 6.19-rc1 API cleanup

PATCH Applied Marc Zyngier 3 participants 18 messages Dec 10, 2025 – Jan 29

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover genirq: Post 6.19-rc1 API cleanup

Fixing the issue reported at [1] pushed me to look into some of the ugly corners of the percpu IRQ configuration, and to notice that:

- we only have 3 users left of setup_percpu_irq(), all MIPS timers

- none of the timer drivers using request_percpu_irq() are passing the IRQF_TIMER flag (this function doesn't take a flag argument)

- the IRQ_TIMINGS subsystem therefore cannot identify that it should consider these interrupts as timer interrupts, and would mistakenly take them into account

- but as it turns out, nobody can enable IRQ_TIMINGS the first place

- so passing flags at percpu IRQ request time is not required

The cumulative effects of the above is that we can:

- drop the IRQ_TIMINGS stuff -- it was never used, and Daniel indicates[2] that there is no immediate path to finishing it

- replace __request_percpu_irq() with request_percpu_irq_affinity()

- convert all three MIPS timers to request_percpu_irq()

- finally kill setup_percpu_irq() for good

Note that when it comes to MIPS, I have only tested the GIC timer change, as I don't have any SGI HW anymore. And even that was on QEMU. I'd appreciate someone with the necessary zoo to give it a go on actual metal.

Patches on top of [3].

[1] https://lore.kernel.org/r/[email protected]
[2] https://lore.kernel.org/r/[email protected]
[3] https://patch.msgid.link/[email protected]

Marc Zyngier (6):
genirq: Remove IRQ timing tracking infrastructure
genirq: Remove __request_percpu_irq() helper
mips: Move IP30 timer to request_percpu_irq()
mips: Move IP27 timer to request_percpu_irq()
clocksource: mips-gic-timer: Move GIC timer to request_percpu_irq()
genirq: Kill setup_percpu_irq()

 arch/mips/include/asm/cevt-r4k.h     |   1 -
 arch/mips/kernel/cevt-r4k.c          |  11 -
 arch/mips/sgi-ip27/ip27-timer.c      |  10 +-
 arch/mips/sgi-ip30/ip30-timer.c      |   5 +-
 drivers/clocksource/mips-gic-timer.c |  10 +-
 include/linux/interrupt.h            |  24 +-
 include/linux/irq.h                  |   3 -
 kernel/irq/Kconfig                   |   3 -
 kernel/irq/Makefile                  |   4 -
 kernel/irq/handle.c                  |   2 -
 kernel/irq/internals.h               | 110 ---
 kernel/irq/manage.c                  |  49 +-
 kernel/irq/timings.c                 | 959 ---------------------------
 lib/Kconfig.debug                    |   8 -
 14 files changed, 16 insertions(+), 1183 deletions(-)
 delete mode 100644 kernel/irq/timings.c
Signature · 1 line
2.47.3
#1 lore raw

PATCH 1/6 genirq: Remove IRQ timing tracking infrastructure

The IRQ timing tracking infrastructure was merged in 2019, but was never plumbed in, is not selectable, and is therefore never used.

As Daniel agrees that there is little hope for this infrastructure to be completed in the near term, drop it altogether.

---
 include/linux/interrupt.h |   6 -
 kernel/irq/Kconfig        |   3 -
 kernel/irq/Makefile       |   4 -
 kernel/irq/handle.c       |   2 -
 kernel/irq/internals.h    | 110 -----
 kernel/irq/manage.c       |   3 -
 kernel/irq/timings.c      | 959 --------------------------------------
 lib/Kconfig.debug         |   8 -
 8 files changed, 1095 deletions(-)
 delete mode 100644 kernel/irq/timings.c
include/linux/interrupt.h +0 -6
index 266f2b39213a0..44e335b17ed64 100644
@@ -871,12 +871,6 @@ static inline void init_irq_proc(void)
 }
 #endif
 
-#ifdef CONFIG_IRQ_TIMINGS
-void irq_timings_enable(void);
-void irq_timings_disable(void);
-u64 irq_timings_next_event(u64 now);
-#endif
-
 struct seq_file;
 int show_interrupts(struct seq_file *p, void *v);
 int arch_show_interrupts(struct seq_file *p, int prec);
kernel/irq/Kconfig +0 -3
index 1b4254d19a73e..05cba4e16dad1 100644
@@ -92,9 +92,6 @@ config GENERIC_MSI_IRQ
 config IRQ_MSI_IOMMU
 	bool
 
-config IRQ_TIMINGS
-	bool
-
 config GENERIC_IRQ_MATRIX_ALLOCATOR
 	bool
 
kernel/irq/Makefile +0 -4
index 6ab3a40556670..86a2e5ae08f9a 100644
@@ -1,10 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 
 obj-y := irqdesc.o handle.o manage.o spurious.o resend.o chip.o dummychip.o devres.o kexec.o
-obj-$(CONFIG_IRQ_TIMINGS) += timings.o
-ifeq ($(CONFIG_TEST_IRQ_TIMINGS),y)
-	CFLAGS_timings.o += -DDEBUG
-endif
 obj-$(CONFIG_GENERIC_IRQ_CHIP) += generic-chip.o
 obj-$(CONFIG_GENERIC_IRQ_PROBE) += autoprobe.o
 obj-$(CONFIG_IRQ_DOMAIN) += irqdomain.o
kernel/irq/handle.c +0 -2
index 786f5570a6407..b7d52821837bc 100644
@@ -188,8 +188,6 @@ irqreturn_t __handle_irq_event_percpu(struct irq_desc *desc)
 	unsigned int irq = desc->irq_data.irq;
 	struct irqaction *action;
 
-	record_irq_time(desc);
-
 	for_each_action_of_desc(desc, action) {
 		irqreturn_t res;
 
kernel/irq/internals.h +0 -110

116 lines not on this page · raw message

kernel/irq/manage.c +0 -3
index 8b1b4c8a4f54c..7b25ffc5c43a4 100644
@@ -1778,8 +1778,6 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
 	chip_bus_sync_unlock(desc);
 	mutex_unlock(&desc->request_mutex);
 
-	irq_setup_timings(desc, new);
-
 	wake_up_and_wait_for_irq_thread_ready(desc, new);
 	wake_up_and_wait_for_irq_thread_ready(desc, new->secondary);
 
@@ -1950,7 +1948,6 @@ static struct irqaction *__free_irq(struct irq_desc *desc, void *dev_id)
 
 		irq_release_resources(desc);
 		chip_bus_sync_unlock(desc);
-		irq_remove_timings(desc);
 	}
 
 	mutex_unlock(&desc->request_mutex);
kernel/irq/timings.c deleted +0 -959

959 lines not on this page · raw message

lib/Kconfig.debug +0 -8
index 742b23ef0d8bf..cc71ebdcefa67 100644
@@ -2558,14 +2558,6 @@ config TEST_PARMAN
 
 	  If unsure, say N.
 
-config TEST_IRQ_TIMINGS
-	bool "IRQ timings selftest"
-	depends on IRQ_TIMINGS
-	help
-	  Enable this option to test the irq timings code on boot.
-
-	  If unsure, say N.
-
 config TEST_LKM
 	tristate "Test module loading with 'hello world' module"
 	depends on m
Signature · 1 line
2.47.3
Reviewed-by on v1 1/6
#2 lore raw

Re: [PATCH 1/6] genirq: Remove IRQ timing tracking infrastructure

Quoted 8 lines · Marc Zyngier

The IRQ timing tracking infrastructure was merged in 2019, but was never plumbed in, is not selectable, and is therefore never used.

As Daniel agrees that there is little hope for this infrastructure to be completed in the near term, drop it altogether.

Quoted 11 lines
---
 include/linux/interrupt.h |   6 -
 kernel/irq/Kconfig        |   3 -
 kernel/irq/Makefile       |   4 -
 kernel/irq/handle.c       |   2 -
 kernel/irq/internals.h    | 110 -----
 kernel/irq/manage.c       |   3 -
 kernel/irq/timings.c      | 959 --------------------------------------
 lib/Kconfig.debug         |   8 -
 8 files changed, 1095 deletions(-)
 delete mode 100644 kernel/irq/timings.c
Quoted 15 lines
include/linux/interrupt.h +0 -6
index 266f2b39213a0..44e335b17ed64 100644
@@ -871,12 +871,6 @@ static inline void init_irq_proc(void)
 }
 #endif
 
-#ifdef CONFIG_IRQ_TIMINGS
-void irq_timings_enable(void);
-void irq_timings_disable(void);
-u64 irq_timings_next_event(u64 now);
-#endif
-

[...]

Quoted 4 lines
include/linux/interrupt.h +0 -1
-
 config TEST_LKM
 	tristate "Test module loading with 'hello world' module"
 	depends on m
merge bot Applied
#3 lore raw

[tip: irq/core] genirq: Remove IRQ timing tracking infrastructure

In reply to Marc Zyngier
The following commit has been merged into the irq/core branch of tip:

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

Commit-ID:     c119e6685311cef0e4a4e0b7752293bea056bac7
Gitweb:        https://git.kernel.org/tip/c119e6685311cef0e4a4e0b7752293bea056bac7
Author:        Marc Zyngier <[email protected]>
AuthorDate:    Wed, 10 Dec 2025 08:22:37 
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Mon, 15 Dec 2025 22:20:50 +01:00

genirq: Remove IRQ timing tracking infrastructure

The IRQ timing tracking infrastructure was merged in 2019, but was never plumbed in, is not selectable, and is therefore never used.

As Daniel agrees that there is little hope for this infrastructure to be completed in the near term, drop it altogether.

---
 include/linux/interrupt.h |   6 +-
 kernel/irq/Kconfig        |   3 +-
 kernel/irq/Makefile       |   4 +-
 kernel/irq/handle.c       |   2 +-
 kernel/irq/internals.h    | 110 +----
 kernel/irq/manage.c       |   3 +-
 kernel/irq/timings.c      | 959 +-------------------------------------
 lib/Kconfig.debug         |   8 +-
 8 files changed, 1095 deletions(-)
 delete mode 100644 kernel/irq/timings.c
include/linux/interrupt.h +0 -6
index 266f2b3..44e335b 100644
@@ -871,12 +871,6 @@ static inline void init_irq_proc(void)
 }
 #endif
 
-#ifdef CONFIG_IRQ_TIMINGS
-void irq_timings_enable(void);
-void irq_timings_disable(void);
-u64 irq_timings_next_event(u64 now);
-#endif
-
 struct seq_file;
 int show_interrupts(struct seq_file *p, void *v);
 int arch_show_interrupts(struct seq_file *p, int prec);
kernel/irq/Kconfig +0 -3
index 1b4254d..05cba4e 100644
@@ -92,9 +92,6 @@ config GENERIC_MSI_IRQ
 config IRQ_MSI_IOMMU
 	bool
 
-config IRQ_TIMINGS
-	bool
-
 config GENERIC_IRQ_MATRIX_ALLOCATOR
 	bool
 
kernel/irq/Makefile +0 -4
index 6ab3a40..86a2e5a 100644
@@ -1,10 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 
 obj-y := irqdesc.o handle.o manage.o spurious.o resend.o chip.o dummychip.o devres.o kexec.o
-obj-$(CONFIG_IRQ_TIMINGS) += timings.o
-ifeq ($(CONFIG_TEST_IRQ_TIMINGS),y)
-	CFLAGS_timings.o += -DDEBUG
-endif
 obj-$(CONFIG_GENERIC_IRQ_CHIP) += generic-chip.o
 obj-$(CONFIG_GENERIC_IRQ_PROBE) += autoprobe.o
 obj-$(CONFIG_IRQ_DOMAIN) += irqdomain.o
kernel/irq/handle.c +0 -2
index 786f557..b7d5282 100644
@@ -188,8 +188,6 @@ irqreturn_t __handle_irq_event_percpu(struct irq_desc *desc)
 	unsigned int irq = desc->irq_data.irq;
 	struct irqaction *action;
 
-	record_irq_time(desc);
-
 	for_each_action_of_desc(desc, action) {
 		irqreturn_t res;
 
kernel/irq/internals.h +0 -110

116 lines not on this page · raw message

kernel/irq/manage.c +0 -3
index 8b1b4c8..7b25ffc 100644
@@ -1778,8 +1778,6 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
 	chip_bus_sync_unlock(desc);
 	mutex_unlock(&desc->request_mutex);
 
-	irq_setup_timings(desc, new);
-
 	wake_up_and_wait_for_irq_thread_ready(desc, new);
 	wake_up_and_wait_for_irq_thread_ready(desc, new->secondary);
 
@@ -1950,7 +1948,6 @@ static struct irqaction *__free_irq(struct irq_desc *desc, void *dev_id)
 
 		irq_release_resources(desc);
 		chip_bus_sync_unlock(desc);
-		irq_remove_timings(desc);
 	}
 
 	mutex_unlock(&desc->request_mutex);
kernel/irq/timings.c deleted +0 -959

959 lines not on this page · raw message

lib/Kconfig.debug +0 -8
index ba36939..7885475 100644
@@ -2551,14 +2551,6 @@ config TEST_PARMAN
 
 	  If unsure, say N.
 
-config TEST_IRQ_TIMINGS
-	bool "IRQ timings selftest"
-	depends on IRQ_TIMINGS
-	help
-	  Enable this option to test the irq timings code on boot.
-
-	  If unsure, say N.
-
 config TEST_LKM
 	tristate "Test module loading with 'hello world' module"
 	depends on m
#4 lore raw

PATCH 2/6 genirq: Remove __request_percpu_irq() helper

In reply to Marc Zyngier

With the IRQ timing stuff being gone, there is no need to specify a flag when requesting a percpu interrupt. Not only IRQF_TIMER was the only flag (set of flags actually) allowed, but nobody ever passed it.

Get rid of __request_percpu_irq(), which was only getting 0 as flags, and promote request_percpu_irq_affinity() as its replacement.

---
 include/linux/interrupt.h | 18 ++++--------------
 kernel/irq/manage.c       | 16 ++++++----------
 2 files changed, 10 insertions(+), 24 deletions(-)
include/linux/interrupt.h +4 -14
index 44e335b17ed64..00c01b0a43be1 100644
@@ -181,9 +181,8 @@ request_any_context_irq(unsigned int irq, irq_handler_t handler,
 			unsigned long flags, const char *name, void *dev_id);
 
 extern int __must_check
-__request_percpu_irq(unsigned int irq, irq_handler_t handler,
-		     unsigned long flags, const char *devname,
-		     const cpumask_t *affinity, void __percpu *percpu_dev_id);
+request_percpu_irq_affinity(unsigned int irq, irq_handler_t handler, const char *devname,
+			    const cpumask_t *affinity, void __percpu *percpu_dev_id);
 
 extern int __must_check
 request_nmi(unsigned int irq, irq_handler_t handler, unsigned long flags,
@@ -193,17 +192,8 @@ static inline int __must_check
 request_percpu_irq(unsigned int irq, irq_handler_t handler,
 		   const char *devname, void __percpu *percpu_dev_id)
 {
-	return __request_percpu_irq(irq, handler, 0,
-				    devname, NULL, percpu_dev_id);
-}
-
-static inline int __must_check
-request_percpu_irq_affinity(unsigned int irq, irq_handler_t handler,
-			    const char *devname, const cpumask_t *affinity,
-			    void __percpu *percpu_dev_id)
-{
-	return __request_percpu_irq(irq, handler, 0,
-				    devname, affinity, percpu_dev_id);
+	return request_percpu_irq_affinity(irq, handler, devname,
+					   NULL, percpu_dev_id);
 }
 
 extern int __must_check
kernel/irq/manage.c +6 -10
index 7b25ffc5c43a4..1c858be09ba13 100644
@@ -2510,10 +2510,9 @@ struct irqaction *create_percpu_irqaction(irq_handler_t handler, unsigned long f
 }
 
 /**
- * __request_percpu_irq - allocate a percpu interrupt line
+ * request_percpu_irq_affinity - allocate a percpu interrupt line
  * @irq:	Interrupt line to allocate
  * @handler:	Function to be called when the IRQ occurs.
- * @flags:	Interrupt type flags (IRQF_TIMER only)
  * @devname:	An ascii name for the claiming device
  * @affinity:	A cpumask describing the target CPUs for this interrupt
  * @dev_id:	A percpu cookie passed back to the handler function
@@ -2526,9 +2525,9 @@ struct irqaction *create_percpu_irqaction(irq_handler_t handler, unsigned long f
  * the handler gets called with the interrupted CPU's instance of
  * that variable.
  */
-int __request_percpu_irq(unsigned int irq, irq_handler_t handler,
-			 unsigned long flags, const char *devname,
-			 const cpumask_t *affinity, void __percpu *dev_id)
+int request_percpu_irq_affinity(unsigned int irq, irq_handler_t handler,
+				const char *devname, const cpumask_t *affinity,
+				void __percpu *dev_id)
 {
 	struct irqaction *action;
 	struct irq_desc *desc;
@@ -2542,10 +2541,7 @@ int __request_percpu_irq(unsigned int irq, irq_handler_t handler,
 	    !irq_settings_is_per_cpu_devid(desc))
 		return -EINVAL;
 
-	if (flags && flags != IRQF_TIMER)
-		return -EINVAL;
-
-	action = create_percpu_irqaction(handler, flags, devname, affinity, dev_id);
+	action = create_percpu_irqaction(handler, 0, devname, affinity, dev_id);
 	if (!action)
 		return -ENOMEM;
 
@@ -2564,7 +2560,7 @@ int __request_percpu_irq(unsigned int irq, irq_handler_t handler,
 
 	return retval;
 }
-EXPORT_SYMBOL_GPL(__request_percpu_irq);
+EXPORT_SYMBOL(request_percpu_irq_affinity);
 
 /**
  * request_percpu_nmi - allocate a percpu interrupt line for NMI delivery
Signature · 1 line
2.47.3
Reviewed-by on v1 2/6
#5 lore raw

Re: [PATCH 2/6] genirq: Remove __request_percpu_irq() helper

Quoted 80 lines · Marc Zyngier

With the IRQ timing stuff being gone, there is no need to specify a flag when requesting a percpu interrupt. Not only IRQF_TIMER was the only flag (set of flags actually) allowed, but nobody ever passed it.

Get rid of __request_percpu_irq(), which was only getting 0 as flags, and promote request_percpu_irq_affinity() as its replacement.

---
 include/linux/interrupt.h | 18 ++++--------------
 kernel/irq/manage.c       | 16 ++++++----------
 2 files changed, 10 insertions(+), 24 deletions(-)
include/linux/interrupt.h +4 -14
index 44e335b17ed64..00c01b0a43be1 100644
@@ -181,9 +181,8 @@ request_any_context_irq(unsigned int irq, irq_handler_t handler,
 			unsigned long flags, const char *name, void *dev_id);
 
 extern int __must_check
-__request_percpu_irq(unsigned int irq, irq_handler_t handler,
-		     unsigned long flags, const char *devname,
-		     const cpumask_t *affinity, void __percpu *percpu_dev_id);
+request_percpu_irq_affinity(unsigned int irq, irq_handler_t handler, const char *devname,
+			    const cpumask_t *affinity, void __percpu *percpu_dev_id);
 
 extern int __must_check
 request_nmi(unsigned int irq, irq_handler_t handler, unsigned long flags,
@@ -193,17 +192,8 @@ static inline int __must_check
 request_percpu_irq(unsigned int irq, irq_handler_t handler,
 		   const char *devname, void __percpu *percpu_dev_id)
 {
-	return __request_percpu_irq(irq, handler, 0,
-				    devname, NULL, percpu_dev_id);
-}
-
-static inline int __must_check
-request_percpu_irq_affinity(unsigned int irq, irq_handler_t handler,
-			    const char *devname, const cpumask_t *affinity,
-			    void __percpu *percpu_dev_id)
-{
-	return __request_percpu_irq(irq, handler, 0,
-				    devname, affinity, percpu_dev_id);
+	return request_percpu_irq_affinity(irq, handler, devname,
+					   NULL, percpu_dev_id);
 }
 
 extern int __must_check
kernel/irq/manage.c +4 -5
index 7b25ffc5c43a4..1c858be09ba13 100644
@@ -2510,10 +2510,9 @@ struct irqaction *create_percpu_irqaction(irq_handler_t handler, unsigned long f
 }
 
 /**
- * __request_percpu_irq - allocate a percpu interrupt line
+ * request_percpu_irq_affinity - allocate a percpu interrupt line
  * @irq:	Interrupt line to allocate
  * @handler:	Function to be called when the IRQ occurs.
- * @flags:	Interrupt type flags (IRQF_TIMER only)
  * @devname:	An ascii name for the claiming device
  * @affinity:	A cpumask describing the target CPUs for this interrupt
  * @dev_id:	A percpu cookie passed back to the handler function
@@ -2526,9 +2525,9 @@ struct irqaction *create_percpu_irqaction(irq_handler_t handler, unsigned long f
  * the handler gets called with the interrupted CPU's instance of
  * that variable.
  */
-int __request_percpu_irq(unsigned int irq, irq_handler_t handler,
-			 unsigned long flags, const char *devname,
-			 const cpumask_t *affinity, void __percpu *dev_id)
+int request_percpu_irq_affinity(unsigned int irq, irq_handler_t handler,
+				const char *devname, const cpumask_t *affinity,
+				void __percpu *dev_id)
 {
 	struct irqaction *action;
 	struct irq_desc *desc;

kernel/irq/manage.c int __request_percpu_irq(unsigned int irq, irq_handler_t handler, · line 2544

Quoted 8 lines
kernel/irq/manage.c +1 -4
@@ -2542,10 +2541,7 @@ int __request_percpu_irq(unsigned int irq, irq_handler_t handler,
 	    !irq_settings_is_per_cpu_devid(desc))
 		return -EINVAL;
 
-	if (flags && flags != IRQF_TIMER)
-		return -EINVAL;
-
-	action = create_percpu_irqaction(handler, flags, devname, affinity, dev_id);
+	action = create_percpu_irqaction(handler, 0, devname, affinity, dev_id);
Quoted 12 lines
kernel/irq/manage.c +1 -1
 	if (!action)
 		return -ENOMEM;
 
@@ -2564,7 +2560,7 @@ int __request_percpu_irq(unsigned int irq, irq_handler_t handler,
 
 	return retval;
 }
-EXPORT_SYMBOL_GPL(__request_percpu_irq);
+EXPORT_SYMBOL(request_percpu_irq_affinity);
 
 /**
  * request_percpu_nmi - allocate a percpu interrupt line for NMI delivery
merge bot Applied
#6 lore raw

[tip: irq/core] genirq: Remove __request_percpu_irq() helper

In reply to Marc Zyngier
The following commit has been merged into the irq/core branch of tip:

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

Commit-ID:     e9b624ea31cc957b3a7798f89c20a80a8cbb0b73
Gitweb:        https://git.kernel.org/tip/e9b624ea31cc957b3a7798f89c20a80a8cbb0b73
Author:        Marc Zyngier <[email protected]>
AuthorDate:    Wed, 10 Dec 2025 08:22:38 
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Mon, 15 Dec 2025 22:20:50 +01:00

genirq: Remove __request_percpu_irq() helper

With the IRQ timing stuff being gone, there is no need to specify a flag when requesting a percpu interrupt. Not only IRQF_TIMER was the only flag (set of flags actually) allowed, but nobody ever passed it.

Get rid of __request_percpu_irq(), which was only getting 0 as flags, and promote request_percpu_irq_affinity() as its replacement.

---
 include/linux/interrupt.h | 18 ++++--------------
 kernel/irq/manage.c       | 15 +++++----------
 2 files changed, 9 insertions(+), 24 deletions(-)
include/linux/interrupt.h +4 -14
index 44e335b..00c01b0 100644
@@ -181,9 +181,8 @@ request_any_context_irq(unsigned int irq, irq_handler_t handler,
 			unsigned long flags, const char *name, void *dev_id);
 
 extern int __must_check
-__request_percpu_irq(unsigned int irq, irq_handler_t handler,
-		     unsigned long flags, const char *devname,
-		     const cpumask_t *affinity, void __percpu *percpu_dev_id);
+request_percpu_irq_affinity(unsigned int irq, irq_handler_t handler, const char *devname,
+			    const cpumask_t *affinity, void __percpu *percpu_dev_id);
 
 extern int __must_check
 request_nmi(unsigned int irq, irq_handler_t handler, unsigned long flags,
@@ -193,17 +192,8 @@ static inline int __must_check
 request_percpu_irq(unsigned int irq, irq_handler_t handler,
 		   const char *devname, void __percpu *percpu_dev_id)
 {
-	return __request_percpu_irq(irq, handler, 0,
-				    devname, NULL, percpu_dev_id);
-}
-
-static inline int __must_check
-request_percpu_irq_affinity(unsigned int irq, irq_handler_t handler,
-			    const char *devname, const cpumask_t *affinity,
-			    void __percpu *percpu_dev_id)
-{
-	return __request_percpu_irq(irq, handler, 0,
-				    devname, affinity, percpu_dev_id);
+	return request_percpu_irq_affinity(irq, handler, devname,
+					   NULL, percpu_dev_id);
 }
 
 extern int __must_check
kernel/irq/manage.c +5 -10
index 7b25ffc..4d0b326 100644
@@ -2510,10 +2510,9 @@ struct irqaction *create_percpu_irqaction(irq_handler_t handler, unsigned long f
 }
 
 /**
- * __request_percpu_irq - allocate a percpu interrupt line
+ * request_percpu_irq_affinity - allocate a percpu interrupt line
  * @irq:	Interrupt line to allocate
  * @handler:	Function to be called when the IRQ occurs.
- * @flags:	Interrupt type flags (IRQF_TIMER only)
  * @devname:	An ascii name for the claiming device
  * @affinity:	A cpumask describing the target CPUs for this interrupt
  * @dev_id:	A percpu cookie passed back to the handler function
@@ -2526,9 +2525,8 @@ struct irqaction *create_percpu_irqaction(irq_handler_t handler, unsigned long f
  * the handler gets called with the interrupted CPU's instance of
  * that variable.
  */
-int __request_percpu_irq(unsigned int irq, irq_handler_t handler,
-			 unsigned long flags, const char *devname,
-			 const cpumask_t *affinity, void __percpu *dev_id)
+int request_percpu_irq_affinity(unsigned int irq, irq_handler_t handler, const char *devname,
+				const cpumask_t *affinity, void __percpu *dev_id)
 {
 	struct irqaction *action;
 	struct irq_desc *desc;
@@ -2542,10 +2540,7 @@ int __request_percpu_irq(unsigned int irq, irq_handler_t handler,
 	    !irq_settings_is_per_cpu_devid(desc))
 		return -EINVAL;
 
-	if (flags && flags != IRQF_TIMER)
-		return -EINVAL;
-
-	action = create_percpu_irqaction(handler, flags, devname, affinity, dev_id);
+	action = create_percpu_irqaction(handler, 0, devname, affinity, dev_id);
 	if (!action)
 		return -ENOMEM;
 
@@ -2564,7 +2559,7 @@ int __request_percpu_irq(unsigned int irq, irq_handler_t handler,
 
 	return retval;
 }
-EXPORT_SYMBOL_GPL(__request_percpu_irq);
+EXPORT_SYMBOL_GPL(request_percpu_irq_affinity);
 
 /**
  * request_percpu_nmi - allocate a percpu interrupt line for NMI delivery
#7 lore raw

PATCH 3/6 mips: Move IP30 timer to request_percpu_irq()

In reply to Marc Zyngier

Teach the SGI IP30 timer about request_percpu_irq(), which ultimately will allow for the removal of the antiquated setup_percpu_irq() API.

---
 arch/mips/include/asm/cevt-r4k.h |  1 -
 arch/mips/kernel/cevt-r4k.c      | 11 -----------
 arch/mips/sgi-ip30/ip30-timer.c  |  5 ++---
 3 files changed, 2 insertions(+), 15 deletions(-)
arch/mips/include/asm/cevt-r4k.h +0 -1
index 2e13a038d2600..5229eb34f28a4 100644
@@ -23,7 +23,6 @@ void mips_event_handler(struct clock_event_device *dev);
 int c0_compare_int_usable(void);
 irqreturn_t c0_compare_interrupt(int, void *);
 
-extern struct irqaction c0_compare_irqaction;
 extern int cp0_timer_irq_installed;
 
 #endif /* __ASM_CEVT_R4K_H */
arch/mips/kernel/cevt-r4k.c +0 -11
index 5f6e9e2ebbdbb..f58325f9bd2bc 100644
@@ -159,17 +159,6 @@ irqreturn_t c0_compare_interrupt(int irq, void *dev_id)
 	return IRQ_NONE;
 }
 
-struct irqaction c0_compare_irqaction = {
-	.handler = c0_compare_interrupt,
-	/*
-	 * IRQF_SHARED: The timer interrupt may be shared with other interrupts
-	 * such as perf counter and FDC interrupts.
-	 */
-	.flags = IRQF_PERCPU | IRQF_TIMER | IRQF_SHARED,
-	.name = "timer",
-};
-
-
 void mips_event_handler(struct clock_event_device *dev)
 {
 }
arch/mips/sgi-ip30/ip30-timer.c +2 -3
index 7652f72f0daf6..294e1f7e6d8a6 100644
@@ -52,11 +52,10 @@ void __init plat_time_init(void)
 	int irq = get_c0_compare_int();
 
 	cp0_timer_irq_installed = 1;
-	c0_compare_irqaction.percpu_dev_id = &mips_clockevent_device;
-	c0_compare_irqaction.flags &= ~IRQF_SHARED;
 	irq_set_handler(irq, handle_percpu_devid_irq);
 	irq_set_percpu_devid(irq);
-	setup_percpu_irq(irq, &c0_compare_irqaction);
+	WARN_ON(request_percpu_irq(irq, c0_compare_interrupt,
+				   "timer", &mips_clockevent_device));
 	enable_percpu_irq(irq, IRQ_TYPE_NONE);
 
 	ip30_heart_clocksource_init();
Signature · 1 line
2.47.3
#8 lore raw

Re: [PATCH 3/6] mips: Move IP30 timer to request_percpu_irq()

Quoted 27 lines · Marc Zyngier

Teach the SGI IP30 timer about request_percpu_irq(), which ultimately will allow for the removal of the antiquated setup_percpu_irq() API.

---
 arch/mips/include/asm/cevt-r4k.h |  1 -
 arch/mips/kernel/cevt-r4k.c      | 11 -----------
 arch/mips/sgi-ip30/ip30-timer.c  |  5 ++---
 3 files changed, 2 insertions(+), 15 deletions(-)
arch/mips/include/asm/cevt-r4k.h +0 -1
index 2e13a038d2600..5229eb34f28a4 100644
@@ -23,7 +23,6 @@ void mips_event_handler(struct clock_event_device *dev);
 int c0_compare_int_usable(void);
 irqreturn_t c0_compare_interrupt(int, void *);
 
-extern struct irqaction c0_compare_irqaction;
 extern int cp0_timer_irq_installed;
 
 #endif /* __ASM_CEVT_R4K_H */
arch/mips/kernel/cevt-r4k.c +0 -0
index 5f6e9e2ebbdbb..f58325f9bd2bc 100644

arch/mips/kernel/cevt-r4k.c irqreturn_t c0_compare_interrupt(int irq, void *dev_id) · line 168

Quoted 10 lines
arch/mips/kernel/cevt-r4k.c +0 -7
@@ -159,17 +159,6 @@ irqreturn_t c0_compare_interrupt(int irq, void *dev_id)
 	return IRQ_NONE;
 }
 
-struct irqaction c0_compare_irqaction = {
-	.handler = c0_compare_interrupt,
-	/*
-	 * IRQF_SHARED: The timer interrupt may be shared with other interrupts
-	 * such as perf counter and FDC interrupts.
-	 */
-	.flags = IRQF_PERCPU | IRQF_TIMER | IRQF_SHARED,

The flags will add a "IRQF_NO_SUSPEND" when using request_percpu_irq(), is there any change?

Quoted 25 lines
arch/mips/kernel/cevt-r4k.c +0 -4
-	.name = "timer",
-};
-
-
 void mips_event_handler(struct clock_event_device *dev)
 {
 }
arch/mips/sgi-ip30/ip30-timer.c +2 -3
index 7652f72f0daf6..294e1f7e6d8a6 100644
@@ -52,11 +52,10 @@ void __init plat_time_init(void)
 	int irq = get_c0_compare_int();
 
 	cp0_timer_irq_installed = 1;
-	c0_compare_irqaction.percpu_dev_id = &mips_clockevent_device;
-	c0_compare_irqaction.flags &= ~IRQF_SHARED;
 	irq_set_handler(irq, handle_percpu_devid_irq);
 	irq_set_percpu_devid(irq);
-	setup_percpu_irq(irq, &c0_compare_irqaction);
+	WARN_ON(request_percpu_irq(irq, c0_compare_interrupt,
+				   "timer", &mips_clockevent_device));
 	enable_percpu_irq(irq, IRQ_TYPE_NONE);
 
 	ip30_heart_clocksource_init();
#9 lore raw

Re: [PATCH 3/6] mips: Move IP30 timer to request_percpu_irq()

Quoted 34 lines · Jinjie Ruan
Quoted 30 lines · Marc Zyngier

Teach the SGI IP30 timer about request_percpu_irq(), which ultimately will allow for the removal of the antiquated setup_percpu_irq() API.

---
 arch/mips/include/asm/cevt-r4k.h |  1 -
 arch/mips/kernel/cevt-r4k.c      | 11 -----------
 arch/mips/sgi-ip30/ip30-timer.c  |  5 ++---
 3 files changed, 2 insertions(+), 15 deletions(-)
arch/mips/include/asm/cevt-r4k.h +0 -1
index 2e13a038d2600..5229eb34f28a4 100644
@@ -23,7 +23,6 @@ void mips_event_handler(struct clock_event_device *dev);
 int c0_compare_int_usable(void);
 irqreturn_t c0_compare_interrupt(int, void *);
 
-extern struct irqaction c0_compare_irqaction;
 extern int cp0_timer_irq_installed;
 
 #endif /* __ASM_CEVT_R4K_H */
arch/mips/kernel/cevt-r4k.c +0 -0
index 5f6e9e2ebbdbb..f58325f9bd2bc 100644
@@ -159,17 +159,6 @@ irqreturn_t c0_compare_interrupt(int irq, void *dev_id)
 	return IRQ_NONE;
 }
 
Quoted 10 lines

arch/mips/kernel/cevt-r4k.c irqreturn_t c0_compare_interrupt(int irq, void *dev_id) · line 168

Quoted 7 lines
arch/mips/kernel/cevt-r4k.c +0 -7
-struct irqaction c0_compare_irqaction = {
-	.handler = c0_compare_interrupt,
-	/*
-	 * IRQF_SHARED: The timer interrupt may be shared with other interrupts
-	 * such as perf counter and FDC interrupts.
-	 */
-	.flags = IRQF_PERCPU | IRQF_TIMER | IRQF_SHARED,

The flags will add a "IRQF_NO_SUSPEND" when using request_percpu_irq(), is there any change?

I don't think this is a material change, given that power management on an SGI Octane is simply non-existent.

In any case, this matches what we expect from per-CPU timers, and if this box has different requirements, then we should discuss that instead of treating as a special case that must be preserved.

Thanks,

	M.
Signature · 1 line
Without deviation from the norm, progress is not possible.
merge bot Applied
#10 lore raw

[tip: irq/core] MIPS: Move IP30 timer to request_percpu_irq()

In reply to Marc Zyngier
The following commit has been merged into the irq/core branch of tip:

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

Commit-ID:     a1eaca410a3cf533f8005d2959a7a8d9d8979f3e
Gitweb:        https://git.kernel.org/tip/a1eaca410a3cf533f8005d2959a7a8d9d8979f3e
Author:        Marc Zyngier <[email protected]>
AuthorDate:    Wed, 10 Dec 2025 08:22:39 
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Mon, 15 Dec 2025 22:20:50 +01:00

MIPS: Move IP30 timer to request_percpu_irq()

Teach the SGI IP30 timer about request_percpu_irq(), which ultimately will allow for the removal of the antiquated setup_percpu_irq() API.

---
 arch/mips/include/asm/cevt-r4k.h |  1 -
 arch/mips/kernel/cevt-r4k.c      | 11 -----------
 arch/mips/sgi-ip30/ip30-timer.c  |  5 ++---
 3 files changed, 2 insertions(+), 15 deletions(-)
arch/mips/include/asm/cevt-r4k.h +0 -1
index 2e13a03..5229eb3 100644
@@ -23,7 +23,6 @@ void mips_event_handler(struct clock_event_device *dev);
 int c0_compare_int_usable(void);
 irqreturn_t c0_compare_interrupt(int, void *);
 
-extern struct irqaction c0_compare_irqaction;
 extern int cp0_timer_irq_installed;
 
 #endif /* __ASM_CEVT_R4K_H */
arch/mips/kernel/cevt-r4k.c +0 -11
index 5f6e9e2..f58325f 100644
@@ -159,17 +159,6 @@ irqreturn_t c0_compare_interrupt(int irq, void *dev_id)
 	return IRQ_NONE;
 }
 
-struct irqaction c0_compare_irqaction = {
-	.handler = c0_compare_interrupt,
-	/*
-	 * IRQF_SHARED: The timer interrupt may be shared with other interrupts
-	 * such as perf counter and FDC interrupts.
-	 */
-	.flags = IRQF_PERCPU | IRQF_TIMER | IRQF_SHARED,
-	.name = "timer",
-};
-
-
 void mips_event_handler(struct clock_event_device *dev)
 {
 }
arch/mips/sgi-ip30/ip30-timer.c +2 -3
index 7652f72..294e1f7 100644
@@ -52,11 +52,10 @@ void __init plat_time_init(void)
 	int irq = get_c0_compare_int();
 
 	cp0_timer_irq_installed = 1;
-	c0_compare_irqaction.percpu_dev_id = &mips_clockevent_device;
-	c0_compare_irqaction.flags &= ~IRQF_SHARED;
 	irq_set_handler(irq, handle_percpu_devid_irq);
 	irq_set_percpu_devid(irq);
-	setup_percpu_irq(irq, &c0_compare_irqaction);
+	WARN_ON(request_percpu_irq(irq, c0_compare_interrupt,
+				   "timer", &mips_clockevent_device));
 	enable_percpu_irq(irq, IRQ_TYPE_NONE);
 
 	ip30_heart_clocksource_init();
#11 lore raw

PATCH 4/6 mips: Move IP27 timer to request_percpu_irq()

In reply to Marc Zyngier

Teach the SGI IP27 timer about request_percpu_irq(), which ultimately will allow for the removal of the antiquated setup_percpu_irq() API.

---
 arch/mips/sgi-ip27/ip27-timer.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
arch/mips/sgi-ip27/ip27-timer.c +2 -8
index 444b5e0e935f7..5f4da05cb2c9d 100644
@@ -58,13 +58,6 @@ static irqreturn_t hub_rt_counter_handler(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-struct irqaction hub_rt_irqaction = {
-	.handler	= hub_rt_counter_handler,
-	.percpu_dev_id	= &hub_rt_clockevent,
-	.flags		= IRQF_PERCPU | IRQF_TIMER,
-	.name		= "hub-rt",
-};
-
 /*
  * This is a hack; we really need to figure these values out dynamically
  *
@@ -103,7 +96,8 @@ static void __init hub_rt_clock_event_global_init(void)
 {
 	irq_set_handler(IP27_RT_TIMER_IRQ, handle_percpu_devid_irq);
 	irq_set_percpu_devid(IP27_RT_TIMER_IRQ);
-	setup_percpu_irq(IP27_RT_TIMER_IRQ, &hub_rt_irqaction);
+	WARN_ON(request_percpu_irq(IP27_RT_TIMER_IRQ, hub_rt_counter_handler,
+				   "hub-rt", &hub_rt_clockevent));
 }
 
 static u64 hub_rt_read(struct clocksource *cs)
Signature · 1 line
2.47.3
merge bot Applied
#12 lore raw

[tip: irq/core] MIPS: Move IP27 timer to request_percpu_irq()

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

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

Commit-ID:     7f92b583382a1eb4aaafed90d181464969e41656
Gitweb:        https://git.kernel.org/tip/7f92b583382a1eb4aaafed90d181464969e41656
Author:        Marc Zyngier <[email protected]>
AuthorDate:    Wed, 10 Dec 2025 08:22:40 
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Mon, 15 Dec 2025 22:20:50 +01:00

MIPS: Move IP27 timer to request_percpu_irq()

Teach the SGI IP27 timer about request_percpu_irq(), which ultimately will allow for the removal of the antiquated setup_percpu_irq() API.

---
 arch/mips/sgi-ip27/ip27-timer.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
arch/mips/sgi-ip27/ip27-timer.c +2 -8
index 444b5e0..5f4da05 100644
@@ -58,13 +58,6 @@ static irqreturn_t hub_rt_counter_handler(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-struct irqaction hub_rt_irqaction = {
-	.handler	= hub_rt_counter_handler,
-	.percpu_dev_id	= &hub_rt_clockevent,
-	.flags		= IRQF_PERCPU | IRQF_TIMER,
-	.name		= "hub-rt",
-};
-
 /*
  * This is a hack; we really need to figure these values out dynamically
  *
@@ -103,7 +96,8 @@ static void __init hub_rt_clock_event_global_init(void)
 {
 	irq_set_handler(IP27_RT_TIMER_IRQ, handle_percpu_devid_irq);
 	irq_set_percpu_devid(IP27_RT_TIMER_IRQ);
-	setup_percpu_irq(IP27_RT_TIMER_IRQ, &hub_rt_irqaction);
+	WARN_ON(request_percpu_irq(IP27_RT_TIMER_IRQ, hub_rt_counter_handler,
+				   "hub-rt", &hub_rt_clockevent));
 }
 
 static u64 hub_rt_read(struct clocksource *cs)
#13 lore raw

PATCH 5/6 clocksource: mips-gic-timer: Move GIC timer to request_percpu_irq()

In reply to Marc Zyngier

Teach the MIPS GIC timer about request_percpu_irq(), which ultimately will allow for the removal of the antiquated setup_percpu_irq() API.

---
 drivers/clocksource/mips-gic-timer.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/clocksource/mips-gic-timer.c +2 -8
index abb685a080a5b..1501c7db9a8e3 100644
@@ -77,13 +77,6 @@ static irqreturn_t gic_compare_interrupt(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static struct irqaction gic_compare_irqaction = {
-	.handler = gic_compare_interrupt,
-	.percpu_dev_id = &gic_clockevent_device,
-	.flags = IRQF_PERCPU | IRQF_TIMER,
-	.name = "timer",
-};
-
 static void gic_clockevent_cpu_init(unsigned int cpu,
 				    struct clock_event_device *cd)
 {
@@ -152,7 +145,8 @@ static int gic_clockevent_init(void)
 	if (!gic_frequency)
 		return -ENXIO;
 
-	ret = setup_percpu_irq(gic_timer_irq, &gic_compare_irqaction);
+	ret = request_percpu_irq(gic_timer_irq, gic_compare_interrupt,
+				 "timer", &gic_clockevent_device);
 	if (ret < 0) {
 		pr_err("IRQ %d setup failed (%d)\n", gic_timer_irq, ret);
 		return ret;
Signature · 1 line
2.47.3
merge bot Applied
#14 lore raw

[tip: irq/core] clocksource/drivers/mips-gic-timer: Move GIC timer to request_percpu_irq()

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

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

Commit-ID:     bd04dae0791a8d44adc304d9787916fd4c539bb4
Gitweb:        https://git.kernel.org/tip/bd04dae0791a8d44adc304d9787916fd4c539bb4
Author:        Marc Zyngier <[email protected]>
AuthorDate:    Wed, 10 Dec 2025 08:22:41 
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Mon, 15 Dec 2025 22:20:51 +01:00

clocksource/drivers/mips-gic-timer: Move GIC timer to request_percpu_irq()

Teach the MIPS GIC timer about request_percpu_irq(), which ultimately will allow for the removal of the antiquated setup_percpu_irq() API.

---
 drivers/clocksource/mips-gic-timer.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/clocksource/mips-gic-timer.c +2 -8
index abb685a..1501c7d 100644
@@ -77,13 +77,6 @@ static irqreturn_t gic_compare_interrupt(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static struct irqaction gic_compare_irqaction = {
-	.handler = gic_compare_interrupt,
-	.percpu_dev_id = &gic_clockevent_device,
-	.flags = IRQF_PERCPU | IRQF_TIMER,
-	.name = "timer",
-};
-
 static void gic_clockevent_cpu_init(unsigned int cpu,
 				    struct clock_event_device *cd)
 {
@@ -152,7 +145,8 @@ static int gic_clockevent_init(void)
 	if (!gic_frequency)
 		return -ENXIO;
 
-	ret = setup_percpu_irq(gic_timer_irq, &gic_compare_irqaction);
+	ret = request_percpu_irq(gic_timer_irq, gic_compare_interrupt,
+				 "timer", &gic_clockevent_device);
 	if (ret < 0) {
 		pr_err("IRQ %d setup failed (%d)\n", gic_timer_irq, ret);
 		return ret;
merge bot Applied
#15 lore raw

[tip: timers/clocksource] clocksource/drivers/mips-gic-timer: Move GIC timer to request_percpu_irq()

In reply to Marc Zyngier
The following commit has been merged into the timers/clocksource branch of tip:

The following commit has been merged into the timers/clocksource branch of tip:

Commit-ID:     a83f9c04be4e807d1c3961eec3fe3310c60ed9aa
Gitweb:        https://git.kernel.org/tip/a83f9c04be4e807d1c3961eec3fe3310c60ed9aa
Author:        Marc Zyngier <[email protected]>
AuthorDate:    Wed, 10 Dec 2025 08:22:41 
Committer:     Daniel Lezcano <[email protected]>
CommitterDate: Tue, 20 Jan 2026 18:07:24 +01:00

clocksource/drivers/mips-gic-timer: Move GIC timer to request_percpu_irq()

Teach the MIPS GIC timer about request_percpu_irq(), which ultimately will allow for the removal of the antiquated setup_percpu_irq() API.

---
 drivers/clocksource/mips-gic-timer.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/clocksource/mips-gic-timer.c +2 -8
index abb685a..1501c7d 100644
@@ -77,13 +77,6 @@ static irqreturn_t gic_compare_interrupt(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static struct irqaction gic_compare_irqaction = {
-	.handler = gic_compare_interrupt,
-	.percpu_dev_id = &gic_clockevent_device,
-	.flags = IRQF_PERCPU | IRQF_TIMER,
-	.name = "timer",
-};
-
 static void gic_clockevent_cpu_init(unsigned int cpu,
 				    struct clock_event_device *cd)
 {
@@ -152,7 +145,8 @@ static int gic_clockevent_init(void)
 	if (!gic_frequency)
 		return -ENXIO;
 
-	ret = setup_percpu_irq(gic_timer_irq, &gic_compare_irqaction);
+	ret = request_percpu_irq(gic_timer_irq, gic_compare_interrupt,
+				 "timer", &gic_clockevent_device);
 	if (ret < 0) {
 		pr_err("IRQ %d setup failed (%d)\n", gic_timer_irq, ret);
 		return ret;
#16 lore raw

PATCH 6/6 genirq: Kill setup_percpu_irq()

In reply to Marc Zyngier

setup_percpu_irq() was always a bad kludge, and should have never been there the first place. Now that the last users are gone, remove it for good.

---
 include/linux/irq.h |  3 ---
 kernel/irq/manage.c | 30 ------------------------------
 2 files changed, 33 deletions(-)
include/linux/irq.h +0 -3
index 4a9f1d7b08c39..67ea759749beb 100644
@@ -595,9 +595,6 @@ enum {
 
 #define IRQ_DEFAULT_INIT_FLAGS	ARCH_IRQ_INIT_FLAGS
 
-struct irqaction;
-extern int setup_percpu_irq(unsigned int irq, struct irqaction *new);
-
 #ifdef CONFIG_DEPRECATED_IRQ_CPU_ONOFFLINE
 extern void irq_cpu_online(void);
 extern void irq_cpu_offline(void);
kernel/irq/manage.c +0 -30
index 1c858be09ba13..089a16ba8de1c 100644
@@ -2448,36 +2448,6 @@ void free_percpu_nmi(unsigned int irq, void __percpu *dev_id)
 	kfree(__free_percpu_irq(irq, dev_id));
 }
 
-/**
- * setup_percpu_irq - setup a per-cpu interrupt
- * @irq:	Interrupt line to setup
- * @act:	irqaction for the interrupt
- *
- * Used to statically setup per-cpu interrupts in the early boot process.
- */
-int setup_percpu_irq(unsigned int irq, struct irqaction *act)
-{
-	struct irq_desc *desc = irq_to_desc(irq);
-	int retval;
-
-	if (!desc || !irq_settings_is_per_cpu_devid(desc))
-		return -EINVAL;
-
-	retval = irq_chip_pm_get(&desc->irq_data);
-	if (retval < 0)
-		return retval;
-
-	if (!act->affinity)
-		act->affinity = cpu_online_mask;
-
-	retval = __setup_irq(irq, desc, act);
-
-	if (retval)
-		irq_chip_pm_put(&desc->irq_data);
-
-	return retval;
-}
-
 static
 struct irqaction *create_percpu_irqaction(irq_handler_t handler, unsigned long flags,
 					  const char *devname, const cpumask_t *affinity,
Signature · 1 line
2.47.3
merge bot Applied
#17 lore raw

[tip: irq/core] genirq: Remove setup_percpu_irq()

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

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

Commit-ID:     dbcc728e185f8c27fcafa1408ff63fe38c7dc72d
Gitweb:        https://git.kernel.org/tip/dbcc728e185f8c27fcafa1408ff63fe38c7dc72d
Author:        Marc Zyngier <[email protected]>
AuthorDate:    Wed, 10 Dec 2025 08:22:42 
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Mon, 15 Dec 2025 22:20:51 +01:00

genirq: Remove setup_percpu_irq()

setup_percpu_irq() was always a bad kludge, and should have never been there the first place. Now that the last users are gone, remove it for good.

---
 include/linux/irq.h |  3 ---
 kernel/irq/manage.c | 30 ------------------------------
 2 files changed, 33 deletions(-)
include/linux/irq.h +0 -3
index 4a9f1d7..67ea759 100644
@@ -595,9 +595,6 @@ enum {
 
 #define IRQ_DEFAULT_INIT_FLAGS	ARCH_IRQ_INIT_FLAGS
 
-struct irqaction;
-extern int setup_percpu_irq(unsigned int irq, struct irqaction *new);
-
 #ifdef CONFIG_DEPRECATED_IRQ_CPU_ONOFFLINE
 extern void irq_cpu_online(void);
 extern void irq_cpu_offline(void);
kernel/irq/manage.c +0 -30
index 4d0b326..bc2d36b 100644
@@ -2448,36 +2448,6 @@ void free_percpu_nmi(unsigned int irq, void __percpu *dev_id)
 	kfree(__free_percpu_irq(irq, dev_id));
 }
 
-/**
- * setup_percpu_irq - setup a per-cpu interrupt
- * @irq:	Interrupt line to setup
- * @act:	irqaction for the interrupt
- *
- * Used to statically setup per-cpu interrupts in the early boot process.
- */
-int setup_percpu_irq(unsigned int irq, struct irqaction *act)
-{
-	struct irq_desc *desc = irq_to_desc(irq);
-	int retval;
-
-	if (!desc || !irq_settings_is_per_cpu_devid(desc))
-		return -EINVAL;
-
-	retval = irq_chip_pm_get(&desc->irq_data);
-	if (retval < 0)
-		return retval;
-
-	if (!act->affinity)
-		act->affinity = cpu_online_mask;
-
-	retval = __setup_irq(irq, desc, act);
-
-	if (retval)
-		irq_chip_pm_put(&desc->irq_data);
-
-	return retval;
-}
-
 static
 struct irqaction *create_percpu_irqaction(irq_handler_t handler, unsigned long flags,
 					  const char *devname, const cpumask_t *affinity,