genirq: Post 6.19-rc1 API cleanup
Subsystems (5)
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
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
PATCH 2/6 genirq: Remove __request_percpu_irq() helper
In reply to Marc ZyngierWith 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
@@ -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
@@ -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
PATCH 3/6 mips: Move IP30 timer to request_percpu_irq()
In reply to Marc ZyngierTeach 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
@@ -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
@@ -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
@@ -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
PATCH 4/6 mips: Move IP27 timer to request_percpu_irq()
In reply to Marc ZyngierTeach 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
@@ -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
PATCH 5/6 clocksource: mips-gic-timer: Move GIC timer to request_percpu_irq()
In reply to Marc ZyngierTeach 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
@@ -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
PATCH 6/6 genirq: Kill setup_percpu_irq()
In reply to Marc Zyngiersetup_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
@@ -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
@@ -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
Re: [PATCH 1/6] genirq: Remove IRQ timing tracking infrastructure
In reply to Marc ZyngierQuoted 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@@ -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
Re: [PATCH 2/6] genirq: Remove __request_percpu_irq() helper
In reply to Marc ZyngierQuoted 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_TIMERwas 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 promoterequest_percpu_irq_affinity()as its replacement.Signed-off-by Marc Zyngier <[email protected]>--- include/linux/interrupt.h | 18 ++++-------------- kernel/irq/manage.c | 16 ++++++---------- 2 files changed, 10 insertions(+), 24 deletions(-)include/linux/interrupt.h +4
-14@@ -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_checkkernel/irq/manage.c +4
-5@@ -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
-1if (!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
Re: [PATCH 3/6] mips: Move IP30 timer to request_percpu_irq()
In reply to Marc ZyngierQuoted 27 lines · Marc Zyngier
Teach the SGI IP30 timer about
request_percpu_irq(), which ultimately will allow for the removal of the antiquatedsetup_percpu_irq()API.Signed-off-by Marc Zyngier <[email protected]>--- 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@@ -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
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@@ -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 ();
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 antiquatedsetup_percpu_irq()API.Signed-off-by Marc Zyngier <[email protected]>--- 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@@ -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@@ -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 usingrequest_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.
[tip: irq/core] clocksource/drivers/mips-gic-timer: Move GIC timer to request_percpu_irq()
In reply to Marc ZyngierThe 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
@@ -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;
[tip: irq/core] genirq: Remove setup_percpu_irq()
In reply to Marc ZyngierThe 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
@@ -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
@@ -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,
[tip: irq/core] MIPS: Move IP27 timer to request_percpu_irq()
In reply to Marc ZyngierThe 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
@@ -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)
[tip: irq/core] MIPS: Move IP30 timer to request_percpu_irq()
In reply to Marc ZyngierThe 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
@@ -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
@@ -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
@@ -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 ();
[tip: irq/core] genirq: Remove __request_percpu_irq() helper
In reply to Marc ZyngierThe 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
@@ -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
@@ -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
[tip: irq/core] genirq: Remove IRQ timing tracking infrastructure
In reply to Marc ZyngierThe 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
[tip: timers/clocksource] clocksource/drivers/mips-gic-timer: Move GIC timer to request_percpu_irq()
In reply to Marc ZyngierThe 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
@@ -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;