Message ID | 20230426085746.373956-1-linus.walleij@linaro.org |
---|---|
State | New |
Headers | show |
Series | ARM: Drop custom mdesc->handle_irq() | expand |
On Wed, Apr 26, 2023 at 10:57:46AM +0200, Linus Walleij wrote: > ARM exclusively uses GENERIC_IRQ_MULTI_HANDLER, so at some point > set_handle_irq() needs to be called to handle system-wide > interrupts. > > For all DT-enabled boards, this call happens down in the > drivers/irqchip subsystem, after locating the target irqchip > driver from the device tree. > > We still have a few instances of the boardfiles with machine > descriptors passing a machine-specific .handle_irq() to the > ARM kernel core. > > Get rid of this by letting the few remaining machines consistently > call set_handle_irq() from the end of the .init_irq() callback > instead and diet down one member from the machine descriptor. > > Cc: Marc Zyngier <maz@kernel.org> > Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Nice! Acked-by: Mark Rutland <mark.rutland@arm.com> Mark. > --- > ChanegLog v1->v2: > - Get rid of .handle_irq() from mdesc altogether. > --- > arch/arm/include/asm/mach/arch.h | 1 - > arch/arm/kernel/setup.c | 4 ---- > arch/arm/mach-mxs/mach-mxs.c | 8 +++++++- > arch/arm/mach-omap1/board-ams-delta.c | 1 - > arch/arm/mach-omap1/board-nokia770.c | 1 - > arch/arm/mach-omap1/board-osk.c | 1 - > arch/arm/mach-omap1/board-palmte.c | 1 - > arch/arm/mach-omap1/board-sx1.c | 1 - > arch/arm/mach-omap1/irq.c | 3 +++ > arch/arm/mach-pxa/gumstix.c | 1 - > arch/arm/mach-pxa/pxa25x.c | 1 + > arch/arm/mach-pxa/pxa27x.c | 1 + > arch/arm/mach-pxa/spitz.c | 3 --- > 13 files changed, 12 insertions(+), 15 deletions(-) > > diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h > index 9349e7a82c9c..2b18a258204d 100644 > --- a/arch/arm/include/asm/mach/arch.h > +++ b/arch/arm/include/asm/mach/arch.h > @@ -56,7 +56,6 @@ struct machine_desc { > void (*init_time)(void); > void (*init_machine)(void); > void (*init_late)(void); > - void (*handle_irq)(struct pt_regs *); > void (*restart)(enum reboot_mode, const char *); > }; > > diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c > index 75cd4699e7b3..0a26585f5027 100644 > --- a/arch/arm/kernel/setup.c > +++ b/arch/arm/kernel/setup.c > @@ -1198,10 +1198,6 @@ void __init setup_arch(char **cmdline_p) > > reserve_crashkernel(); > > -#ifdef CONFIG_GENERIC_IRQ_MULTI_HANDLER > - handle_arch_irq = mdesc->handle_irq; > -#endif > - > #ifdef CONFIG_VT > #if defined(CONFIG_VGA_CONSOLE) > conswitchp = &vga_con; > diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c > index 0129b7c514d7..635d5b218b04 100644 > --- a/arch/arm/mach-mxs/mach-mxs.c > +++ b/arch/arm/mach-mxs/mach-mxs.c > @@ -11,6 +11,7 @@ > #include <linux/err.h> > #include <linux/gpio.h> > #include <linux/init.h> > +#include <linux/irq.h> > #include <linux/irqchip/mxs.h> > #include <linux/reboot.h> > #include <linux/micrel_phy.h> > @@ -465,6 +466,11 @@ static void mxs_restart(enum reboot_mode mode, const char *cmd) > soft_restart(0); > } > > +static void init_irq(void) > +{ > + set_handle_irq(icoll_handle_irq); > +} > + > static const char *const mxs_dt_compat[] __initconst = { > "fsl,imx28", > "fsl,imx23", > @@ -472,7 +478,7 @@ static const char *const mxs_dt_compat[] __initconst = { > }; > > DT_MACHINE_START(MXS, "Freescale MXS (Device Tree)") > - .handle_irq = icoll_handle_irq, > + .init_irq = mxs_init_irq, > .init_machine = mxs_machine_init, > .init_late = mxs_pm_init, > .dt_compat = mxs_dt_compat, > diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c > index 0f67ac4c6fd2..700cbb296da0 100644 > --- a/arch/arm/mach-omap1/board-ams-delta.c > +++ b/arch/arm/mach-omap1/board-ams-delta.c > @@ -881,7 +881,6 @@ MACHINE_START(AMS_DELTA, "Amstrad E3 (Delta)") > .map_io = ams_delta_map_io, > .init_early = omap1_init_early, > .init_irq = omap1_init_irq, > - .handle_irq = omap1_handle_irq, > .init_machine = ams_delta_init, > .init_late = ams_delta_init_late, > .init_time = omap1_timer_init, > diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c > index a501a473ffd6..b56cea9f9d2f 100644 > --- a/arch/arm/mach-omap1/board-nokia770.c > +++ b/arch/arm/mach-omap1/board-nokia770.c > @@ -291,7 +291,6 @@ MACHINE_START(NOKIA770, "Nokia 770") > .map_io = omap1_map_io, > .init_early = omap1_init_early, > .init_irq = omap1_init_irq, > - .handle_irq = omap1_handle_irq, > .init_machine = omap_nokia770_init, > .init_late = omap1_init_late, > .init_time = omap1_timer_init, > diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c > index df758c1f9237..46eda4ff4797 100644 > --- a/arch/arm/mach-omap1/board-osk.c > +++ b/arch/arm/mach-omap1/board-osk.c > @@ -389,7 +389,6 @@ MACHINE_START(OMAP_OSK, "TI-OSK") > .map_io = omap1_map_io, > .init_early = omap1_init_early, > .init_irq = omap1_init_irq, > - .handle_irq = omap1_handle_irq, > .init_machine = osk_init, > .init_late = omap1_init_late, > .init_time = omap1_timer_init, > diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c > index f79c497f04d5..91df3dc365af 100644 > --- a/arch/arm/mach-omap1/board-palmte.c > +++ b/arch/arm/mach-omap1/board-palmte.c > @@ -259,7 +259,6 @@ MACHINE_START(OMAP_PALMTE, "OMAP310 based Palm Tungsten E") > .map_io = omap1_map_io, > .init_early = omap1_init_early, > .init_irq = omap1_init_irq, > - .handle_irq = omap1_handle_irq, > .init_machine = omap_palmte_init, > .init_late = omap1_init_late, > .init_time = omap1_timer_init, > diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c > index 0c0cdd5e77c7..3ae295af96fd 100644 > --- a/arch/arm/mach-omap1/board-sx1.c > +++ b/arch/arm/mach-omap1/board-sx1.c > @@ -338,7 +338,6 @@ MACHINE_START(SX1, "OMAP310 based Siemens SX1") > .map_io = omap1_map_io, > .init_early = omap1_init_early, > .init_irq = omap1_init_irq, > - .handle_irq = omap1_handle_irq, > .init_machine = omap_sx1_init, > .init_late = omap1_init_late, > .init_time = omap1_timer_init, > diff --git a/arch/arm/mach-omap1/irq.c b/arch/arm/mach-omap1/irq.c > index 9ccc784fd614..b64fb2ebc434 100644 > --- a/arch/arm/mach-omap1/irq.c > +++ b/arch/arm/mach-omap1/irq.c > @@ -37,6 +37,7 @@ > */ > #include <linux/gpio.h> > #include <linux/init.h> > +#include <linux/irq.h> > #include <linux/module.h> > #include <linux/sched.h> > #include <linux/interrupt.h> > @@ -253,4 +254,6 @@ void __init omap1_init_irq(void) > ct = irq_data_get_chip_type(d); > ct->chip.irq_unmask(d); > } > + > + set_handle_irq(omap1_handle_irq); > } > diff --git a/arch/arm/mach-pxa/gumstix.c b/arch/arm/mach-pxa/gumstix.c > index 72b08a9bf0fd..6b7197ae3c72 100644 > --- a/arch/arm/mach-pxa/gumstix.c > +++ b/arch/arm/mach-pxa/gumstix.c > @@ -233,7 +233,6 @@ MACHINE_START(GUMSTIX, "Gumstix") > .map_io = pxa25x_map_io, > .nr_irqs = PXA_NR_IRQS, > .init_irq = pxa25x_init_irq, > - .handle_irq = pxa25x_handle_irq, > .init_time = pxa_timer_init, > .init_machine = gumstix_init, > .restart = pxa_restart, > diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c > index 1b83be181bab..032dc897fe94 100644 > --- a/arch/arm/mach-pxa/pxa25x.c > +++ b/arch/arm/mach-pxa/pxa25x.c > @@ -143,6 +143,7 @@ static int pxa25x_set_wake(struct irq_data *d, unsigned int on) > void __init pxa25x_init_irq(void) > { > pxa_init_irq(32, pxa25x_set_wake); > + set_handle_irq(pxa25x_handle_irq); > } > > static int __init __init > diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c > index 4135ba2877c4..c9b56424b653 100644 > --- a/arch/arm/mach-pxa/pxa27x.c > +++ b/arch/arm/mach-pxa/pxa27x.c > @@ -228,6 +228,7 @@ static int pxa27x_set_wake(struct irq_data *d, unsigned int on) > void __init pxa27x_init_irq(void) > { > pxa_init_irq(34, pxa27x_set_wake); > + set_handle_irq(pxa27x_handle_irq); > } > > static int __init > diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c > index 26f0ebc4d136..688d2af0d3e2 100644 > --- a/arch/arm/mach-pxa/spitz.c > +++ b/arch/arm/mach-pxa/spitz.c > @@ -1042,7 +1042,6 @@ MACHINE_START(SPITZ, "SHARP Spitz") > .map_io = pxa27x_map_io, > .nr_irqs = PXA_NR_IRQS, > .init_irq = pxa27x_init_irq, > - .handle_irq = pxa27x_handle_irq, > .init_machine = spitz_init, > .init_time = pxa_timer_init, > .restart = spitz_restart, > @@ -1055,7 +1054,6 @@ MACHINE_START(BORZOI, "SHARP Borzoi") > .map_io = pxa27x_map_io, > .nr_irqs = PXA_NR_IRQS, > .init_irq = pxa27x_init_irq, > - .handle_irq = pxa27x_handle_irq, > .init_machine = spitz_init, > .init_time = pxa_timer_init, > .restart = spitz_restart, > @@ -1068,7 +1066,6 @@ MACHINE_START(AKITA, "SHARP Akita") > .map_io = pxa27x_map_io, > .nr_irqs = PXA_NR_IRQS, > .init_irq = pxa27x_init_irq, > - .handle_irq = pxa27x_handle_irq, > .init_machine = spitz_init, > .init_time = pxa_timer_init, > .restart = spitz_restart, > -- > 2.34.1 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
On Wed, Apr 26, 2023, at 09:57, Linus Walleij wrote: > ARM exclusively uses GENERIC_IRQ_MULTI_HANDLER, so at some point > set_handle_irq() needs to be called to handle system-wide > interrupts. > > For all DT-enabled boards, this call happens down in the > drivers/irqchip subsystem, after locating the target irqchip > driver from the device tree. > > We still have a few instances of the boardfiles with machine > descriptors passing a machine-specific .handle_irq() to the > ARM kernel core. > > Get rid of this by letting the few remaining machines consistently > call set_handle_irq() from the end of the .init_irq() callback > instead and diet down one member from the machine descriptor. > > Cc: Marc Zyngier <maz@kernel.org> > Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Looks great, but I think I found one bug: > @@ -472,7 +478,7 @@ static const char *const mxs_dt_compat[] __initconst = { > }; > > DT_MACHINE_START(MXS, "Freescale MXS (Device Tree)") > - .handle_irq = icoll_handle_irq, > + .init_irq = mxs_init_irq, I think this bit is wrong, there is aleady an icoll_of_init() function in drivers/irqchip/irq-mxs.c, overriding init_irq() will lead to that function no longer getting called, so the set_handle_irq() call should just get moved there, like it is in asm9260_of_init(). With that fixed, Reviewed-by: Arnd Bergmann <arnd@arndb.de>
diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h index 9349e7a82c9c..2b18a258204d 100644 --- a/arch/arm/include/asm/mach/arch.h +++ b/arch/arm/include/asm/mach/arch.h @@ -56,7 +56,6 @@ struct machine_desc { void (*init_time)(void); void (*init_machine)(void); void (*init_late)(void); - void (*handle_irq)(struct pt_regs *); void (*restart)(enum reboot_mode, const char *); }; diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 75cd4699e7b3..0a26585f5027 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -1198,10 +1198,6 @@ void __init setup_arch(char **cmdline_p) reserve_crashkernel(); -#ifdef CONFIG_GENERIC_IRQ_MULTI_HANDLER - handle_arch_irq = mdesc->handle_irq; -#endif - #ifdef CONFIG_VT #if defined(CONFIG_VGA_CONSOLE) conswitchp = &vga_con; diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c index 0129b7c514d7..635d5b218b04 100644 --- a/arch/arm/mach-mxs/mach-mxs.c +++ b/arch/arm/mach-mxs/mach-mxs.c @@ -11,6 +11,7 @@ #include <linux/err.h> #include <linux/gpio.h> #include <linux/init.h> +#include <linux/irq.h> #include <linux/irqchip/mxs.h> #include <linux/reboot.h> #include <linux/micrel_phy.h> @@ -465,6 +466,11 @@ static void mxs_restart(enum reboot_mode mode, const char *cmd) soft_restart(0); } +static void init_irq(void) +{ + set_handle_irq(icoll_handle_irq); +} + static const char *const mxs_dt_compat[] __initconst = { "fsl,imx28", "fsl,imx23", @@ -472,7 +478,7 @@ static const char *const mxs_dt_compat[] __initconst = { }; DT_MACHINE_START(MXS, "Freescale MXS (Device Tree)") - .handle_irq = icoll_handle_irq, + .init_irq = mxs_init_irq, .init_machine = mxs_machine_init, .init_late = mxs_pm_init, .dt_compat = mxs_dt_compat, diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c index 0f67ac4c6fd2..700cbb296da0 100644 --- a/arch/arm/mach-omap1/board-ams-delta.c +++ b/arch/arm/mach-omap1/board-ams-delta.c @@ -881,7 +881,6 @@ MACHINE_START(AMS_DELTA, "Amstrad E3 (Delta)") .map_io = ams_delta_map_io, .init_early = omap1_init_early, .init_irq = omap1_init_irq, - .handle_irq = omap1_handle_irq, .init_machine = ams_delta_init, .init_late = ams_delta_init_late, .init_time = omap1_timer_init, diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c index a501a473ffd6..b56cea9f9d2f 100644 --- a/arch/arm/mach-omap1/board-nokia770.c +++ b/arch/arm/mach-omap1/board-nokia770.c @@ -291,7 +291,6 @@ MACHINE_START(NOKIA770, "Nokia 770") .map_io = omap1_map_io, .init_early = omap1_init_early, .init_irq = omap1_init_irq, - .handle_irq = omap1_handle_irq, .init_machine = omap_nokia770_init, .init_late = omap1_init_late, .init_time = omap1_timer_init, diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c index df758c1f9237..46eda4ff4797 100644 --- a/arch/arm/mach-omap1/board-osk.c +++ b/arch/arm/mach-omap1/board-osk.c @@ -389,7 +389,6 @@ MACHINE_START(OMAP_OSK, "TI-OSK") .map_io = omap1_map_io, .init_early = omap1_init_early, .init_irq = omap1_init_irq, - .handle_irq = omap1_handle_irq, .init_machine = osk_init, .init_late = omap1_init_late, .init_time = omap1_timer_init, diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c index f79c497f04d5..91df3dc365af 100644 --- a/arch/arm/mach-omap1/board-palmte.c +++ b/arch/arm/mach-omap1/board-palmte.c @@ -259,7 +259,6 @@ MACHINE_START(OMAP_PALMTE, "OMAP310 based Palm Tungsten E") .map_io = omap1_map_io, .init_early = omap1_init_early, .init_irq = omap1_init_irq, - .handle_irq = omap1_handle_irq, .init_machine = omap_palmte_init, .init_late = omap1_init_late, .init_time = omap1_timer_init, diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c index 0c0cdd5e77c7..3ae295af96fd 100644 --- a/arch/arm/mach-omap1/board-sx1.c +++ b/arch/arm/mach-omap1/board-sx1.c @@ -338,7 +338,6 @@ MACHINE_START(SX1, "OMAP310 based Siemens SX1") .map_io = omap1_map_io, .init_early = omap1_init_early, .init_irq = omap1_init_irq, - .handle_irq = omap1_handle_irq, .init_machine = omap_sx1_init, .init_late = omap1_init_late, .init_time = omap1_timer_init, diff --git a/arch/arm/mach-omap1/irq.c b/arch/arm/mach-omap1/irq.c index 9ccc784fd614..b64fb2ebc434 100644 --- a/arch/arm/mach-omap1/irq.c +++ b/arch/arm/mach-omap1/irq.c @@ -37,6 +37,7 @@ */ #include <linux/gpio.h> #include <linux/init.h> +#include <linux/irq.h> #include <linux/module.h> #include <linux/sched.h> #include <linux/interrupt.h> @@ -253,4 +254,6 @@ void __init omap1_init_irq(void) ct = irq_data_get_chip_type(d); ct->chip.irq_unmask(d); } + + set_handle_irq(omap1_handle_irq); } diff --git a/arch/arm/mach-pxa/gumstix.c b/arch/arm/mach-pxa/gumstix.c index 72b08a9bf0fd..6b7197ae3c72 100644 --- a/arch/arm/mach-pxa/gumstix.c +++ b/arch/arm/mach-pxa/gumstix.c @@ -233,7 +233,6 @@ MACHINE_START(GUMSTIX, "Gumstix") .map_io = pxa25x_map_io, .nr_irqs = PXA_NR_IRQS, .init_irq = pxa25x_init_irq, - .handle_irq = pxa25x_handle_irq, .init_time = pxa_timer_init, .init_machine = gumstix_init, .restart = pxa_restart, diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c index 1b83be181bab..032dc897fe94 100644 --- a/arch/arm/mach-pxa/pxa25x.c +++ b/arch/arm/mach-pxa/pxa25x.c @@ -143,6 +143,7 @@ static int pxa25x_set_wake(struct irq_data *d, unsigned int on) void __init pxa25x_init_irq(void) { pxa_init_irq(32, pxa25x_set_wake); + set_handle_irq(pxa25x_handle_irq); } static int __init __init diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index 4135ba2877c4..c9b56424b653 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c @@ -228,6 +228,7 @@ static int pxa27x_set_wake(struct irq_data *d, unsigned int on) void __init pxa27x_init_irq(void) { pxa_init_irq(34, pxa27x_set_wake); + set_handle_irq(pxa27x_handle_irq); } static int __init diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index 26f0ebc4d136..688d2af0d3e2 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c @@ -1042,7 +1042,6 @@ MACHINE_START(SPITZ, "SHARP Spitz") .map_io = pxa27x_map_io, .nr_irqs = PXA_NR_IRQS, .init_irq = pxa27x_init_irq, - .handle_irq = pxa27x_handle_irq, .init_machine = spitz_init, .init_time = pxa_timer_init, .restart = spitz_restart, @@ -1055,7 +1054,6 @@ MACHINE_START(BORZOI, "SHARP Borzoi") .map_io = pxa27x_map_io, .nr_irqs = PXA_NR_IRQS, .init_irq = pxa27x_init_irq, - .handle_irq = pxa27x_handle_irq, .init_machine = spitz_init, .init_time = pxa_timer_init, .restart = spitz_restart, @@ -1068,7 +1066,6 @@ MACHINE_START(AKITA, "SHARP Akita") .map_io = pxa27x_map_io, .nr_irqs = PXA_NR_IRQS, .init_irq = pxa27x_init_irq, - .handle_irq = pxa27x_handle_irq, .init_machine = spitz_init, .init_time = pxa_timer_init, .restart = spitz_restart,
ARM exclusively uses GENERIC_IRQ_MULTI_HANDLER, so at some point set_handle_irq() needs to be called to handle system-wide interrupts. For all DT-enabled boards, this call happens down in the drivers/irqchip subsystem, after locating the target irqchip driver from the device tree. We still have a few instances of the boardfiles with machine descriptors passing a machine-specific .handle_irq() to the ARM kernel core. Get rid of this by letting the few remaining machines consistently call set_handle_irq() from the end of the .init_irq() callback instead and diet down one member from the machine descriptor. Cc: Marc Zyngier <maz@kernel.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> --- ChanegLog v1->v2: - Get rid of .handle_irq() from mdesc altogether. --- arch/arm/include/asm/mach/arch.h | 1 - arch/arm/kernel/setup.c | 4 ---- arch/arm/mach-mxs/mach-mxs.c | 8 +++++++- arch/arm/mach-omap1/board-ams-delta.c | 1 - arch/arm/mach-omap1/board-nokia770.c | 1 - arch/arm/mach-omap1/board-osk.c | 1 - arch/arm/mach-omap1/board-palmte.c | 1 - arch/arm/mach-omap1/board-sx1.c | 1 - arch/arm/mach-omap1/irq.c | 3 +++ arch/arm/mach-pxa/gumstix.c | 1 - arch/arm/mach-pxa/pxa25x.c | 1 + arch/arm/mach-pxa/pxa27x.c | 1 + arch/arm/mach-pxa/spitz.c | 3 --- 13 files changed, 12 insertions(+), 15 deletions(-)