Make set_handle_irq and handle_arch_irq generic, v3
Subsystems (5)
This is my third version of this patch set, but the original cover letter is still the most relevant description I can come up with.
This patch set has been sitting around for a while, but it got a bit lost in the shuffle. In RISC-V land we currently couple do_IRQ (the C entry point for interrupt handling) to our first-level interrupt controller. While this isn't completely crazy (as the first-level interrupt controller is specified by the ISA), it is a bit awkward.
This patch set decouples our trap handler from our first-level IRQ chip driver by copying what a handful of other architectures are doing. This does add an additional load to the interrupt handling path, but there's a handful of performance problems in there that I've been meaning to look at so I don't mind adding another one for now. The advantage is that our irqchip driver is decoupled from our arch port, at least at compile time.
I've build tested this with defconfigs on all the modified architectures after both patch 1 and 5. I've left the old acks in for the later patches as the patch set has changed very little since I last submitted it.
Changes since v2:
* This is now called CONFIG_GENERIC_IRQ_MULTI_HANDLER instead of MULTI_IRQ_HANDLER.
* Rather than converting the ARM code to generic code, this adds new generic code (based on the ARM implementation) and then provides separate patches to convert each architecture over to use CONFIG_GENERIC_IRQ_MULTI_HANDLER.
Changes since v1:
* I based this on arm instead of arm64, which means we guard the selection of these routines with CONFIG_MULTI_IRQ_HANDLER.
* The changes are in kernel/irq/handle.c and include/linux/irq.h instead of lib.
* I've converted the arm, arm64, and openrisc ports to use the generic versions of these routines.
[PATCH v3 1/5] irq: Add CONFIG_GENERIC_IRQ_MULTI_HANDLER [PATCH v3 2/5] RISC-V: Move to the new GENERIC_IRQ_MULTI_HANDLER [PATCH v3 3/5] arm: Convert to GENERIC_IRQ_MULTI_HANDLER [PATCH v3 4/5] arm64: Use the new GENERIC_IRQ_MULTI_HANDLER [PATCH v3 5/5] openrisc: Use the new GENERIC_IRQ_MULTI_HANDLER
PATCH v3 1/5 irq: Add CONFIG_GENERIC_IRQ_MULTI_HANDLER
It looks like the arm irqchip registration mechanism has been copied into a handful of ports, including arm64 and openrisc. I want to use this in the RISC-V port, so I thought it would be good to make this generic instead.
This patch copies the arm definition of CONFIG_MULTI_IRQ_HANDLER into kernel/irq under CONFIG_GENERIC_MULTI_IRQ_HANDLER. This patch is currently all dead code, but it will be enabled in the various other architectures in subsequent patches.
--- include/linux/irq.h | 18 ++++++++++++++++++ kernel/irq/Kconfig | 5 +++++ kernel/irq/handle.c | 15 +++++++++++++++ 3 files changed, 38 insertions(+)
include/linux/irq.h +18 -0
@@ -1170,4 +1170,22 @@ int __ipi_send_mask(struct irq_desc *desc, const struct cpumask *dest);int ipi_send_single (unsigned int virq,unsigned int cpu);int ipi_send_mask (unsigned int virq,const struct cpumask *dest); +#ifdef CONFIG_GENERIC_IRQ_MULTI_HANDLER +/* +* Registers a generic IRQ handling function as the top-level IRQ handler in +* the system, which is generally the first C code called from an assembly +* architecture-specific interrupt handler. +* +* Returns 0 on success, or -EBUSY if an IRQ handler has already been +* registered. +*/ +int __init set_handle_irq (void (*handle_irq)(struct pt_regs *)); + +/* +* Allows interrupt handlers to find the irqchip that's been registered as the +* top-level IRQ handler. +*/ +extern void (*handle_arch_irq)(struct pt_regs *)__ro_after_init ; +#endif +#endif /* _LINUX_IRQ_H */
kernel/irq/Kconfig +5 -0
@@ -132,3 +132,8 @@ config GENERIC_IRQ_DEBUGFS If you don't know what to do here, say N. endmenu + +config GENERIC_IRQ_MULTI_HANDLER + bool + help + Allow each machine to specify it's own IRQ handler at run time.
kernel/irq/handle.c +15 -0
@@ -20,6 +20,10 @@#include "internals.h" +#ifdef CONFIG_GENERIC_IRQ_MULTI_HANDLER +void (*handle_arch_irq)(struct pt_regs *)__ro_after_init ; +#endif +/** * handle_bad_irq - handle spurious and unhandled irqs * @desc: description of the interrupt
@@ -207,3 +211,14 @@ irqreturn_t handle_irq_event(struct irq_desc *desc)irqd_clear (&desc->irq_data,IRQD_IRQ_INPROGRESS );return ret; } + +#ifdef CONFIG_GENERIC_IRQ_MULTI_HANDLER +int __init set_handle_irq (void (*handle_irq)(struct pt_regs *)) +{ +if (handle_arch_irq) +return -EBUSY ; + + handle_arch_irq = handle_irq; +return 0 ; +} +#endif
Signature · 1 line
2.16.1
tip-bot for Palmer Dabbelt
merge bot[tip:irq/core] genirq: Add CONFIG_GENERIC_IRQ_MULTI_HANDLER
genirq: Add CONFIG_GENERIC_IRQ_MULTI_HANDLER
Commit-ID: caacdbf4aa567ab5e8de1a4070195c5d3e8f1340 Gitweb: https://git.kernel.org/tip/caacdbf4aa567ab5e8de1a4070195c5d3e8f1340 Author: Palmer Dabbelt <[email protected]> AuthorDate: Wed, 7 Mar 2018 15:57:27 -0800 Committer: Thomas Gleixner <[email protected]> CommitDate: Wed, 14 Mar 2018 21:46:29 +0100
genirq: Add CONFIG_GENERIC_IRQ_MULTI_HANDLER
The arm multi irq handler registration mechanism has been copied into a handful of architectures, including arm64 and openrisc. RISC-V needs the same mechanism.
Instead of adding yet another copy for RISC-V copy the arm implementation into the core code depending on a new Kconfig symbol:CONFIG_GENERIC_MULTI_IRQ_HANDLER.
Subsequent patches will convert the various architectures.
--- include/linux/irq.h | 18 ++++++++++++++++++ kernel/irq/Kconfig | 5 +++++ kernel/irq/handle.c | 15 +++++++++++++++ 3 files changed, 38 insertions(+)
include/linux/irq.h +18 -0
@@ -1165,4 +1165,22 @@ int __ipi_send_mask(struct irq_desc *desc, const struct cpumask *dest);int ipi_send_single (unsigned int virq,unsigned int cpu);int ipi_send_mask (unsigned int virq,const struct cpumask *dest); +#ifdef CONFIG_GENERIC_IRQ_MULTI_HANDLER +/* +* Registers a generic IRQ handling function as the top-level IRQ handler in +* the system, which is generally the first C code called from an assembly +* architecture-specific interrupt handler. +* +* Returns 0 on success, or -EBUSY if an IRQ handler has already been +* registered. +*/ +int __init set_handle_irq (void (*handle_irq)(struct pt_regs *)); + +/* +* Allows interrupt handlers to find the irqchip that's been registered as the +* top-level IRQ handler. +*/ +extern void (*handle_arch_irq)(struct pt_regs *)__ro_after_init ; +#endif +#endif /* _LINUX_IRQ_H */
kernel/irq/Kconfig +5 -0
@@ -132,3 +132,8 @@ config GENERIC_IRQ_DEBUGFS If you don't know what to do here, say N. endmenu + +config GENERIC_IRQ_MULTI_HANDLER + bool + help + Allow to specify the low level IRQ handler at run time.
kernel/irq/handle.c +15 -0
@@ -20,6 +20,10 @@#include "internals.h" +#ifdef CONFIG_GENERIC_IRQ_MULTI_HANDLER +void (*handle_arch_irq)(struct pt_regs *)__ro_after_init ; +#endif +/** * handle_bad_irq - handle spurious and unhandled irqs * @desc: description of the interrupt
@@ -207,3 +211,14 @@ irqreturn_t handle_irq_event(struct irq_desc *desc)irqd_clear (&desc->irq_data,IRQD_IRQ_INPROGRESS );return ret; } + +#ifdef CONFIG_GENERIC_IRQ_MULTI_HANDLER +int __init set_handle_irq (void (*handle_irq)(struct pt_regs *)) +{ +if (handle_arch_irq) +return -EBUSY ; + + handle_arch_irq = handle_irq; +return 0 ; +} +#endif
PATCH v3 2/5 RISC-V: Move to the new GENERIC_IRQ_MULTI_HANDLER handler
In reply to Palmer DabbeltThe old mechanism for handling IRQs on RISC-V was pretty ugly: the arch code looked at the Kconfig entry for our first-level irqchip driver and called into it directly.
This patch uses the new generic IRQ handling infastructure, which essentially just deletes a bunch of code. This does add an additional load to the interrupt latency, but there's a lot of tuning left to be done there on RISC-V so I think it's OK for now.
--- arch/riscv/Kconfig | 1 + arch/riscv/include/asm/Kbuild | 1 + arch/riscv/kernel/entry.S | 7 +++---- arch/riscv/kernel/irq.c | 13 ------------- 4 files changed, 5 insertions(+), 17 deletions(-)
arch/riscv/Kconfig +1 -0
@@ -33,6 +33,7 @@ config RISCV select MODULES_USE_ELF_RELA if MODULES select THREAD_INFO_IN_TASK select RISCV_TIMER + select GENERIC_IRQ_MULTI_HANDLER config MMU def_bool y
arch/riscv/include/asm/Kbuild +1 -0
@@ -15,6 +15,7 @@ generic-y += fcntl.h generic-y += futex.h generic-y += hardirq.h generic-y += hash.h +generic-y += handle_irq.h generic-y += hw_irq.h generic-y += ioctl.h generic-y += ioctls.h
arch/riscv/kernel/entry.S +3 -4
@@ -167,10 +167,9 @@ ENTRY(handle_exception) bge s4, zero, 1f /* Handle interrupts */ - slli a0, s4, 1 - srli a0, a0, 1 - move a1, sp /* pt_regs */ - tail do_IRQ + move a0, sp /* pt_regs */ + REG_L a1, handle_arch_irq + jr a1 1: /* Exceptions run with interrupts enabled */ csrs sstatus, SR_SIE
arch/riscv/kernel/irq.c +0 -13
@@ -24,16 +24,3 @@ void __init init_IRQ(void) {irqchip_init (); } - -asmlinkage void __irq_entry do_IRQ(unsigned int cause, struct pt_regs *regs) -{ -#ifdef CONFIG_RISCV_INTC -/* -* FIXME: We don't want a direct call to riscv_intc_irq here. The plan -* is to put an IRQ domain here and let the interrupt controller -* register with that, but I poked around the arm64 code a bit and -* there might be a better way to do it (ie, something fully generic). -*/ -riscv_intc_irq (cause, regs); -#endif -}
Signature · 1 line
2.16.1
tip-bot for Palmer Dabbelt
merge bot[tip:irq/core] RISC-V: Move to the new GENERIC_IRQ_MULTI_HANDLER handler
RISC-V: Move to the new GENERIC_IRQ_MULTI_HANDLER handler
Commit-ID: cc6c98485f8e61fb3d6c51821fc75384e5a3a9c3 Gitweb: https://git.kernel.org/tip/cc6c98485f8e61fb3d6c51821fc75384e5a3a9c3 Author: Palmer Dabbelt <[email protected]> AuthorDate: Wed, 7 Mar 2018 15:57:28 -0800 Committer: Thomas Gleixner <[email protected]> CommitDate: Wed, 14 Mar 2018 21:46:29 +0100
RISC-V: Move to the new GENERIC_IRQ_MULTI_HANDLER handler
The existing mechanism for handling IRQs on RISC-V is pretty ugly: the irq entry code selects the handler via Kconfig dependencies.
Use the new generic IRQ handling infastructure, which allows boot time registration of the low level entry handler.
This does add an additional load to the interrupt latency, but there's a lot of tuning left to be done there on RISC-V so it's OK for now.
--- arch/riscv/Kconfig | 1 + arch/riscv/include/asm/Kbuild | 1 + arch/riscv/kernel/entry.S | 7 +++---- arch/riscv/kernel/irq.c | 13 ------------- 4 files changed, 5 insertions(+), 17 deletions(-)
arch/riscv/Kconfig +1 -0
@@ -33,6 +33,7 @@ config RISCV select MODULES_USE_ELF_RELA if MODULES select THREAD_INFO_IN_TASK select RISCV_TIMER + select GENERIC_IRQ_MULTI_HANDLER config MMU def_bool y
arch/riscv/include/asm/Kbuild +1 -0
@@ -15,6 +15,7 @@ generic-y += fcntl.h generic-y += futex.h generic-y += hardirq.h generic-y += hash.h +generic-y += handle_irq.h generic-y += hw_irq.h generic-y += ioctl.h generic-y += ioctls.h
arch/riscv/kernel/entry.S +3 -4
@@ -167,10 +167,9 @@ ENTRY(handle_exception) bge s4, zero, 1f /* Handle interrupts */ - slli a0, s4, 1 - srli a0, a0, 1 - move a1, sp /* pt_regs */ - tail do_IRQ + move a0, sp /* pt_regs */ + REG_L a1, handle_arch_irq + jr a1 1: /* Exceptions run with interrupts enabled */ csrs sstatus, SR_SIE
arch/riscv/kernel/irq.c +0 -13
@@ -24,16 +24,3 @@ void __init init_IRQ(void) {irqchip_init (); } - -asmlinkage void __irq_entry do_IRQ(unsigned int cause, struct pt_regs *regs) -{ -#ifdef CONFIG_RISCV_INTC -/* -* FIXME: We don't want a direct call to riscv_intc_irq here. The plan -* is to put an IRQ domain here and let the interrupt controller -* register with that, but I poked around the arm64 code a bit and -* there might be a better way to do it (ie, something fully generic). -*/ -riscv_intc_irq (cause, regs); -#endif -}
PATCH v3 3/5 arm: Convert to GENERIC_IRQ_MULTI_HANDLER
In reply to Palmer DabbeltThis converts the ARM port to use the recently added GENERIC_IRQ_MULTI_HANDLER, which is essentially just a copy of ARM's existhing MULTI_IRQ_HANDLER. The only changes are:
* handle_arch_irq is now defined in a generic C file instead of an arm-specific assembly file.
* handle_arch_irq is not marked as __ro_after_init.
--- arch/arm/Kconfig | 19 +++++++------------ arch/arm/include/asm/irq.h | 5 ----- arch/arm/include/asm/mach/arch.h | 2 +- arch/arm/kernel/entry-armv.S | 10 ++-------- arch/arm/kernel/irq.c | 10 ---------- arch/arm/kernel/setup.c | 2 +- 6 files changed, 11 insertions(+), 37 deletions(-)
arch/arm/Kconfig +7 -12
@@ -339,8 +339,8 @@ config ARCH_MULTIPLATFORM select TIMER_OF select COMMON_CLK select GENERIC_CLOCKEVENTS + select GENERIC_IRQ_MULTI_HANDLER select MIGHT_HAVE_PCI - select MULTI_IRQ_HANDLER select PCI_DOMAINS if PCI select SPARSE_IRQ select USE_OF
@@ -467,9 +467,9 @@ config ARCH_DOVE bool "Marvell Dove" select CPU_PJ4 select GENERIC_CLOCKEVENTS + select GENERIC_IRQ_MULTI_HANDLER select GPIOLIB select MIGHT_HAVE_PCI - select MULTI_IRQ_HANDLER select MVEBU_MBUS select PINCTRL select PINCTRL_DOVE
@@ -514,8 +514,8 @@ config ARCH_LPC32XX select COMMON_CLK select CPU_ARM926T select GENERIC_CLOCKEVENTS + select GENERIC_IRQ_MULTI_HANDLER select GPIOLIB - select MULTI_IRQ_HANDLER select SPARSE_IRQ select USE_OF help
@@ -534,11 +534,11 @@ config ARCH_PXA select TIMER_OF select CPU_XSCALE if !CPU_XSC3 select GENERIC_CLOCKEVENTS + select GENERIC_IRQ_MULTI_HANDLER select GPIO_PXA select GPIOLIB select HAVE_IDE select IRQ_DOMAIN - select MULTI_IRQ_HANDLER select PLAT_PXA select SPARSE_IRQ help
@@ -574,11 +574,11 @@ config ARCH_SA1100 select CPU_FREQ select CPU_SA1100 select GENERIC_CLOCKEVENTS + select GENERIC_IRQ_MULTI_HANDLER select GPIOLIB select HAVE_IDE select IRQ_DOMAIN select ISA - select MULTI_IRQ_HANDLER select NEED_MACH_MEMORY_H select SPARSE_IRQ help
@@ -592,10 +592,10 @@ config ARCH_S3C24XX select GENERIC_CLOCKEVENTS select GPIO_SAMSUNG select GPIOLIB + select GENERIC_IRQ_MULTI_HANDLER select HAVE_S3C2410_I2C if I2C select HAVE_S3C2410_WATCHDOG if WATCHDOG select HAVE_S3C_RTC if RTC_CLASS - select MULTI_IRQ_HANDLER select NEED_MACH_IO_H select SAMSUNG_ATAGS select USE_OF
@@ -629,10 +629,10 @@ config ARCH_OMAP1 select CLKSRC_MMIO select GENERIC_CLOCKEVENTS select GENERIC_IRQ_CHIP + select GENERIC_IRQ_MULTI_HANDLER select GPIOLIB select HAVE_IDE select IRQ_DOMAIN - select MULTI_IRQ_HANDLER select NEED_MACH_IO_H if PCCARD select NEED_MACH_MEMORY_H select SPARSE_IRQ
@@ -921,11 +921,6 @@ config IWMMXT Enable support for iWMMXt context switching at run time if running on a CPU that supports it. -config MULTI_IRQ_HANDLER - bool - help - Allow each machine to specify it's own IRQ handler at run time. - if !MMU source "arch/arm/Kconfig-nommu" endif
arch/arm/include/asm/irq.h +0 -5
@@ -31,11 +31,6 @@ extern void asm_do_IRQ(unsigned int, struct pt_regs *);void handle_IRQ (unsigned int ,struct pt_regs *);void init_IRQ (void ); -#ifdef CONFIG_MULTI_IRQ_HANDLER -extern void (*handle_arch_irq)(struct pt_regs *); -extern void set_handle_irq (void (*handle_irq)(struct pt_regs *)); -#endif -#ifdef CONFIG_SMP extern void arch_trigger_cpumask_backtrace (const cpumask_t *mask,bool exclude_self);
arch/arm/include/asm/mach/arch.h +1 -1
@@ -59,7 +59,7 @@ struct machine_desc {void (*init_time)(void );void (*init_machine)(void );void (*init_late)(void ); -#ifdef CONFIG_MULTI_IRQ_HANDLER +#ifdef CONFIG_GENERIC_IRQ_MULTI_HANDLER void (*handle_irq)(struct pt_regs *);#endif void (*restart)(enum reboot_mode ,const char *);
arch/arm/kernel/entry-armv.S +2 -8
@@ -22,7 +22,7 @@ #include <asm/glue-df.h> #include <asm/glue-pf.h> #include <asm/vfpmacros.h> -#ifndef CONFIG_MULTI_IRQ_HANDLER +#ifndef CONFIG_GENERIC_IRQ_MULTI_HANDLER #include <mach/entry-macro.S> #endif #include <asm/thread_notify.h>
@@ -39,7 +39,7 @@ * Interrupt handling. */ .macro irq_handler -#ifdef CONFIG_MULTI_IRQ_HANDLER +#ifdef CONFIG_GENERIC_IRQ_MULTI_HANDLER ldr r1, =handle_arch_irq mov r0, sp badr lr, 9997f
@@ -1226,9 +1226,3 @@ vector_addrexcptn: .globl cr_alignment cr_alignment: .space 4 - -#ifdef CONFIG_MULTI_IRQ_HANDLER - .globl handle_arch_irq -handle_arch_irq: - .space 4 -#endif
arch/arm/kernel/irq.c +0 -10
@@ -102,16 +102,6 @@ void __init init_IRQ(void)uniphier_cache_init (); } -#ifdef CONFIG_MULTI_IRQ_HANDLER -void __init set_handle_irq (void (*handle_irq)(struct pt_regs *)) -{ -if (handle_arch_irq) -return ; - - handle_arch_irq = handle_irq; -} -#endif -#ifdef CONFIG_SPARSE_IRQ int __init arch_probe_nr_irqs (void ) {
arch/arm/kernel/setup.c +1 -1
@@ -1145,7 +1145,7 @@ void __init setup_arch(char **cmdline_p)reserve_crashkernel (); -#ifdef CONFIG_MULTI_IRQ_HANDLER +#ifdef CONFIG_GENERIC_IRQ_MULTI_HANDLER handle_arch_irq = mdesc->handle_irq;#endif
Signature · 1 line
2.16.1
Re: [PATCH v3 3/5] arm: Convert to GENERIC_IRQ_MULTI_HANDLER
Quoted 7 lines · Palmer Dabbelt
This converts the ARM port to use the recently added
GENERIC_IRQ_MULTI_HANDLER, which is essentially just a copy of ARM's existhingMULTI_IRQ_HANDLER. The only changes are:*
handle_arch_irqis now defined in a generic C file instead of an arm-specific assembly file.
*handle_arch_irqis not marked as__ro_after_init.
Why? What prevents the generic implementation from doing so?
Thanks,
tglx
Re: [PATCH v3 3/5] arm: Convert to GENERIC_IRQ_MULTI_HANDLER
Quoted 11 lines · tglx at linutronix.de
Quoted 7 lines · Palmer Dabbelt
This converts the ARM port to use the recently added
GENERIC_IRQ_MULTI_HANDLER, which is essentially just a copy of ARM's existhingMULTI_IRQ_HANDLER. The only changes are:*
handle_arch_irqis now defined in a generic C file instead of an arm-specific assembly file.
*handle_arch_irqis not marked as__ro_after_init.Why? What prevents the generic implementation from doing so?
Sorry, I guess that should have said "handle_arch_irq was not marked as __ro_after_init". The patch set has __ro_after_init for the generic implementation, which was not the case for the arm version.
Re: [PATCH v3 3/5] arm: Convert to GENERIC_IRQ_MULTI_HANDLER
Quoted 11 lines · Palmer Dabbelt
Quoted 10 lines · tglx at linutronix.de
Quoted 7 lines · Palmer Dabbelt
This converts the ARM port to use the recently added
GENERIC_IRQ_MULTI_HANDLER, which is essentially just a copy of ARM's existhingMULTI_IRQ_HANDLER. The only changes are:*
handle_arch_irqis now defined in a generic C file instead of an arm-specific assembly file.
*handle_arch_irqis not marked as__ro_after_init.
Quoted 5 lines
Quoted 1 line
Why? What prevents the generic implementation from doing so?
Sorry, I guess that should have said "
handle_arch_irqwas not marked as__ro_after_init". The patch set has__ro_after_initfor the generic implementation, which was not the case for the arm version.
That makes sense.... I'll fix that up.
Thanks,
tglx
tip-bot for Palmer Dabbelt
merge bot[tip:irq/core] ARM: irq: Convert to GENERIC_IRQ_MULTI_HANDLER
In reply to Palmer DabbeltARM: irq: Convert to GENERIC_IRQ_MULTI_HANDLER
Commit-ID: 886d70aac148f6015ae3d1379c81b98af3e70981 Gitweb: https://git.kernel.org/tip/886d70aac148f6015ae3d1379c81b98af3e70981 Author: Palmer Dabbelt <[email protected]> AuthorDate: Wed, 7 Mar 2018 15:57:29 -0800 Committer: Thomas Gleixner <[email protected]> CommitDate: Wed, 14 Mar 2018 21:46:29 +0100
ARM: irq: Convert to GENERIC_IRQ_MULTI_HANDLER
Convert ARM to use the recently added GENERIC_IRQ_MULTI_HANDLER, which is essentially just a copy of ARM's existhing MULTI_IRQ_HANDLER. The only changes are:
* handle_arch_irq is now defined in a generic C file instead of an arm-specific assembly file.
* handle_arch_irq is now marked as __ro_after_init which is not an issue as the setup function is marked __init already.
--- arch/arm/Kconfig | 19 +++++++------------ arch/arm/include/asm/irq.h | 5 ----- arch/arm/include/asm/mach/arch.h | 2 +- arch/arm/kernel/entry-armv.S | 10 ++-------- arch/arm/kernel/irq.c | 10 ---------- arch/arm/kernel/setup.c | 2 +- 6 files changed, 11 insertions(+), 37 deletions(-)
arch/arm/Kconfig +7 -12
@@ -339,8 +339,8 @@ config ARCH_MULTIPLATFORM select TIMER_OF select COMMON_CLK select GENERIC_CLOCKEVENTS + select GENERIC_IRQ_MULTI_HANDLER select MIGHT_HAVE_PCI - select MULTI_IRQ_HANDLER select PCI_DOMAINS if PCI select SPARSE_IRQ select USE_OF
@@ -467,9 +467,9 @@ config ARCH_DOVE bool "Marvell Dove" select CPU_PJ4 select GENERIC_CLOCKEVENTS + select GENERIC_IRQ_MULTI_HANDLER select GPIOLIB select MIGHT_HAVE_PCI - select MULTI_IRQ_HANDLER select MVEBU_MBUS select PINCTRL select PINCTRL_DOVE
@@ -514,8 +514,8 @@ config ARCH_LPC32XX select COMMON_CLK select CPU_ARM926T select GENERIC_CLOCKEVENTS + select GENERIC_IRQ_MULTI_HANDLER select GPIOLIB - select MULTI_IRQ_HANDLER select SPARSE_IRQ select USE_OF help
@@ -534,11 +534,11 @@ config ARCH_PXA select TIMER_OF select CPU_XSCALE if !CPU_XSC3 select GENERIC_CLOCKEVENTS + select GENERIC_IRQ_MULTI_HANDLER select GPIO_PXA select GPIOLIB select HAVE_IDE select IRQ_DOMAIN - select MULTI_IRQ_HANDLER select PLAT_PXA select SPARSE_IRQ help
@@ -574,11 +574,11 @@ config ARCH_SA1100 select CPU_FREQ select CPU_SA1100 select GENERIC_CLOCKEVENTS + select GENERIC_IRQ_MULTI_HANDLER select GPIOLIB select HAVE_IDE select IRQ_DOMAIN select ISA - select MULTI_IRQ_HANDLER select NEED_MACH_MEMORY_H select SPARSE_IRQ help
@@ -592,10 +592,10 @@ config ARCH_S3C24XX select GENERIC_CLOCKEVENTS select GPIO_SAMSUNG select GPIOLIB + select GENERIC_IRQ_MULTI_HANDLER select HAVE_S3C2410_I2C if I2C select HAVE_S3C2410_WATCHDOG if WATCHDOG select HAVE_S3C_RTC if RTC_CLASS - select MULTI_IRQ_HANDLER select NEED_MACH_IO_H select SAMSUNG_ATAGS select USE_OF
@@ -629,10 +629,10 @@ config ARCH_OMAP1 select CLKSRC_MMIO select GENERIC_CLOCKEVENTS select GENERIC_IRQ_CHIP + select GENERIC_IRQ_MULTI_HANDLER select GPIOLIB select HAVE_IDE select IRQ_DOMAIN - select MULTI_IRQ_HANDLER select NEED_MACH_IO_H if PCCARD select NEED_MACH_MEMORY_H select SPARSE_IRQ
@@ -921,11 +921,6 @@ config IWMMXT Enable support for iWMMXt context switching at run time if running on a CPU that supports it. -config MULTI_IRQ_HANDLER - bool - help - Allow each machine to specify it's own IRQ handler at run time. - if !MMU source "arch/arm/Kconfig-nommu" endif
arch/arm/include/asm/irq.h +0 -5
@@ -31,11 +31,6 @@ extern void asm_do_IRQ(unsigned int, struct pt_regs *);void handle_IRQ (unsigned int ,struct pt_regs *);void init_IRQ (void ); -#ifdef CONFIG_MULTI_IRQ_HANDLER -extern void (*handle_arch_irq)(struct pt_regs *); -extern void set_handle_irq (void (*handle_irq)(struct pt_regs *)); -#endif -#ifdef CONFIG_SMP extern void arch_trigger_cpumask_backtrace (const cpumask_t *mask,bool exclude_self);
arch/arm/include/asm/mach/arch.h +1 -1
@@ -59,7 +59,7 @@ struct machine_desc {void (*init_time)(void );void (*init_machine)(void );void (*init_late)(void ); -#ifdef CONFIG_MULTI_IRQ_HANDLER +#ifdef CONFIG_GENERIC_IRQ_MULTI_HANDLER void (*handle_irq)(struct pt_regs *);#endif void (*restart)(enum reboot_mode ,const char *);
arch/arm/kernel/entry-armv.S +2 -8
@@ -22,7 +22,7 @@ #include <asm/glue-df.h> #include <asm/glue-pf.h> #include <asm/vfpmacros.h> -#ifndef CONFIG_MULTI_IRQ_HANDLER +#ifndef CONFIG_GENERIC_IRQ_MULTI_HANDLER #include <mach/entry-macro.S> #endif #include <asm/thread_notify.h>
@@ -39,7 +39,7 @@ * Interrupt handling. */ .macro irq_handler -#ifdef CONFIG_MULTI_IRQ_HANDLER +#ifdef CONFIG_GENERIC_IRQ_MULTI_HANDLER ldr r1, =handle_arch_irq mov r0, sp badr lr, 9997f
@@ -1226,9 +1226,3 @@ vector_addrexcptn: .globl cr_alignment cr_alignment: .space 4 - -#ifdef CONFIG_MULTI_IRQ_HANDLER - .globl handle_arch_irq -handle_arch_irq: - .space 4 -#endif
arch/arm/kernel/irq.c +0 -10
@@ -102,16 +102,6 @@ void __init init_IRQ(void)uniphier_cache_init (); } -#ifdef CONFIG_MULTI_IRQ_HANDLER -void __init set_handle_irq (void (*handle_irq)(struct pt_regs *)) -{ -if (handle_arch_irq) -return ; - - handle_arch_irq = handle_irq; -} -#endif -#ifdef CONFIG_SPARSE_IRQ int __init arch_probe_nr_irqs (void ) {
arch/arm/kernel/setup.c +1 -1
@@ -1145,7 +1145,7 @@ void __init setup_arch(char **cmdline_p)reserve_crashkernel (); -#ifdef CONFIG_MULTI_IRQ_HANDLER +#ifdef CONFIG_GENERIC_IRQ_MULTI_HANDLER handle_arch_irq = mdesc->handle_irq;#endif
PATCH v3 4/5 arm64: Use the new GENERIC_IRQ_MULTI_HANDLER
In reply to Palmer DabbeltIt appears arm64 copied arm's GENERIC_IRQ_MULTI_HANDLER code, but made it unconditional. I wanted to make this generic so it could be used by the RISC-V port. This patch converts the arm64 code to use the new generic code, which simply consists of deleting the arm64 code and setting MULTI_IRQ_HANDLER instead.
--- arch/arm64/Kconfig | 1 + arch/arm64/include/asm/irq.h | 2 -- arch/arm64/kernel/irq.c | 10 ---------- 3 files changed, 1 insertion(+), 12 deletions(-)
arch/arm64/Kconfig +1 -0
@@ -132,6 +132,7 @@ config ARM64 select IRQ_DOMAIN select IRQ_FORCED_THREADING select MODULES_USE_ELF_RELA + select GENERIC_IRQ_MULTI_HANDLER select NO_BOOTMEM select OF select OF_EARLY_FLATTREE
arch/arm64/include/asm/irq.h +0 -2
@@ -8,8 +8,6 @@struct pt_regs ; -extern void set_handle_irq (void (*handle_irq)(struct pt_regs *)); -static inline int nr_legacy_irqs (void ) {return 0 ;
arch/arm64/kernel/irq.c +0 -10
@@ -42,16 +42,6 @@ int arch_show_interrupts(struct seq_file *p, int prec)return 0 ; } -void (*handle_arch_irq)(struct pt_regs *) =NULL ; - -void __init set_handle_irq (void (*handle_irq)(struct pt_regs *)) -{ -if (handle_arch_irq) -return ; - - handle_arch_irq = handle_irq; -} -#ifdef CONFIG_VMAP_STACK static void init_irq_stacks (void ) {
Signature · 1 line
2.16.1
tip-bot for Palmer Dabbelt
merge bot[tip:irq/core] arm64: Use the new GENERIC_IRQ_MULTI_HANDLER
arm64: Use the new GENERIC_IRQ_MULTI_HANDLER
Commit-ID: ec38432a7e84bb614401788ec03c6f05e7915832 Gitweb: https://git.kernel.org/tip/ec38432a7e84bb614401788ec03c6f05e7915832 Author: Palmer Dabbelt <[email protected]> AuthorDate: Wed, 7 Mar 2018 15:57:30 -0800 Committer: Thomas Gleixner <[email protected]> CommitDate: Wed, 14 Mar 2018 21:46:30 +0100
arm64: Use the new GENERIC_IRQ_MULTI_HANDLER
It appears arm64 copied arm's GENERIC_IRQ_MULTI_HANDLER code, but made it unconditional.
Convert the arm64 code to use the new generic code, which simply consists of deleting the arm64 code and setting GENERIC_MULTI_IRQ_HANDLER instead.
--- arch/arm64/Kconfig | 1 + arch/arm64/include/asm/irq.h | 2 -- arch/arm64/kernel/irq.c | 10 ---------- 3 files changed, 1 insertion(+), 12 deletions(-)
arch/arm64/Kconfig +1 -0
@@ -132,6 +132,7 @@ config ARM64 select IRQ_DOMAIN select IRQ_FORCED_THREADING select MODULES_USE_ELF_RELA + select GENERIC_IRQ_MULTI_HANDLER select NO_BOOTMEM select OF select OF_EARLY_FLATTREE
arch/arm64/include/asm/irq.h +0 -2
@@ -8,8 +8,6 @@struct pt_regs ; -extern void set_handle_irq (void (*handle_irq)(struct pt_regs *)); -static inline int nr_legacy_irqs (void ) {return 0 ;
arch/arm64/kernel/irq.c +0 -10
@@ -42,16 +42,6 @@ int arch_show_interrupts(struct seq_file *p, int prec)return 0 ; } -void (*handle_arch_irq)(struct pt_regs *) =NULL ; - -void __init set_handle_irq (void (*handle_irq)(struct pt_regs *)) -{ -if (handle_arch_irq) -return ; - - handle_arch_irq = handle_irq; -} -#ifdef CONFIG_VMAP_STACK static void init_irq_stacks (void ) {
PATCH v3 5/5 openrisc: Use the new GENERIC_IRQ_MULTI_HANDLER
In reply to Palmer DabbeltIt appears that openrisc copied arm64's GENERIC_IRQ_MULTI_HANDLER code (which came from arm). I wanted to make this generic so I could use it in the RISC-V port. This patch converts the openrisc code to use the generic version.
--- arch/openrisc/Kconfig | 1 + arch/openrisc/kernel/irq.c | 7 ------- 2 files changed, 1 insertion(+), 7 deletions(-)
arch/openrisc/Kconfig +1 -0
@@ -35,6 +35,7 @@ config OPENRISC select ARCH_USE_QUEUED_RWLOCKS select OMPIC if SMP select ARCH_WANT_FRAME_POINTERS + select GENERIC_IRQ_MULTI_HANDLER config CPU_BIG_ENDIAN def_bool y
arch/openrisc/kernel/irq.c +0 -7
@@ -41,13 +41,6 @@ void __init init_IRQ(void)irqchip_init (); } -static void (*handle_arch_irq)(struct pt_regs *); - -void __init set_handle_irq (void (*handle_irq)(struct pt_regs *)) -{ - handle_arch_irq = handle_irq; -} - void __irq_entry do_IRQ(struct pt_regs *regs) {handle_arch_irq (regs);
Signature · 1 line
2.16.1
PATCH v4 1/1 openrisc: Use the new GENERIC_IRQ_MULTI_HANDLER
It appears that openrisc copied arm64's GENERIC_IRQ_MULTI_HANDLER code (which came from arm). I wanted to make this generic so I could use it in the RISC-V port. This patch converts the openrisc code to use the generic version.
--- arch/openrisc/Kconfig | 1 + arch/openrisc/include/asm/irq.h | 2 -- arch/openrisc/kernel/irq.c | 7 ------- 3 files changed, 1 insertion(+), 9 deletions(-)
arch/openrisc/Kconfig +1 -0
@@ -35,6 +35,7 @@ config OPENRISC select ARCH_USE_QUEUED_RWLOCKS select OMPIC if SMP select ARCH_WANT_FRAME_POINTERS + select GENERIC_IRQ_MULTI_HANDLER config CPU_BIG_ENDIAN def_bool y
arch/openrisc/include/asm/irq.h +0 -2
@@ -24,6 +24,4 @@#define NO_IRQ (-1) -extern void set_handle_irq (void (*handle_irq)(struct pt_regs *)); -#endif /* __ASM_OPENRISC_IRQ_H__ */
arch/openrisc/kernel/irq.c +0 -7
@@ -41,13 +41,6 @@ void __init init_IRQ(void)irqchip_init (); } -static void (*handle_arch_irq)(struct pt_regs *); - -void __init set_handle_irq (void (*handle_irq)(struct pt_regs *)) -{ - handle_arch_irq = handle_irq; -} - void __irq_entry do_IRQ(struct pt_regs *regs) {handle_arch_irq (regs);
Signature · 1 line
2.16.1
tip-bot for Palmer Dabbelt
merge bot[tip:irq/core] openrisc: Use the new GENERIC_IRQ_MULTI_HANDLER
openrisc: Use the new GENERIC_IRQ_MULTI_HANDLER
Commit-ID: d9af5838180359c6be1c07989c91b28eee93d7e7 Gitweb: https://git.kernel.org/tip/d9af5838180359c6be1c07989c91b28eee93d7e7 Author: Palmer Dabbelt <[email protected]> AuthorDate: Mon, 12 Mar 2018 11:44:29 -0700 Committer: Thomas Gleixner <[email protected]> CommitDate: Wed, 14 Mar 2018 21:46:30 +0100
openrisc: Use the new GENERIC_IRQ_MULTI_HANDLER
It appears that openrisc copied arm64's irq multi handler code (which came from arm).
Convert it to use the generic version.
--- arch/openrisc/Kconfig | 1 + arch/openrisc/include/asm/irq.h | 2 -- arch/openrisc/kernel/irq.c | 7 ------- 3 files changed, 1 insertion(+), 9 deletions(-)
arch/openrisc/Kconfig +1 -0
@@ -35,6 +35,7 @@ config OPENRISC select ARCH_USE_QUEUED_RWLOCKS select OMPIC if SMP select ARCH_WANT_FRAME_POINTERS + select GENERIC_IRQ_MULTI_HANDLER config CPU_BIG_ENDIAN def_bool y
arch/openrisc/include/asm/irq.h +0 -2
@@ -24,6 +24,4 @@#define NO_IRQ (-1) -extern void set_handle_irq (void (*handle_irq)(struct pt_regs *)); -#endif /* __ASM_OPENRISC_IRQ_H__ */
arch/openrisc/kernel/irq.c +0 -7
@@ -41,13 +41,6 @@ void __init init_IRQ(void)irqchip_init (); } -static void (*handle_arch_irq)(struct pt_regs *); - -void __init set_handle_irq (void (*handle_irq)(struct pt_regs *)) -{ - handle_arch_irq = handle_irq; -} - void __irq_entry do_IRQ(struct pt_regs *regs) {handle_arch_irq (regs);
Quoted 16 lines · Palmer Dabbelt
This is my third version of this patch set, but the original cover letter is still the most relevant description I can come up with.
This patch set has been sitting around for a while, but it got a bit lost in the shuffle. In RISC-V land we currently couple
do_IRQ(the C entry point for interrupt handling) to our first-level interrupt controller. While this isn't completely crazy (as the first-level interrupt controller is specified by the ISA), it is a bit awkward.This patch set decouples our trap handler from our first-level IRQ chip driver by copying what a handful of other architectures are doing. This does add an additional load to the interrupt handling path, but there's a handful of performance problems in there that I've been meaning to look at so I don't mind adding another one for now. The advantage is that our irqchip driver is decoupled from our arch port, at least at compile time.
Quoted 4 lines
I've build tested this with defconfigs on all the modified architectures after both patch 1 and 5. I've left the old acks in for the later patches as the patch set has changed very little since I last submitted it.
This looks sensible. We have two options for getting this merged:
1) I'll take the whole lot through tip/irq/core
2) I'll apply patch 1/N to a special branch in tip. That branch will contain
only this commit on top of 4.16-rc4 and can be pulled by the relevant architecture maintainers, so they can apply their architecture specific patches.
Please let me know how you want to proceed.
Thanks,
tglx
Quoted 23 lines · tglx at linutronix.de
Quoted 16 lines · Palmer Dabbelt
This is my third version of this patch set, but the original cover letter is still the most relevant description I can come up with.
This patch set has been sitting around for a while, but it got a bit lost in the shuffle. In RISC-V land we currently couple
do_IRQ(the C entry point for interrupt handling) to our first-level interrupt controller. While this isn't completely crazy (as the first-level interrupt controller is specified by the ISA), it is a bit awkward.This patch set decouples our trap handler from our first-level IRQ chip driver by copying what a handful of other architectures are doing. This does add an additional load to the interrupt handling path, but there's a handful of performance problems in there that I've been meaning to look at so I don't mind adding another one for now. The advantage is that our irqchip driver is decoupled from our arch port, at least at compile time.
Quoted 4 lines
I've build tested this with defconfigs on all the modified architectures after both patch 1 and 5. I've left the old acks in for the later patches as the patch set has changed very little since I last submitted it.
Quoted 8 lines
This looks sensible. We have two options for getting this merged:
1) I'll take the whole lot through tip/irq/core
2) I'll apply patch 1/N to a special branch in tip. That branch will contain
only this commit on top of 4.16-rc4 and can be pulled by the relevant architecture maintainers, so they can apply their architecture specific patches.
Option 1 seems like the lowest overhead, as that way we don't need to sequence the patches between multiple trees. If all the other arch maintianers are OK with it then that works for me. The 0-day robot found a new build warning on openrisc. I was plannning on submitting a v4 with this fix in it
diff --git a/arch/openrisc/include/asm/irq.h b/arch/openrisc/include/asm/irq.h
index d9eee0a2b7b4..eb612b1865d2 100644
--- a/arch/openrisc/include/asm/irq.h
+++ b/arch/openrisc/include/asm/irq.h
@@ -24,6 +24,4 @@
#define NO_IRQ (-1)
-extern void set_handle_irq(void (*handle_irq)(struct pt_regs *));
-
#endif /* __ASM_OPENRISC_IRQ_H__ */I can submit a v4, or you can just grab it from
https://git.kernel.org/pub/scm/linux/kernel/git/palmer/linux.git/log/?h=review-irq-1-cleanup
Thanks!
Quoted 11 lines · Palmer Dabbelt
Quoted 9 lines · tglx at linutronix.de
This looks sensible. We have two options for getting this merged:
1) I'll take the whole lot through tip/irq/core
2) I'll apply patch 1/N to a special branch in tip. That branch will
contain
only this commit on top of 4.16-rc4 and can be pulled by the relevant architecture maintainers, so they can apply their architecture specific patches.
Quoted 3 lines
Option 1 seems like the lowest overhead, as that way we don't need to sequence the patches between multiple trees. If all the other arch maintianers are OK with it then that works for me.
Ok, I wait for someone to yell NO until tuesday. If that doesn't happen I pick it up.
Quoted 9 lines
The 0-day robot found a new build warning on openrisc. I was plannning on submitting a v4 with this fix in it
diff --git a/arch/openrisc/include/asm/irq.h
b/arch/openrisc/include/asm/irq.h
indexd9eee0a2b7b4..eb612b1865d2100644
---a/arch/openrisc/include/asm/irq.h
+++b/arch/openrisc/include/asm/irq.h
@@ -24,6 +24,4 @@
Quoted 6 lines
#define NO_IRQ (-1) -extern void set_handle_irq(void (*handle_irq)(struct pt_regs *)); - #endif /* __ASM_OPENRISC_IRQ_H__ */I can submit a v4, or you can just grab it from
Just reply on the v3 openrisc patch with a v4 and I grab it from there.
Thanks,
tglx
Quoted 33 lines · tglx at linutronix.de
Quoted 11 lines · Palmer Dabbelt
Quoted 9 lines · tglx at linutronix.de
This looks sensible. We have two options for getting this merged:
1) I'll take the whole lot through tip/irq/core
2) I'll apply patch 1/N to a special branch in tip. That branch will
contain
only this commit on top of 4.16-rc4 and can be pulled by the relevant architecture maintainers, so they can apply their architecture specific patches.Quoted 3 lines
Option 1 seems like the lowest overhead, as that way we don't need to sequence the patches between multiple trees. If all the other arch maintianers are OK with it then that works for me.
Ok, I wait for someone to yell NO until tuesday. If that doesn't happen I pick it up.
Quoted 14 lines
The 0-day robot found a new build warning on openrisc. I was plannning on submitting a v4 with this fix in it
diff --git a/arch/openrisc/include/asm/irq.h
b/arch/openrisc/include/asm/irq.h
indexd9eee0a2b7b4..eb612b1865d2100644
---a/arch/openrisc/include/asm/irq.h
+++b/arch/openrisc/include/asm/irq.h
@@ -24,6 +24,4 @@#define NO_IRQ (-1) -extern void set_handle_irq(void (*handle_irq)(struct pt_regs *)); - #endif /* __ASM_OPENRISC_IRQ_H__ */
Quoted 3 lines
Quoted 1 line
I can submit a v4, or you can just grab it from
Just reply on the v3 openrisc patch with a v4 and I grab it from there.
OK, I just did -- sorry it took a while, I had to prepare for the ELC hackathon.