genirq: Remove setup_irq()
Subsystems (42)
cover genirq: Remove setup_irq()
While trying to understand internals of irq handling, came across a thread [1] in which tglx was referring to avoid usage of setup_irq(). Existing callers of setup_irq() reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.
Hence instances of setup_irq() is replaced by request_irq() & setup_irq() (along with remove_irq()) definition deleted in the last patch.
Seldom remove_irq() usage has been observed coupled with setup_irq(), wherever that has been found, it too has been replaced by free_irq().
Build & boot tested on ARM & x86_64 platforms (ensured that on the machines used for testing there was an existing setup_irq() invocation occuring at runtime)
Much of the changes were created using Coccinelle with an intention to learn it. spatch command was directly run w/ semantic patch below. But not everything could be automated.
Searching with 'git grep -n '\Wsetup_irq('' & avoiding the irrelevant ones, 153 invocation's of setup_irq() were found. 112 could be replaced w/ cocci, of which in a few files some desired hunks were missing or not as expected, these were fixed up manually. Also the remaining 41 had to be done manually.
Although cocci could replace 112, because of line continue not happening at paranthesis for request_irq(), around 80 had to be manually aligned in the request_irq() statement. Problem was with my below cocci snippet,
- setup_irq(E1,&act);
+ if (request_irq(E1,f_handler,f_flags,f_name,f_dev_id))
+ pr_err("request_irq() on %s failed\n", f_name);
Instead of the above, if below is used, line continue happens exactly at paranthesis, but it lacks addition of printing on request_irq() failure where existing setup_irq() failure was not doing it.
- setup_irq(E1,&act)
+ request_irq(E1,f_handler,f_flags,f_name,f_dev_id)
Above had an additional advantage of replacing instances of if (setup_irq()) & BUG(setup_irq()), but luckily those instances were very few.
So though many changes could be automated, there are a considerable amount of manual changes, please review carefully especially mips & alpha.
Usage of setup_percpu_irq() is untouched w/ this series.
There are 2 checkpatch warning about usage of BUG() [which was already there w/ setup_irq()], they are left as is as it seems appropriate for tick timer interrupt.
[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
--->8---
@r1@
identifier ret;
@@
(setup_irq(...);
|
ret = setup_irq(...);
)
@r2 depends on r1@
identifier act;
@@
static struct irqaction act = {
};
@r11 depends on r2@
identifier r2.act;
identifier f_handler;
@@
(
- act.handler = f_handler;
|
static struct irqaction act = {
.handler = f_handler,
};
)
@r12 depends on r2@
identifier r2.act;
expression f_name;
@@
(
- act.name = f_name;
|
static struct irqaction act = {
.name = f_name,
};
)
@r15 depends on r2@
identifier r2.act;
expression f_dev_id;
@@
(
- act.dev_id = f_dev_id;
|
static struct irqaction act = {
.dev_id = f_dev_id,
};
)
@r16 depends on r2@
identifier r2.act;
expression f_flags;
@@
(
- act.flags = f_flags;
|
static struct irqaction act = {
.flags = f_flags,
};
)
@r21 depends on r2@
identifier r2.act;
@@
- static struct irqaction act = {
- ...
- };
@r22 depends on r2 && r11 && r12 && r15 && r16@
identifier r2.act;
identifier r11.f_handler;
expression r12.f_name;
expression r15.f_dev_id;
expression r16.f_flags;
expression E1;
identifier ret;
@@
(
- setup_irq(E1,&act);
+ if (request_irq(E1,f_handler,f_flags,f_name,f_dev_id))
+ pr_err("request_irq() on %s failed\n", f_name);
|
- ret = setup_irq(E1,&act);
+ ret = request_irq(E1,f_handler,f_flags,f_name,f_dev_id); )
@r23 depends on r2 && r11 && r12 && !r15 && r16@
identifier r2.act;
identifier r11.f_handler;
expression r12.f_name;
expression r16.f_flags;
expression E1;
identifier ret;
@@
(
- setup_irq(E1,&act);
+ if (request_irq(E1,f_handler,f_flags,f_name,NULL))
+ pr_err("request_irq() on %s failed\n", f_name);
|
- ret = setup_irq(E1,&act);
+ ret = request_irq(E1,f_handler,f_flags,f_name,NULL); )
@r24 depends on r2 && r11 && r12 && r15 && !r16@
identifier r2.act;
identifier r11.f_handler;
expression r12.f_name;
expression r15.f_dev_id;
expression E1;
identifier ret;
@@
(
- setup_irq(E1,&act);
+ if (request_irq(E1,f_handler,0,f_name,f_dev_id))
+ pr_err("request_irq() on %s failed\n", f_name);
|
- ret = setup_irq(E1,&act);
+ ret = request_irq(E1,f_handler,0,f_name,f_dev_id); )
@r25 depends on r2 && r11 && r12 && !r15 && !r16@
identifier r2.act;
identifier r11.f_handler;
expression r12.f_name;
expression E1;
identifier ret;
@@
(
- setup_irq(E1,&act);
+ if (request_irq(E1,f_handler,0,f_name,NULL))
+ pr_err("request_irq() on %s failed\n", f_name);
|
- ret = setup_irq(E1,&act);
+ ret = request_irq(E1,f_handler,0,f_name,NULL);
)
--->8---
afzal mohammed (18):
alpha: replace setup_irq() by request_irq()
ARM: replace setup_irq() by request_irq()
c6x: replace setup_irq() by request_irq()
hexagon: replace setup_irq() by request_irq()
ia64: replace setup_irq() by request_irq()
m68k: Replace setup_irq() by request_irq()
microblaze: Replace setup_irq() by request_irq()
MIPS: Replace setup_irq() by request_irq()
parisc: Replace setup_irq() by request_irq()
powerpc: Replace setup_irq() by request_irq()
s390: replace setup_irq() by request_irq()
sh: replace setup_irq() by request_irq()
unicore32: replace setup_irq() by request_irq()
x86: Replace setup_irq() by request_irq()
xtensa: replace setup_irq() by request_irq()
clocksource: Replace setup_irq() by request_irq()
irqchip: Replace setup_irq() by request_irq()
genirq: Remove setup_irq() and remove_irq()
arch/alpha/kernel/irq_alpha.c | 29 ++------- arch/alpha/kernel/irq_i8259.c | 8 +-- arch/alpha/kernel/irq_impl.h | 7 +-- arch/alpha/kernel/irq_pyxis.c | 3 +- arch/alpha/kernel/sys_alcor.c | 3 +- arch/alpha/kernel/sys_cabriolet.c | 3 +- arch/alpha/kernel/sys_eb64p.c | 3 +- arch/alpha/kernel/sys_marvel.c | 2 +- arch/alpha/kernel/sys_miata.c | 6 +- arch/alpha/kernel/sys_ruffian.c | 3 +- arch/alpha/kernel/sys_rx164.c | 3 +- arch/alpha/kernel/sys_sx164.c | 3 +- arch/alpha/kernel/sys_wildfire.c | 7 +-- arch/alpha/kernel/time.c | 6 +- arch/arm/mach-cns3xxx/core.c | 10 +--- arch/arm/mach-ebsa110/core.c | 10 +--- arch/arm/mach-ep93xx/timer-ep93xx.c | 12 ++-- arch/arm/mach-footbridge/dc21285-timer.c | 11 +--- arch/arm/mach-footbridge/isa-irq.c | 8 +-- arch/arm/mach-footbridge/isa-timer.c | 11 +--- arch/arm/mach-iop32x/time.c | 12 ++-- arch/arm/mach-mmp/time.c | 11 +--- arch/arm/mach-omap1/pm.c | 22 ++++--- arch/arm/mach-omap1/time.c | 10 +--- arch/arm/mach-omap1/timer32k.c | 10 +--- arch/arm/mach-omap2/timer.c | 11 +--- arch/arm/mach-rpc/time.c | 8 +-- arch/arm/mach-spear/time.c | 9 +-- arch/arm/plat-orion/time.c | 10 +--- arch/c6x/platforms/timer64.c | 11 +--- arch/hexagon/kernel/smp.c | 17 +++--- arch/hexagon/kernel/time.c | 11 +--- arch/ia64/kernel/irq_ia64.c | 42 +++++-------- arch/ia64/kernel/mca.c | 51 +++++----------- arch/m68k/68000/timers.c | 9 +-- arch/m68k/coldfire/pit.c | 9 +-- arch/m68k/coldfire/sltimers.c | 19 ++---- arch/m68k/coldfire/timers.c | 19 ++---- arch/microblaze/kernel/timer.c | 10 +--- arch/mips/alchemy/common/time.c | 11 +--- arch/mips/ar7/irq.c | 18 +++--- arch/mips/ath25/ar2315.c | 9 +-- arch/mips/ath25/ar5312.c | 9 +-- arch/mips/bcm63xx/irq.c | 38 +++++------- arch/mips/cobalt/irq.c | 14 ++--- arch/mips/dec/setup.c | 59 ++++++++----------- arch/mips/emma/markeins/irq.c | 20 +++---- arch/mips/include/asm/sni.h | 2 +- arch/mips/jazz/irq.c | 12 +--- arch/mips/kernel/cevt-bcm1480.c | 11 +--- arch/mips/kernel/cevt-ds1287.c | 9 +-- arch/mips/kernel/cevt-gt641xx.c | 9 +-- arch/mips/kernel/cevt-r4k.c | 4 +- arch/mips/kernel/cevt-sb1250.c | 11 +--- arch/mips/kernel/cevt-txx9.c | 11 +--- arch/mips/kernel/i8253.c | 10 +--- arch/mips/kernel/rtlx-mt.c | 8 +-- arch/mips/kernel/smp.c | 33 ++++------- arch/mips/lasat/interrupt.c | 10 +--- arch/mips/loongson2ef/common/bonito-irq.c | 9 +-- .../loongson2ef/common/cs5536/cs5536_mfgpt.c | 10 +--- arch/mips/loongson2ef/fuloong-2e/irq.c | 14 ++--- arch/mips/loongson2ef/lemote-2f/irq.c | 20 ++----- arch/mips/loongson32/common/irq.c | 21 ++++--- arch/mips/loongson32/common/time.c | 12 ++-- arch/mips/loongson64/hpet.c | 10 +--- arch/mips/mti-malta/malta-int.c | 10 +--- arch/mips/netlogic/xlr/fmn.c | 9 +-- arch/mips/pmcs-msp71xx/msp_irq.c | 28 ++++----- arch/mips/pmcs-msp71xx/msp_smp.c | 22 ++----- arch/mips/pmcs-msp71xx/msp_time.c | 7 ++- arch/mips/ralink/cevt-rt3352.c | 17 +++--- arch/mips/sgi-ip22/ip22-eisa.c | 8 +-- arch/mips/sgi-ip22/ip22-int.c | 49 +++++---------- arch/mips/sgi-ip32/ip32-irq.c | 18 ++---- arch/mips/sni/a20r.c | 4 +- arch/mips/sni/irq.c | 8 +-- arch/mips/sni/pcit.c | 8 ++- arch/mips/sni/rm200.c | 23 +++----- arch/mips/sni/time.c | 10 +--- arch/mips/vr41xx/common/irq.c | 9 +-- arch/parisc/kernel/irq.c | 21 ++----- arch/powerpc/platforms/85xx/mpc85xx_cds.c | 10 +--- arch/powerpc/platforms/8xx/cpm1.c | 9 +-- arch/powerpc/platforms/8xx/m8xx_setup.c | 9 +-- arch/powerpc/platforms/chrp/setup.c | 14 ++--- arch/powerpc/platforms/powermac/pic.c | 31 ++++------ arch/powerpc/platforms/powermac/smp.c | 9 +-- arch/s390/kernel/irq.c | 8 +-- arch/sh/boards/mach-cayman/irq.c | 18 ++---- arch/sh/drivers/dma/dma-pvr2.c | 9 +-- arch/unicore32/kernel/time.c | 11 +--- arch/x86/kernel/irqinit.c | 18 +++--- arch/x86/kernel/time.c | 10 +--- arch/xtensa/kernel/smp.c | 8 +-- arch/xtensa/kernel/time.c | 10 +--- drivers/clocksource/bcm2835_timer.c | 8 +-- drivers/clocksource/bcm_kona_timer.c | 10 +--- drivers/clocksource/dw_apb_timer.c | 11 +--- drivers/clocksource/exynos_mct.c | 12 ++-- drivers/clocksource/mxs_timer.c | 10 +--- drivers/clocksource/nomadik-mtu.c | 11 +--- drivers/clocksource/samsung_pwm_timer.c | 12 ++-- drivers/clocksource/timer-atlas7.c | 50 ++++++++-------- drivers/clocksource/timer-cs5535.c | 10 +--- drivers/clocksource/timer-efm32.c | 10 +--- drivers/clocksource/timer-fsl-ftm.c | 10 +--- drivers/clocksource/timer-imx-gpt.c | 10 +--- drivers/clocksource/timer-integrator-ap.c | 11 +--- drivers/clocksource/timer-meson6.c | 11 +--- drivers/clocksource/timer-orion.c | 9 +-- drivers/clocksource/timer-prima2.c | 11 +--- drivers/clocksource/timer-pxa.c | 10 +--- drivers/clocksource/timer-sp804.c | 11 +--- drivers/clocksource/timer-u300.c | 9 +-- drivers/clocksource/timer-vf-pit.c | 10 +--- drivers/clocksource/timer-vt8500.c | 11 +--- drivers/clocksource/timer-zevio.c | 13 ++-- drivers/irqchip/irq-i8259.c | 9 +-- drivers/irqchip/irq-ingenic.c | 11 ++-- drivers/parisc/eisa.c | 8 +-- drivers/s390/cio/airq.c | 8 +-- drivers/s390/cio/cio.c | 8 +-- include/linux/dw_apb_timer.h | 1 - include/linux/irq.h | 2 - kernel/irq/manage.c | 44 -------------- 126 files changed, 528 insertions(+), 1111 deletions(-)
base-commit: v5.6-rc1
Signature · 1 line
2.24.1
PATCH 1/18 alpha: replace setup_irq() by request_irq()
request_irq() is preferred over setup_irq(). Existing callers of setup_irq() reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.
Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early interrupts were initialized.
Hence replace setup_irq() by request_irq().
Seldom remove_irq() usage has been observed coupled with setup_irq(), wherever that has been found, it too has been replaced by free_irq().
[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
---
Since cc'ing cover letter to all maintainers/reviewers would be too many, refer for cover letter,
https://lkml.kernel.org/r/[email protected]
arch/alpha/kernel/irq_alpha.c | 29 +++++------------------------ arch/alpha/kernel/irq_i8259.c | 8 ++------ arch/alpha/kernel/irq_impl.h | 7 +------ arch/alpha/kernel/irq_pyxis.c | 3 ++- arch/alpha/kernel/sys_alcor.c | 3 ++- arch/alpha/kernel/sys_cabriolet.c | 3 ++- arch/alpha/kernel/sys_eb64p.c | 3 ++- arch/alpha/kernel/sys_marvel.c | 2 +- arch/alpha/kernel/sys_miata.c | 6 ++++-- arch/alpha/kernel/sys_ruffian.c | 3 ++- arch/alpha/kernel/sys_rx164.c | 3 ++- arch/alpha/kernel/sys_sx164.c | 3 ++- arch/alpha/kernel/sys_wildfire.c | 7 ++----- arch/alpha/kernel/time.c | 6 ++---- 14 files changed, 31 insertions(+), 55 deletions(-)
arch/alpha/kernel/irq_alpha.c +5 -24
@@ -213,32 +213,13 @@ process_mcheck_info(unsigned long vector, unsigned long la_ptr,* The special RTC interrupt type. The interrupt itself was * processed by PALcode, and comes in via entInt vector 1. */ - -struct irqaction timer_irqaction = { - .handler = rtc_timer_interrupt, - .name ="timer" , -}; -void __init -init_rtc_irq (void ) +init_rtc_irq (irqreturn_t handler) {irq_set_chip_and_handler_name (RTC_IRQ , &dummy_irq_chip, handle_percpu_irq,"RTC" ); -setup_irq (RTC_IRQ , &timer_irqaction); +if (!handler) + handler = rtc_timer_interrupt; +if (request_irq (RTC_IRQ , handler,0 ,"timer" ,NULL )) +pr_err ("request_irq() for %s failed\n" ,"timer" ); } - -/* Dummy irqactions. */ -struct irqaction isa_cascade_irqaction = { - .handler = no_action, - .name ="isa-cascade" -}; - -struct irqaction timer_cascade_irqaction = { - .handler = no_action, - .name ="timer-cascade" -}; - -struct irqaction halt_switch_irqaction = { - .handler = no_action, - .name ="halt-switch" -};
arch/alpha/kernel/irq_i8259.c +2 -6
@@ -82,11 +82,6 @@ struct irq_chip i8259a_irq_type = {void __init init_i8259a_irqs (void ) { -static struct irqaction cascade = { - .handler = no_action, - .name ="cascade" , - }; -long i;outb (0xff ,0x21 );/* mask all of 8259A-1 */
@@ -96,7 +91,8 @@ init_i8259a_irqs(void)irq_set_chip_and_handler (i, &i8259a_irq_type, handle_level_irq); } -setup_irq (2 , &cascade); +if (request_irq (2 , no_action,0 ,"cascade" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"cascade" ); }
arch/alpha/kernel/irq_impl.h +1 -6
@@ -21,14 +21,9 @@ extern void isa_no_iack_sc_device_interrupt(unsigned long);extern void srm_device_interrupt (unsigned long );extern void pyxis_device_interrupt (unsigned long ); -extern struct irqaction timer_irqaction; -extern struct irqaction isa_cascade_irqaction; -extern struct irqaction timer_cascade_irqaction; -extern struct irqaction halt_switch_irqaction; -extern void init_srm_irqs (long ,unsigned long );extern void init_pyxis_irqs (unsigned long ); -extern void init_rtc_irq (void ); +extern void init_rtc_irq (irqreturn_t handler);extern void common_init_isa_dma (void );
arch/alpha/kernel/irq_pyxis.c +2 -1
@@ -107,5 +107,6 @@ init_pyxis_irqs(unsigned long ignore_mask)irq_set_status_flags (i,IRQ_LEVEL ); } -setup_irq (16 +7 , &isa_cascade_irqaction); +if (request_irq (16 +7 , no_action,0 ,"isa-cascade" ,NULL )) +pr_err ("request_irq() for %s failed\n" ,"isa-cascade" ); }
arch/alpha/kernel/sys_alcor.c +2 -1
@@ -133,7 +133,8 @@ alcor_init_irq(void)init_i8259a_irqs ();common_init_isa_dma (); -setup_irq (16 +31 , &isa_cascade_irqaction); +if (request_irq (16 +31 , no_action,0 ,"isa-cascade" ,NULL )) +pr_err ("request_irq() for %s failed\n" ,"isa-cascade" ); }
arch/alpha/kernel/sys_cabriolet.c +2 -1
@@ -112,7 +112,8 @@ common_init_irq(void (*srm_dev_int)(unsigned long v)) }common_init_isa_dma (); -setup_irq (16 +4 , &isa_cascade_irqaction); +if (request_irq (16 +4 , no_action,0 ,"isa-cascade" ,NULL )) +pr_err ("request_irq() for %s failed\n" ,"isa-cascade" ); }#ifndef CONFIG_ALPHA_PC164
arch/alpha/kernel/sys_eb64p.c +2 -1
@@ -123,7 +123,8 @@ eb64p_init_irq(void) }common_init_isa_dma (); -setup_irq (16 +5 , &isa_cascade_irqaction); +if (request_irq (16 +5 , no_action,0 ,"isa-cascade" ,NULL )) +pr_err ("request_irq() for %s failed\n" ,"isa-cascade" ); }/*
arch/alpha/kernel/sys_marvel.c +1 -1
@@ -397,7 +397,7 @@ marvel_init_pci(void)static void __init marvel_init_rtc (void ) { -init_rtc_irq (); +init_rtc_irq (NULL ); } static void
arch/alpha/kernel/sys_miata.c +4 -2
@@ -81,8 +81,10 @@ miata_init_irq(void)init_pyxis_irqs (0x63b0000 );common_init_isa_dma (); -setup_irq (16 +2 , &halt_switch_irqaction);/* SRM only? */ -setup_irq (16 +6 , &timer_cascade_irqaction); +if (request_irq (16 +2 , no_action,0 ,"halt-switch" ,NULL )) +pr_err ("request_irq() for %s failed\n" ,"halt-switch" ); +if (request_irq (16 +6 , no_action,0 ,"timer-cascade" ,NULL )) +pr_err ("request_irq() for %s failed\n" ,"timer-cascade" ); }
arch/alpha/kernel/sys_ruffian.c +2 -1
@@ -82,7 +82,8 @@ ruffian_init_rtc(void)outb (0x31 ,0x42 );outb (0x13 ,0x42 ); -setup_irq (0 , &timer_irqaction); +if (request_irq (0 , rtc_timer_interrupt,0 ,"timer" ,NULL )) +pr_err ("request_irq() for %s failed\n" ,"timer" ); } static void
arch/alpha/kernel/sys_rx164.c +2 -1
@@ -106,7 +106,8 @@ rx164_init_irq(void)init_i8259a_irqs ();common_init_isa_dma (); -setup_irq (16 +20 , &isa_cascade_irqaction); +if (request_irq (16 +20 , no_action,0 ,"isa-cascade" ,NULL )) +pr_err ("request_irq() for %s failed\n" ,"isa-cascade" ); }
arch/alpha/kernel/sys_sx164.c +2 -1
@@ -54,7 +54,8 @@ sx164_init_irq(void)else init_pyxis_irqs (0xff00003f0000UL ); -setup_irq (16 +6 , &timer_cascade_irqaction); +if (request_irq (16 +6 , no_action,0 ,"timer-cascade" ,NULL )) +pr_err ("request_irq() for %s failed\n" ,"timer-cascade" ); }/*
arch/alpha/kernel/sys_wildfire.c +2 -5
@@ -156,10 +156,6 @@ static void __init wildfire_init_irq_per_pca(int qbbno, int pcano) { int i, irq_bias; -static struct irqaction isa_enable = { - .handler = no_action, - .name ="isa_enable" , - }; irq_bias = qbbno * (WILDFIRE_PCA_PER_QBB *WILDFIRE_IRQ_PER_PCA ) + pcano *WILDFIRE_IRQ_PER_PCA ;
@@ -198,7 +194,8 @@ wildfire_init_irq_per_pca(int qbbno, int pcano)irq_set_status_flags (i + irq_bias,IRQ_LEVEL ); } -setup_irq (32 +irq_bias, &isa_enable); +if (request_irq (32 + irq_bias, no_action,0 ,"isa_enable" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"isa_enable" ); } static void __init
arch/alpha/kernel/time.c +2 -4
@@ -242,7 +242,7 @@ common_init_rtc(void)outb (0x31 ,0x42 );outb (0x13 ,0x42 ); -init_rtc_irq (); +init_rtc_irq (NULL ); }
@@ -396,9 +396,7 @@ time_init(void)if (alpha_using_qemu) {clocksource_register_hz (&qemu_cs,NSEC_PER_SEC );init_qemu_clockevent (); - - timer_irqaction.handler = qemu_timer_interrupt; -init_rtc_irq (); +init_rtc_irq (qemu_timer_interrupt);return ; }
Signature · 1 line
2.24.1
PATCH 2/18 ARM: replace setup_irq() by request_irq()
In reply to afzal mohammedrequest_irq() is preferred over setup_irq(). Existing callers of setup_irq() reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.
Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early interrupts were initialized.
Hence replace setup_irq() by request_irq().
Seldom remove_irq() usage has been observed coupled with setup_irq(), wherever that has been found, it too has been replaced by free_irq().
[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
---
Since cc'ing cover letter to all maintainers/reviewers would be too many, refer for cover letter,
https://lkml.kernel.org/r/[email protected]
arch/arm/mach-cns3xxx/core.c | 10 +++------- arch/arm/mach-ebsa110/core.c | 10 +++------- arch/arm/mach-ep93xx/timer-ep93xx.c | 12 ++++-------- arch/arm/mach-footbridge/dc21285-timer.c | 11 +++-------- arch/arm/mach-footbridge/isa-irq.c | 8 ++------ arch/arm/mach-footbridge/isa-timer.c | 11 +++-------- arch/arm/mach-iop32x/time.c | 12 ++++-------- arch/arm/mach-mmp/time.c | 11 +++-------- arch/arm/mach-omap1/pm.c | 22 +++++++++++++--------- arch/arm/mach-omap1/time.c | 10 +++------- arch/arm/mach-omap1/timer32k.c | 10 +++------- arch/arm/mach-omap2/timer.c | 11 +++-------- arch/arm/mach-rpc/time.c | 8 ++------ arch/arm/mach-spear/time.c | 9 ++------- arch/arm/plat-orion/time.c | 10 +++------- 15 files changed, 54 insertions(+), 111 deletions(-)
arch/arm/mach-cns3xxx/core.c +3 -7
@@ -189,12 +189,6 @@ static irqreturn_t cns3xxx_timer_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction cns3xxx_timer_irq = { - .name ="timer" , - .flags =IRQF_TIMER |IRQF_IRQPOLL , - .handler = cns3xxx_timer_interrupt, -}; -/* * Set up the clock source and clock events devices */
@@ -245,7 +239,9 @@ static void __init __cns3xxx_timer_init(unsigned int timer_irq)writel (val, cns3xxx_tmr1 +TIMER1_2_CONTROL_OFFSET );/* Make irqs happen for the system timer */ -setup_irq (timer_irq, &cns3xxx_timer_irq); +if (request_irq (timer_irq, cns3xxx_timer_interrupt, +IRQF_TIMER |IRQF_IRQPOLL ,"timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"timer" );cns3xxx_clockevents_init (timer_irq); }
arch/arm/mach-ebsa110/core.c +3 -7
@@ -201,12 +201,6 @@ ebsa110_timer_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction ebsa110_timer_irq = { - .name ="EBSA110 Timer Tick" , - .flags =IRQF_TIMER |IRQF_IRQPOLL , - .handler = ebsa110_timer_interrupt, -}; -/* * Set up timer interrupt. */
@@ -221,7 +215,9 @@ void __init ebsa110_timer_init(void)__raw_writeb (COUNT &0xff ,PIT_T1 );__raw_writeb (COUNT >>8 ,PIT_T1 ); -setup_irq (IRQ_EBSA110_TIMER0 , &ebsa110_timer_irq); +if (request_irq (IRQ_EBSA110_TIMER0 , ebsa110_timer_interrupt, +IRQF_TIMER |IRQF_IRQPOLL ,"EBSA110 Timer Tick" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"EBSA110 Timer Tick" ); }static struct plat_serial8250_port serial_platform_data[] = {
arch/arm/mach-ep93xx/timer-ep93xx.c +4 -8
@@ -117,13 +117,6 @@ static irqreturn_t ep93xx_timer_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction ep93xx_timer_irq = { - .name ="ep93xx timer" , - .flags =IRQF_TIMER |IRQF_IRQPOLL , - .handler = ep93xx_timer_interrupt, - .dev_id = &ep93xx_clockevent, -}; -void __init ep93xx_timer_init (void ) {/* Enable and register clocksource and sched_clock on timer 4 */
@@ -136,7 +129,10 @@ void __init ep93xx_timer_init(void) EP93XX_TIMER4_RATE);/* Set up clockevent on timer 3 */ -setup_irq (IRQ_EP93XX_TIMER3 , &ep93xx_timer_irq); +if (request_irq (IRQ_EP93XX_TIMER3 , ep93xx_timer_interrupt, +IRQF_TIMER |IRQF_IRQPOLL ,"ep93xx timer" , + &ep93xx_clockevent)) +pr_err ("request_irq() on %s failed\n" ,"ep93xx timer" ); clockevents_config_and_register(&ep93xx_clockevent, EP93XX_TIMER123_RATE, 1,
arch/arm/mach-footbridge/dc21285-timer.c +3 -8
@@ -101,13 +101,6 @@ static irqreturn_t timer1_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction footbridge_timer_irq = { - .name ="dc21285_timer1" , - .handler = timer1_interrupt, - .flags =IRQF_TIMER |IRQF_IRQPOLL , - .dev_id = &ckevt_dc21285, -}; -/* * Set up timer interrupt. */
@@ -118,7 +111,9 @@ void __init footbridge_timer_init(void)clocksource_register_hz (&cksrc_dc21285, rate); -setup_irq (ce->irq, &footbridge_timer_irq); +if (request_irq (ce->irq, timer1_interrupt,IRQF_TIMER |IRQF_IRQPOLL , +"dc21285_timer1" , &ckevt_dc21285)) +pr_err ("request_irq() on %s failed\n" ,"dc21285_timer1" ); ce->cpumask =cpumask_of (smp_processor_id ());clockevents_config_and_register (ce, rate,0x4 ,0xffffff );
arch/arm/mach-footbridge/isa-irq.c +2 -6
@@ -96,11 +96,6 @@ static void isa_irq_handler(struct irq_desc *desc)generic_handle_irq (isa_irq); } -static struct irqaction irq_cascade = { - .handler = no_action, - .name ="cascade" , -}; -static struct resource pic1_resource = { .name ="pic1" , .start =0x20 ,
@@ -160,7 +155,8 @@ void __init isa_init_irq(unsigned int host_irq)request_resource (&ioport_resource, &pic1_resource);request_resource (&ioport_resource, &pic2_resource); -setup_irq (IRQ_ISA_CASCADE , &irq_cascade); +if (request_irq (IRQ_ISA_CASCADE , no_action,0 ,"cascade" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"cascade" );irq_set_chained_handler (host_irq, isa_irq_handler);
arch/arm/mach-footbridge/isa-timer.c +3 -8
@@ -25,17 +25,12 @@ static irqreturn_t pit_timer_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction pit_timer_irq = { - .name ="pit" , - .handler = pit_timer_interrupt, - .flags =IRQF_TIMER |IRQF_IRQPOLL , - .dev_id = &i8253_clockevent, -}; -void __init isa_timer_init (void ) {clocksource_i8253_init (); -setup_irq (i8253_clockevent.irq, &pit_timer_irq); +if (request_irq (i8253_clockevent.irq, pit_timer_interrupt, +IRQF_TIMER |IRQF_IRQPOLL ,"pit" , &i8253_clockevent)) +pr_err ("request_irq() on %s failed\n" ,"pit" );clockevent_i8253_init (false); }
arch/arm/mach-iop32x/time.c +4 -8
@@ -137,13 +137,6 @@ iop_timer_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction iop_timer_irq = { - .name ="IOP Timer Tick" , - .handler = iop_timer_interrupt, - .flags =IRQF_TIMER |IRQF_IRQPOLL , - .dev_id = &iop_clockevent, -}; -static unsigned long iop_tick_rate;unsigned long get_iop_tick_rate (void ) {
@@ -168,7 +161,10 @@ void __init iop_init_time(unsigned long tick_rate)*/ write_tmr0 (timer_ctl & ~IOP_TMR_EN );write_tisr (1 ); -setup_irq (IRQ_IOP32X_TIMER0 , &iop_timer_irq); +if (request_irq (IRQ_IOP32X_TIMER0 , iop_timer_interrupt, +IRQF_TIMER |IRQF_IRQPOLL ,"IOP Timer Tick" , + &iop_clockevent)) +pr_err ("request_irq() on %s failed\n" ,"IOP Timer Tick" ); iop_clockevent.cpumask =cpumask_of (0 );clockevents_config_and_register (&iop_clockevent, tick_rate,0xf ,0xfffffffe );
arch/arm/mach-mmp/time.c +3 -8
@@ -175,13 +175,6 @@ static void __init timer_config(void)__raw_writel (0x2 , mmp_timer_base +TMR_CER ); } -static struct irqaction timer_irq = { - .name ="timer" , - .flags =IRQF_TIMER |IRQF_IRQPOLL , - .handler = timer_interrupt, - .dev_id = &ckevt, -}; -void __init mmp_timer_init (int irq,unsigned long rate) {timer_config ();
@@ -190,7 +183,9 @@ void __init mmp_timer_init(int irq, unsigned long rate) ckevt.cpumask =cpumask_of (0 ); -setup_irq (irq, &timer_irq); +if (request_irq (irq, timer_interrupt,IRQF_TIMER |IRQF_IRQPOLL , +"timer" , &ckevt)) +pr_err ("request_irq() on %s failed\n" ,"timer" );clocksource_register_hz (&cksrc, rate);clockevents_config_and_register (&ckevt, rate,MIN_DELTA ,MAX_DELTA );
arch/arm/mach-omap1/pm.c +13 -9
@@ -596,11 +596,6 @@ static irqreturn_t omap_wakeup_interrupt(int irq, void *dev)return IRQ_HANDLED ; } -static struct irqaction omap_wakeup_irq = { - .name ="peripheral wakeup" , - .handler = omap_wakeup_interrupt -}; -static const struct platform_suspend_ops omap_pm_ops = {
@@ -655,10 +650,19 @@ static int __init omap_pm_init(void) arm_pm_idle = omap1_pm_idle; -if (cpu_is_omap7xx ()) -setup_irq (INT_7XX_WAKE_UP_REQ , &omap_wakeup_irq); -else if (cpu_is_omap16xx ()) -setup_irq (INT_1610_WAKE_UP_REQ , &omap_wakeup_irq); +if (cpu_is_omap7xx ()) { +if (request_irq (INT_7XX_WAKE_UP_REQ , omap_wakeup_interrupt,0 , +"peripheral wakeup" ,NULL )) { +pr_err ("request_irq() on %s failed\n" , +"peripheral wakeup" ); + } + }else if (cpu_is_omap16xx ()) { +if (request_irq (INT_1610_WAKE_UP_REQ , omap_wakeup_interrupt,0 , +"peripheral wakeup" ,NULL )) { +pr_err ("request_irq() on %s failed\n" , +"peripheral wakeup" ); + } + }/* Program new power ramp-up time * (0 for most boards since we don't lower voltage when in deep sleep)
arch/arm/mach-omap1/time.c +3 -7
@@ -155,15 +155,11 @@ static irqreturn_t omap_mpu_timer1_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction omap_mpu_timer1_irq = { - .name ="mpu_timer1" , - .flags =IRQF_TIMER |IRQF_IRQPOLL , - .handler = omap_mpu_timer1_interrupt, -}; -static __init void omap_init_mpu_timer (unsigned long rate) { -setup_irq (INT_TIMER1 , &omap_mpu_timer1_irq); +if (request_irq (INT_TIMER1 , omap_mpu_timer1_interrupt, +IRQF_TIMER |IRQF_IRQPOLL ,"mpu_timer1" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"mpu_timer1" );omap_mpu_timer_start (0 , (rate /HZ ) -1 ,1 ); clockevent_mpu_timer1.cpumask =cpumask_of (0 );
arch/arm/mach-omap1/timer32k.c +3 -7
@@ -148,15 +148,11 @@ static irqreturn_t omap_32k_timer_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction omap_32k_timer_irq = { - .name ="32KHz timer" , - .flags =IRQF_TIMER |IRQF_IRQPOLL , - .handler = omap_32k_timer_interrupt, -}; -static __init void omap_init_32k_timer (void ) { -setup_irq (INT_OS_TIMER , &omap_32k_timer_irq); +if (request_irq (INT_OS_TIMER , omap_32k_timer_interrupt, +IRQF_TIMER |IRQF_IRQPOLL ,"32KHz timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"32KHz timer" ); clockevent_32k_timer.cpumask =cpumask_of (0 ); clockevents_config_and_register(&clockevent_32k_timer,
arch/arm/mach-omap2/timer.c +3 -8
@@ -91,12 +91,6 @@ static irqreturn_t omap2_gp_timer_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction omap2_gp_timer_irq = { - .name ="gp_timer" , - .flags =IRQF_TIMER |IRQF_IRQPOLL , - .handler = omap2_gp_timer_interrupt, -}; -static int omap2_gp_timer_set_next_event (unsigned long cycles,struct clock_event_device *evt) {
@@ -382,8 +376,9 @@ static void __init omap2_gp_clockevent_init(int gptimer_id, &clockevent_gpt.name, OMAP_TIMER_POSTED);BUG_ON (res); - omap2_gp_timer_irq.dev_id = &clkev; -setup_irq (clkev.irq, &omap2_gp_timer_irq); +if (request_irq (clkev.irq, omap2_gp_timer_interrupt, +IRQF_TIMER |IRQF_IRQPOLL ,"gp_timer" , &clkev)) +pr_err ("request_irq() on %s failed\n" ,"gp_timer" );__omap_dm_timer_int_enable (&clkev,OMAP_TIMER_INT_OVERFLOW );
arch/arm/mach-rpc/time.c +2 -6
@@ -85,11 +85,6 @@ ioc_timer_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction ioc_timer_irq = { - .name ="timer" , - .handler = ioc_timer_interrupt -}; -/* * Set up timer interrupt. */
@@ -97,5 +92,6 @@ void __init ioc_timer_init(void) {WARN_ON (clocksource_register_hz (&ioctime_clocksource,RPC_CLOCK_FREQ ));ioctime_init (); -setup_irq (IRQ_TIMER0 , &ioc_timer_irq); +if (request_irq (IRQ_TIMER0 , ioc_timer_interrupt,0 ,"timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"timer" ); }
arch/arm/mach-spear/time.c +2 -7
@@ -181,12 +181,6 @@ static irqreturn_t spear_timer_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction spear_timer_irq = { - .name ="timer" , - .flags =IRQF_TIMER , - .handler = spear_timer_interrupt -}; -static void __init spear_clockevent_init (int irq) {u32 tick_rate;
@@ -201,7 +195,8 @@ static void __init spear_clockevent_init(int irq)clockevents_config_and_register (&clkevt, tick_rate,3 ,0xfff0 ); -setup_irq (irq, &spear_timer_irq); +if (request_irq (irq, spear_timer_interrupt,IRQF_TIMER ,"timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"timer" ); }static const struct of_device_id timer_of_match[]__initconst = {
arch/arm/plat-orion/time.c +3 -7
@@ -177,12 +177,6 @@ static irqreturn_t orion_timer_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction orion_timer_irq = { - .name ="orion_tick" , - .flags =IRQF_TIMER , - .handler = orion_timer_interrupt -}; -void __init orion_time_set_base (void __iomem *_timer_base) {
@@ -236,7 +230,9 @@ orion_time_init(void __iomem *_bridge_base, u32 _bridge_timer1_clr_mask,/* * Setup clockevent timer (interrupt-driven). */ -setup_irq (irq, &orion_timer_irq); +if (request_irq (irq, orion_timer_interrupt,IRQF_TIMER ,"orion_tick" , +NULL )) +pr_err ("request_irq() on %s failed\n" ,"orion_tick" ); orion_clkevt.cpumask =cpumask_of (0 );clockevents_config_and_register (&orion_clkevt, tclk,1 ,0xfffffffe ); }
Signature · 1 line
2.24.1
PATCH 3/18 c6x: replace setup_irq() by request_irq()
In reply to afzal mohammedrequest_irq() is preferred over setup_irq(). Existing callers of setup_irq() reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.
Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early interrupts were initialized.
Hence replace setup_irq() by request_irq().
Seldom remove_irq() usage has been observed coupled with setup_irq(), wherever that has been found, it too has been replaced by free_irq().
[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
---
Since cc'ing cover letter to all maintainers/reviewers would be too many, refer for cover letter,
https://lkml.kernel.org/r/[email protected]
arch/c6x/platforms/timer64.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
arch/c6x/platforms/timer64.c +3 -8
@@ -165,13 +165,6 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction timer_iact = { - .name ="timer" , - .flags =IRQF_TIMER , - .handler = timer_interrupt, - .dev_id = &t64_clockevent_device, -}; -void __init timer64_init (void ) {struct clock_event_device *cd = &t64_clockevent_device;
@@ -238,7 +231,9 @@ void __init timer64_init(void) cd->cpumask =cpumask_of (smp_processor_id ());clockevents_register_device (cd); -setup_irq (cd->irq, &timer_iact); +if (request_irq (cd->irq, timer_interrupt,IRQF_TIMER ,"timer" , + &t64_clockevent_device)) +pr_err ("request_irq() on %s failed\n" ,"timer" ); out:of_node_put (np);
Signature · 1 line
2.24.1
PATCH 4/18 hexagon: replace setup_irq() by request_irq()
In reply to afzal mohammedrequest_irq() is preferred over setup_irq(). Existing callers of setup_irq() reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.
Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early interrupts were initialized.
Hence replace setup_irq() by request_irq().
Seldom remove_irq() usage has been observed coupled with setup_irq(), wherever that has been found, it too has been replaced by free_irq().
[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
---
Since cc'ing cover letter to all maintainers/reviewers would be too many, refer for cover letter,
https://lkml.kernel.org/r/[email protected]
arch/hexagon/kernel/smp.c | 17 ++++++++--------- arch/hexagon/kernel/time.c | 11 +++-------- 2 files changed, 11 insertions(+), 17 deletions(-)
arch/hexagon/kernel/smp.c +8 -9
@@ -114,12 +114,6 @@ void send_ipi(const struct cpumask *cpumask, enum ipi_message_type msg)local_irq_restore (flags); } -static struct irqaction ipi_intdesc = { - .handler = handle_ipi, - .flags =IRQF_TRIGGER_RISING , - .name ="ipi_handler" -}; -void __init smp_prepare_boot_cpu (void ) { }
@@ -155,7 +149,9 @@ void start_secondary(void) cpu =smp_processor_id (); -setup_irq (BASE_IPI_IRQ + cpu, &ipi_intdesc); +if (request_irq (BASE_IPI_IRQ + cpu, handle_ipi,IRQF_TRIGGER_RISING , +"ipi_handler" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"ipi_handler" );/* Register the clock_event dummy */ setup_percpu_clockdev ();
@@ -213,8 +209,11 @@ void __init smp_prepare_cpus(unsigned int max_cpus)set_cpu_present (i, true);/* Also need to register the interrupts for IPI */ -if (max_cpus >1 ) -setup_irq (BASE_IPI_IRQ , &ipi_intdesc); +if (max_cpus >1 ) { +if (request_irq (BASE_IPI_IRQ , handle_ipi,IRQF_TRIGGER_RISING , +"ipi_handler" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"ipi_handler" ); + } }void smp_send_reschedule (int cpu)
arch/hexagon/kernel/time.c +3 -8
@@ -143,13 +143,6 @@ static irqreturn_t timer_interrupt(int irq, void *devid)return IRQ_HANDLED ; } -/* This should also be pulled from devtree */ -static struct irqaction rtos_timer_intdesc = { - .handler = timer_interrupt, - .flags =IRQF_TIMER |IRQF_TRIGGER_RISING , - .name ="rtos_timer" -}; -/* * time_init_deferred - called by start_kernel to set up timer/clock source *
@@ -195,7 +188,9 @@ void __init time_init_deferred(void)#endif clockevents_register_device (ce_dev); -setup_irq (ce_dev->irq, &rtos_timer_intdesc); +if (request_irq (ce_dev->irq, timer_interrupt, +IRQF_TIMER |IRQF_TRIGGER_RISING ,"rtos_timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"rtos_timer" ); }void __init time_init (void )
Signature · 1 line
2.24.1
PATCH 5/18 ia64: replace setup_irq() by request_irq()
In reply to afzal mohammedrequest_irq() is preferred over setup_irq(). Existing callers of setup_irq() reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.
Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early interrupts were initialized.
Hence replace setup_irq() by request_irq().
Seldom remove_irq() usage has been observed coupled with setup_irq(), wherever that has been found, it too has been replaced by free_irq().
[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
---
Since cc'ing cover letter to all maintainers/reviewers would be too many, refer for cover letter,
https://lkml.kernel.org/r/[email protected]
arch/ia64/kernel/irq_ia64.c | 42 ++++++++++-------------------- arch/ia64/kernel/mca.c | 51 +++++++++++-------------------------- 2 files changed, 29 insertions(+), 64 deletions(-)
arch/ia64/kernel/irq_ia64.c +14 -28
@@ -351,11 +351,6 @@ static irqreturn_t smp_irq_move_cleanup_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction irq_move_irqaction = { - .handler = smp_irq_move_cleanup_interrupt, - .name ="irq_move" -}; -static int __init parse_vector_domain (char *arg) {if (!arg)
@@ -586,28 +581,15 @@ static irqreturn_t dummy_handler (int irq, void *dev_id) return IRQ_NONE; } -static struct irqaction ipi_irqaction = { - .handler = handle_IPI, - .name ="IPI" -}; -/* * KVM uses this interrupt to force a cpu out of guest mode */ -static struct irqaction resched_irqaction = { - .handler = dummy_handler, - .name ="resched" -}; - -static struct irqaction tlb_irqaction = { - .handler = dummy_handler, - .name ="tlb_flush" -};#endif void -ia64_native_register_percpu_irq (ia64_vector vec,struct irqaction *action) +ia64_native_register_percpu_irq (ia64_vector vec,const char *name, +irq_handler_t handler) {unsigned int irq;
@@ -615,8 +597,9 @@ ia64_native_register_percpu_irq (ia64_vector vec, struct irqaction *action)BUG_ON (bind_irq_vector (irq, vec,CPU_MASK_ALL ));irq_set_status_flags (irq,IRQ_PER_CPU );irq_set_chip (irq, &irq_type_ia64_lsapic); -if (action) -setup_irq (irq, action); +if (handler) +if (request_irq (irq, handler,0 , name,NULL )) +pr_err ("request_irq() for %s failed" , name);irq_set_handler (irq, handle_percpu_irq); }
@@ -624,9 +607,10 @@ void __initia64_native_register_ipi (void) {#ifdef CONFIG_SMP -register_percpu_irq (IA64_IPI_VECTOR , &ipi_irqaction); -register_percpu_irq (IA64_IPI_RESCHEDULE , &resched_irqaction); -register_percpu_irq (IA64_IPI_LOCAL_TLB_FLUSH , &tlb_irqaction); +register_percpu_irq (IA64_IPI_VECTOR ,"IPI" , handle_IPI); +register_percpu_irq (IA64_IPI_RESCHEDULE ,"resched" , dummy_handler); +register_percpu_irq (IA64_IPI_LOCAL_TLB_FLUSH ,"tlb_flush" , + dummy_handler);#endif }
@@ -635,10 +619,12 @@ init_IRQ (void) {acpi_boot_init ();ia64_register_ipi (); -register_percpu_irq (IA64_SPURIOUS_INT_VECTOR ,NULL ); +register_percpu_irq (IA64_SPURIOUS_INT_VECTOR ,NULL ,NULL );#ifdef CONFIG_SMP -if (vector_domain_type !=VECTOR_DOMAIN_NONE ) -register_percpu_irq (IA64_IRQ_MOVE_VECTOR , &irq_move_irqaction); +if (vector_domain_type !=VECTOR_DOMAIN_NONE ) { +register_percpu_irq (IA64_IRQ_MOVE_VECTOR ,"irq_move" , + smp_irq_move_cleanup_interrupt); + }#endif #ifdef CONFIG_PERFMON pfm_init_percpu ();
arch/ia64/kernel/mca.c +15 -36
76 lines not on this page · raw message
Signature · 1 line
2.24.1
PATCH 6/18 m68k: Replace setup_irq() by request_irq()
In reply to afzal mohammedrequest_irq() is preferred over setup_irq(). Existing callers of setup_irq() reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.
Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early interrupts were initialized.
Hence replace setup_irq() by request_irq().
Seldom remove_irq() usage has been observed coupled with setup_irq(), wherever that has been found, it too has been replaced by free_irq().
[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
---
Since cc'ing cover letter to all maintainers/reviewers would be too many, refer for cover letter,
https://lkml.kernel.org/r/[email protected]
arch/m68k/68000/timers.c | 9 ++------- arch/m68k/coldfire/pit.c | 9 ++------- arch/m68k/coldfire/sltimers.c | 19 +++++-------------- arch/m68k/coldfire/timers.c | 19 +++++-------------- 4 files changed, 14 insertions(+), 42 deletions(-)
arch/m68k/68000/timers.c +2 -7
@@ -68,12 +68,6 @@ static irqreturn_t hw_tick(int irq, void *dummy)/***************************************************************************/ -static struct irqaction m68328_timer_irq = { - .name ="timer" , - .flags =IRQF_TIMER , - .handler = hw_tick, -}; -/***************************************************************************/ static u64 m68328_read_clk (struct clocksource *cs)
@@ -106,7 +100,8 @@ void hw_timer_init(irq_handler_t handler)TCTL =0 ;/* set ISR */ -setup_irq (TMR_IRQ_NUM , &m68328_timer_irq); +if (request_irq (TMR_IRQ_NUM , hw_tick,IRQF_TIMER ,"timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"timer" );/* Restart mode, Enable int, Set clock source */ TCTL =TCTL_OM |TCTL_IRQEN |CLOCK_SOURCE ;
arch/m68k/coldfire/pit.c +2 -7
@@ -111,12 +111,6 @@ static irqreturn_t pit_tick(int irq, void *dummy)/***************************************************************************/ -static struct irqaction pit_irq = { - .name ="timer" , - .flags =IRQF_TIMER , - .handler = pit_tick, -}; -/***************************************************************************/ static u64 pit_read_clk (struct clocksource *cs)
@@ -156,7 +150,8 @@ void hw_timer_init(irq_handler_t handler) cf_pit_clockevent.min_delta_ticks =0x3f ;clockevents_register_device (&cf_pit_clockevent); -setup_irq (MCF_IRQ_PIT1 , &pit_irq); +if (request_irq (MCF_IRQ_PIT1 , pit_tick,IRQF_TIMER ,"timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"timer" );clocksource_register_hz (&pit_clk,FREQ ); }
arch/m68k/coldfire/sltimers.c +5 -14
@@ -50,18 +50,14 @@ irqreturn_t mcfslt_profile_tick(int irq, void *dummy)return IRQ_HANDLED ; } -static struct irqaction mcfslt_profile_irq = { - .name ="profile timer" , - .flags =IRQF_TIMER , - .handler = mcfslt_profile_tick, -}; -void mcfslt_profile_init (void ) {printk (KERN_INFO "PROFILE: lodging TIMER 1 @ %dHz as profile timer\n" ,PROFILEHZ ); -setup_irq (MCF_IRQ_PROFILER , &mcfslt_profile_irq); +if (request_irq (MCF_IRQ_PROFILER , mcfslt_profile_tick,IRQF_TIMER , +"profile timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"profile timer" );/* Set up TIMER 2 as high speed profile clock */ __raw_writel (MCF_BUSCLK /PROFILEHZ -1 ,PA (MCFSLT_STCNT ));
@@ -92,12 +88,6 @@ static irqreturn_t mcfslt_tick(int irq, void *dummy)return timer_interrupt (irq, dummy); } -static struct irqaction mcfslt_timer_irq = { - .name ="timer" , - .flags =IRQF_TIMER , - .handler = mcfslt_tick, -}; -static u64 mcfslt_read_clk (struct clocksource *cs) {unsigned long flags;
@@ -140,7 +130,8 @@ void hw_timer_init(irq_handler_t handler) mcfslt_cnt = mcfslt_cycles_per_jiffy; timer_interrupt = handler; -setup_irq (MCF_IRQ_TIMER , &mcfslt_timer_irq); +if (request_irq (MCF_IRQ_TIMER , mcfslt_tick,IRQF_TIMER ,"timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"timer" );clocksource_register_hz (&mcfslt_clk,MCF_BUSCLK );
arch/m68k/coldfire/timers.c +5 -14
@@ -82,12 +82,6 @@ static irqreturn_t mcftmr_tick(int irq, void *dummy)/***************************************************************************/ -static struct irqaction mcftmr_timer_irq = { - .name ="timer" , - .flags =IRQF_TIMER , - .handler = mcftmr_tick, -}; -/***************************************************************************/ static u64 mcftmr_read_clk (struct clocksource *cs)
@@ -134,7 +128,8 @@ void hw_timer_init(irq_handler_t handler) timer_interrupt = handler;init_timer_irq (); -setup_irq (MCF_IRQ_TIMER , &mcftmr_timer_irq); +if (request_irq (MCF_IRQ_TIMER , mcftmr_tick,IRQF_TIMER ,"timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"timer" );#ifdef CONFIG_HIGHPROFILE coldfire_profile_init ();
@@ -170,12 +165,6 @@ irqreturn_t coldfire_profile_tick(int irq, void *dummy)/***************************************************************************/ -static struct irqaction coldfire_profile_irq = { - .name ="profile timer" , - .flags =IRQF_TIMER , - .handler = coldfire_profile_tick, -}; -void coldfire_profile_init (void ) { printk(KERN_INFO "PROFILE: lodging TIMER2 @ %dHz as profile timer\n",
@@ -188,7 +177,9 @@ void coldfire_profile_init(void)__raw_writew (MCFTIMER_TMR_ENORI |MCFTIMER_TMR_CLK16 |MCFTIMER_TMR_RESTART |MCFTIMER_TMR_ENABLE ,PA (MCFTIMER_TMR )); -setup_irq (MCF_IRQ_PROFILER , &coldfire_profile_irq); +if (request_irq (MCF_IRQ_PROFILER , coldfire_profile_tick,IRQF_TIMER , +"profile timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"profile timer" ); }/***************************************************************************/
Signature · 1 line
2.24.1
PATCH 7/18 microblaze: Replace setup_irq() by request_irq()
In reply to afzal mohammedrequest_irq() is preferred over setup_irq(). Existing callers of setup_irq() reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.
Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early interrupts were initialized.
Hence replace setup_irq() by request_irq().
Seldom remove_irq() usage has been observed coupled with setup_irq(), wherever that has been found, it too has been replaced by free_irq().
[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
---
Since cc'ing cover letter to all maintainers/reviewers would be too many, refer for cover letter,
https://lkml.kernel.org/r/[email protected]
arch/microblaze/kernel/timer.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
arch/microblaze/kernel/timer.c +2 -8
@@ -161,13 +161,6 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction timer_irqaction = { - .handler = timer_interrupt, - .flags =IRQF_TIMER , - .name ="timer" , - .dev_id = &clockevent_xilinx_timer, -}; -static __init int xilinx_clockevent_init (void ) { clockevent_xilinx_timer.mult =
@@ -309,7 +302,8 @@ static int __init xilinx_timer_init(struct device_node *timer) freq_div_hz = timer_clock_freq /HZ ; - ret =setup_irq (irq, &timer_irqaction); + ret =request_irq (irq, timer_interrupt,IRQF_TIMER ,"timer" , + &clockevent_xilinx_timer);if (ret) {pr_err ("Failed to setup IRQ" );return ret;
Signature · 1 line
2.24.1
PATCH 8/18 MIPS: Replace setup_irq() by request_irq()
In reply to afzal mohammedrequest_irq() is preferred over setup_irq(). Existing callers of setup_irq() reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.
Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early interrupts were initialized.
Hence replace setup_irq() by request_irq().
Seldom remove_irq() usage has been observed coupled with setup_irq(), wherever that has been found, it too has been replaced by free_irq().
[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
---
Since cc'ing cover letter to all maintainers/reviewers would be too many, refer for cover letter,
https://lkml.kernel.org/r/[email protected]
arch/mips/alchemy/common/time.c | 11 +--- arch/mips/ar7/irq.c | 18 +++--- arch/mips/ath25/ar2315.c | 9 +-- arch/mips/ath25/ar5312.c | 9 +-- arch/mips/bcm63xx/irq.c | 38 +++++------- arch/mips/cobalt/irq.c | 14 ++--- arch/mips/dec/setup.c | 59 ++++++++----------- arch/mips/emma/markeins/irq.c | 20 +++---- arch/mips/include/asm/sni.h | 2 +- arch/mips/jazz/irq.c | 12 +--- arch/mips/kernel/cevt-bcm1480.c | 11 +--- arch/mips/kernel/cevt-ds1287.c | 9 +-- arch/mips/kernel/cevt-gt641xx.c | 9 +-- arch/mips/kernel/cevt-r4k.c | 4 +- arch/mips/kernel/cevt-sb1250.c | 11 +--- arch/mips/kernel/cevt-txx9.c | 11 +--- arch/mips/kernel/i8253.c | 10 +--- arch/mips/kernel/rtlx-mt.c | 8 +-- arch/mips/kernel/smp.c | 33 ++++------- arch/mips/lasat/interrupt.c | 10 +--- arch/mips/loongson2ef/common/bonito-irq.c | 9 +-- .../loongson2ef/common/cs5536/cs5536_mfgpt.c | 10 +--- arch/mips/loongson2ef/fuloong-2e/irq.c | 14 ++--- arch/mips/loongson2ef/lemote-2f/irq.c | 20 ++----- arch/mips/loongson32/common/irq.c | 21 ++++--- arch/mips/loongson32/common/time.c | 12 ++-- arch/mips/loongson64/hpet.c | 10 +--- arch/mips/mti-malta/malta-int.c | 10 +--- arch/mips/netlogic/xlr/fmn.c | 9 +-- arch/mips/pmcs-msp71xx/msp_irq.c | 28 ++++----- arch/mips/pmcs-msp71xx/msp_smp.c | 22 ++----- arch/mips/pmcs-msp71xx/msp_time.c | 7 ++- arch/mips/ralink/cevt-rt3352.c | 17 +++--- arch/mips/sgi-ip22/ip22-eisa.c | 8 +-- arch/mips/sgi-ip22/ip22-int.c | 49 +++++---------- arch/mips/sgi-ip32/ip32-irq.c | 18 ++---- arch/mips/sni/a20r.c | 4 +- arch/mips/sni/irq.c | 8 +-- arch/mips/sni/pcit.c | 8 ++- arch/mips/sni/rm200.c | 23 +++----- arch/mips/sni/time.c | 10 +--- arch/mips/vr41xx/common/irq.c | 9 +-- 42 files changed, 228 insertions(+), 406 deletions(-)
arch/mips/alchemy/common/time.c +3 -8
@@ -72,13 +72,6 @@ static struct clock_event_device au1x_rtcmatch2_clockdev = { .cpumask = cpu_possible_mask, }; -static struct irqaction au1x_rtcmatch2_irqaction = { - .handler = au1x_rtcmatch2_irq, - .flags =IRQF_TIMER , - .name ="timer" , - .dev_id = &au1x_rtcmatch2_clockdev, -}; -static int __init alchemy_time_init (unsigned int m2int) {struct clock_event_device *cd = &au1x_rtcmatch2_clockdev;
@@ -130,7 +123,9 @@ static int __init alchemy_time_init(unsigned int m2int) cd->min_delta_ns =clockevent_delta2ns (9 , cd); cd->min_delta_ticks =9 ;/* ~0.28ms */ clockevents_register_device (cd); -setup_irq (m2int, &au1x_rtcmatch2_irqaction); +if (request_irq (m2int, au1x_rtcmatch2_irq,IRQF_TIMER ,"timer" , + &au1x_rtcmatch2_clockdev)) +pr_err ("request_irq() on %s failed\n" ,"timer" );printk (KERN_INFO "Alchemy clocksource installed\n" );
arch/mips/ar7/irq.c +10 -8
@@ -83,12 +83,6 @@ static struct irq_chip ar7_sec_irq_type = { .irq_ack = ar7_ack_sec_irq, }; -static struct irqaction ar7_cascade_action = { - .handler = no_action, - .name ="AR7 cascade interrupt" , - .flags =IRQF_NO_THREAD , -}; -static void __init ar7_irq_init (int base) {int i;
@@ -116,8 +110,16 @@ static void __init ar7_irq_init(int base) handle_level_irq); } -setup_irq (2 , &ar7_cascade_action); -setup_irq (ar7_irq_base, &ar7_cascade_action); +if (request_irq (2 , no_action,IRQF_NO_THREAD ,"AR7 cascade interrupt" , +NULL )) { +pr_err ("request_irq() on %s failed\n" , +"AR7 cascade interrupt" ); + } +if (request_irq (ar7_irq_base, no_action,IRQF_NO_THREAD , +"AR7 cascade interrupt" ,NULL )) { +pr_err ("request_irq() on %s failed\n" , +"AR7 cascade interrupt" ); + }set_c0_status (IE_IRQ0 ); }
arch/mips/ath25/ar2315.c +3 -6
@@ -64,11 +64,6 @@ static irqreturn_t ar2315_ahb_err_handler(int cpl, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction ar2315_ahb_err_interrupt = { - .handler = ar2315_ahb_err_handler, - .name ="ar2315-ahb-error" , -}; -static void ar2315_misc_irq_handler (struct irq_desc *desc) { u32 pending = ar2315_rst_reg_read(AR2315_ISR) &
@@ -159,7 +154,9 @@ void __init ar2315_arch_init_irq(void)panic ("Failed to add IRQ domain" ); irq =irq_create_mapping (domain,AR2315_MISC_IRQ_AHB ); -setup_irq (irq, &ar2315_ahb_err_interrupt); +if (request_irq (irq, ar2315_ahb_err_handler,0 ,"ar2315-ahb-error" , +NULL )) +pr_err ("request_irq() on %s failed\n" ,"ar2315-ahb-error" );irq_set_chained_handler_and_data (AR2315_IRQ_MISC , ar2315_misc_irq_handler, domain);
arch/mips/ath25/ar5312.c +3 -6
@@ -68,11 +68,6 @@ static irqreturn_t ar5312_ahb_err_handler(int cpl, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction ar5312_ahb_err_interrupt = { - .handler = ar5312_ahb_err_handler, - .name ="ar5312-ahb-error" , -}; -static void ar5312_misc_irq_handler (struct irq_desc *desc) { u32 pending = ar5312_rst_reg_read(AR5312_ISR) &
@@ -154,7 +149,9 @@ void __init ar5312_arch_init_irq(void)panic ("Failed to add IRQ domain" ); irq =irq_create_mapping (domain,AR5312_MISC_IRQ_AHB_PROC ); -setup_irq (irq, &ar5312_ahb_err_interrupt); +if (request_irq (irq, ar5312_ahb_err_handler,0 ,"ar5312-ahb-error" , +NULL )) +pr_err ("request_irq() on %s failed\n" ,"ar5312-ahb-error" );irq_set_chained_handler_and_data (AR5312_IRQ_MISC , ar5312_misc_irq_handler, domain);
arch/mips/bcm63xx/irq.c +14 -24
@@ -399,26 +399,6 @@ static struct irq_chip bcm63xx_external_irq_chip = { .irq_set_type = bcm63xx_external_irq_set_type, }; -static struct irqaction cpu_ip2_cascade_action = { - .handler = no_action, - .name ="cascade_ip2" , - .flags =IRQF_NO_THREAD , -}; - -#ifdef CONFIG_SMP -static struct irqaction cpu_ip3_cascade_action = { - .handler = no_action, - .name ="cascade_ip3" , - .flags =IRQF_NO_THREAD , -}; -#endif - -static struct irqaction cpu_ext_cascade_action = { - .handler = no_action, - .name ="cascade_extirq" , - .flags =IRQF_NO_THREAD , -}; -static void bcm63xx_init_irq (void ) {int irq_bits;
@@ -544,14 +524,24 @@ void __init arch_init_irq(void) handle_edge_irq);if (!is_ext_irq_cascaded) { -for (i =3 ; i <3 + ext_irq_count; ++i) -setup_irq (MIPS_CPU_IRQ_BASE + i, &cpu_ext_cascade_action); +for (i =3 ; i <3 + ext_irq_count; ++i) { +if (request_irq (MIPS_CPU_IRQ_BASE + i, no_action, +IRQF_NO_THREAD ,"cascade_extirq" , +NULL )) { +pr_err ("request_irq() on %s failed\n" , +"cascade_extirq" ); + } + } } -setup_irq (MIPS_CPU_IRQ_BASE +2 , &cpu_ip2_cascade_action); +if (request_irq (MIPS_CPU_IRQ_BASE +2 , no_action,IRQF_NO_THREAD , +"cascade_ip2" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"cascade_ip2" );#ifdef CONFIG_SMP if (is_ext_irq_cascaded) { -setup_irq (MIPS_CPU_IRQ_BASE +3 , &cpu_ip3_cascade_action); +if (request_irq (MIPS_CPU_IRQ_BASE +3 , no_action, +IRQF_NO_THREAD ,"cascade_ip3" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"cascade_ip3" ); bcm63xx_internal_irq_chip.irq_set_affinity = bcm63xx_internal_set_affinity;
arch/mips/cobalt/irq.c +6 -8
@@ -45,18 +45,16 @@ asmlinkage void plat_irq_dispatch(void)spurious_interrupt (); } -static struct irqaction cascade = { - .handler = no_action, - .name ="cascade" , - .flags =IRQF_NO_THREAD , -}; -void __init arch_init_irq (void ) {mips_cpu_irq_init ();gt641xx_irq_init ();init_i8259_irqs (); -setup_irq (GT641XX_CASCADE_IRQ , &cascade); -setup_irq (I8259_CASCADE_IRQ , &cascade); +if (request_irq (GT641XX_CASCADE_IRQ , no_action,IRQF_NO_THREAD , +"cascade" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"cascade" ); +if (request_irq (I8259_CASCADE_IRQ , no_action,IRQF_NO_THREAD , +"cascade" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"cascade" ); }
arch/mips/dec/setup.c +24 -35
93 lines not on this page · raw message
arch/mips/emma/markeins/irq.c +9 -11
@@ -153,14 +153,6 @@ void emma2rh_gpio_irq_init(void) handle_edge_irq, "edge"); } -static struct irqaction irq_cascade = { - .handler = no_action, - .flags =IRQF_NO_THREAD , - .name ="cascade" , - .dev_id =NULL , - .next =NULL , -}; -/* * the first level int-handler will jump here if it is a emma2rh irq */
@@ -272,9 +264,15 @@ void __init arch_init_irq(void)mips_cpu_irq_init ();/* setup cascade interrupts */ -setup_irq (EMMA2RH_IRQ_BASE +EMMA2RH_SW_CASCADE , &irq_cascade); -setup_irq (EMMA2RH_IRQ_BASE +EMMA2RH_GPIO_CASCADE , &irq_cascade); -setup_irq (MIPS_CPU_IRQ_BASE +2 , &irq_cascade); +if (request_irq (EMMA2RH_IRQ_BASE +EMMA2RH_SW_CASCADE , no_action, +IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"cascade" ); +if (request_irq (EMMA2RH_IRQ_BASE +EMMA2RH_GPIO_CASCADE , no_action, +IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"cascade" ); +if (request_irq (MIPS_CPU_IRQ_BASE +2 , no_action,IRQF_NO_THREAD , +"cascade" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"cascade" ); } asmlinkage void plat_irq_dispatch(void)
arch/mips/include/asm/sni.h +1 -1
@@ -239,6 +239,6 @@ static inline int sni_eisa_root_init(void)/* common irq stuff */ extern void (*sni_hwint)(void ); -extern struct irqaction sni_isa_irq; +extern irqreturn_t sni_isa_irq_handler (int dummy,void *p);#endif /* __ASM_SNI_H */
arch/mips/jazz/irq.c +3 -9
@@ -125,24 +125,18 @@ static irqreturn_t r4030_timer_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction r4030_timer_irqaction = { - .handler = r4030_timer_interrupt, - .flags =IRQF_TIMER , - .name ="R4030 timer" , -}; -void __init plat_time_init (void ) {struct clock_event_device *cd = &r4030_clockevent; -struct irqaction *action = &r4030_timer_irqaction;unsigned int cpu =smp_processor_id ();BUG_ON (HZ !=100 ); cd->cpumask =cpumask_of (cpu);clockevents_register_device (cd); - action->dev_id = cd; -setup_irq (JAZZ_TIMER_IRQ , action); +if (request_irq (JAZZ_TIMER_IRQ , r4030_timer_interrupt,IRQF_TIMER , +"R4030 timer" , cd)) +pr_err ("request_irq() on %s failed\n" ,"R4030 timer" );/* * Set clock to 100Hz.
arch/mips/kernel/cevt-bcm1480.c +3 -8
@@ -91,14 +91,12 @@ static irqreturn_t sibyte_counter_handler(int irq, void *dev_id) } static DEFINE_PER_CPU(struct clock_event_device, sibyte_hpt_clockevent); -static DEFINE_PER_CPU(struct irqaction, sibyte_hpt_irqaction); static DEFINE_PER_CPU(char [18], sibyte_hpt_name);void sb1480_clockevent_init (void ) {unsigned int cpu =smp_processor_id ();unsigned int irq =K_BCM1480_INT_TIMER_0 + cpu; -struct irqaction *action = &per_cpu (sibyte_hpt_irqaction, cpu);struct clock_event_device *cd = &per_cpu (sibyte_hpt_clockevent, cpu);unsigned char *name =per_cpu (sibyte_hpt_name, cpu);
@@ -133,11 +131,8 @@ void sb1480_clockevent_init(void)bcm1480_unmask_irq (cpu, irq); - action->handler = sibyte_counter_handler; - action->flags =IRQF_PERCPU |IRQF_TIMER ; - action->name = name; - action->dev_id = cd; -irq_set_affinity (irq,cpumask_of (cpu)); -setup_irq (irq, action); +if (request_irq (irq, sibyte_counter_handler,IRQF_PERCPU |IRQF_TIMER , + name, cd)) +pr_err ("request_irq() on %s failed\n" , name); }
arch/mips/kernel/cevt-ds1287.c +2 -7
@@ -100,12 +100,6 @@ static irqreturn_t ds1287_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction ds1287_irqaction = { - .handler = ds1287_interrupt, - .flags =IRQF_PERCPU |IRQF_TIMER , - .name ="ds1287" , -}; -int __init ds1287_clockevent_init (int irq) {struct clock_event_device *cd;
@@ -122,5 +116,6 @@ int __init ds1287_clockevent_init(int irq)clockevents_register_device (&ds1287_clockevent); -return setup_irq (irq, &ds1287_irqaction); +return request_irq (irq, ds1287_interrupt,IRQF_PERCPU |IRQF_TIMER , +"ds1287" ,NULL ); }
arch/mips/kernel/cevt-gt641xx.c +2 -7
@@ -120,12 +120,6 @@ static irqreturn_t gt641xx_timer0_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction gt641xx_timer0_irqaction = { - .handler = gt641xx_timer0_interrupt, - .flags =IRQF_PERCPU |IRQF_TIMER , - .name ="gt641xx_timer0" , -}; -static int __init gt641xx_timer0_clockevent_init (void ) {struct clock_event_device *cd;
@@ -146,6 +140,7 @@ static int __init gt641xx_timer0_clockevent_init(void)clockevents_register_device (>641xx_timer0_clockevent); -return setup_irq (GT641XX_TIMER0_IRQ , >641xx_timer0_irqaction); +return request_irq (GT641XX_TIMER0_IRQ , gt641xx_timer0_interrupt, +IRQF_PERCPU |IRQF_TIMER ,"gt641xx_timer0" ,NULL ); }arch_initcall (gt641xx_timer0_clockevent_init);
arch/mips/kernel/cevt-r4k.c +3 -1
@@ -291,7 +291,9 @@ int r4k_clockevent_init(void) cp0_timer_irq_installed =1 ; -setup_irq (irq, &c0_compare_irqaction); +if (request_irq (irq, c0_compare_interrupt, +IRQF_PERCPU |IRQF_TIMER |IRQF_SHARED ,"timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"timer" );return 0 ; }
arch/mips/kernel/cevt-sb1250.c +3 -8
@@ -90,14 +90,12 @@ static irqreturn_t sibyte_counter_handler(int irq, void *dev_id) } static DEFINE_PER_CPU(struct clock_event_device, sibyte_hpt_clockevent); -static DEFINE_PER_CPU(struct irqaction, sibyte_hpt_irqaction); static DEFINE_PER_CPU(char [18], sibyte_hpt_name);void sb1250_clockevent_init (void ) {unsigned int cpu =smp_processor_id ();unsigned int irq =K_INT_TIMER_0 + cpu; -struct irqaction *action = &per_cpu (sibyte_hpt_irqaction, cpu);struct clock_event_device *cd = &per_cpu (sibyte_hpt_clockevent, cpu);unsigned char *name =per_cpu (sibyte_hpt_name, cpu);
@@ -133,11 +131,8 @@ void sb1250_clockevent_init(void)sb1250_unmask_irq (cpu, irq); - action->handler = sibyte_counter_handler; - action->flags =IRQF_PERCPU |IRQF_TIMER ; - action->name = name; - action->dev_id = cd; -irq_set_affinity (irq,cpumask_of (cpu)); -setup_irq (irq, action); +if (request_irq (irq, sibyte_counter_handler,IRQF_PERCPU |IRQF_TIMER , + name, cd)) +pr_err ("request_irq() on %s failed\n" , name); }
arch/mips/kernel/cevt-txx9.c +3 -8
@@ -174,13 +174,6 @@ static irqreturn_t txx9tmr_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction txx9tmr_irq = { - .handler = txx9tmr_interrupt, - .flags =IRQF_PERCPU |IRQF_TIMER , - .name ="txx9tmr" , - .dev_id = &txx9_clock_event_device, -}; -void __init txx9_clockevent_init (unsigned long baseaddr,int irq,unsigned int imbusclk) {
@@ -202,7 +195,9 @@ void __init txx9_clockevent_init(unsigned long baseaddr, int irq, cd->irq = irq; cd->cpumask =cpumask_of (0 ),clockevents_register_device (cd); -setup_irq (irq, &txx9tmr_irq); +if (request_irq (irq, txx9tmr_interrupt,IRQF_PERCPU |IRQF_TIMER , +"txx9tmr" , &txx9_clock_event_device)) +pr_err ("request_irq() on %s failed\n" ,"txx9tmr" );printk (KERN_INFO "TXx9: clockevent device at 0x%lx, irq %d\n" , baseaddr, irq); }
arch/mips/kernel/i8253.c +3 -7
@@ -18,16 +18,12 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction irq0 = { - .handler = timer_interrupt, - .flags =IRQF_NOBALANCING |IRQF_TIMER , - .name ="timer" -}; -void __init setup_pit_timer (void ) {clockevent_i8253_init (true); -setup_irq (0 , &irq0); +if (request_irq (0 , timer_interrupt,IRQF_NOBALANCING |IRQF_TIMER , +"timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"timer" ); }static int __init init_pit_clocksource (void )
arch/mips/kernel/rtlx-mt.c +1 -7
@@ -51,11 +51,6 @@ static irqreturn_t rtlx_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction rtlx_irq = { - .handler = rtlx_interrupt, - .name ="RTLX" , -}; -static int rtlx_irq_num =MIPS_CPU_IRQ_BASE +MIPS_CPU_RTLX_IRQ ;void _interrupt_sp (void )
@@ -124,8 +119,7 @@ int __init rtlx_module_init(void) goto out_class; } - rtlx_irq.dev_id = rtlx; - err =setup_irq (rtlx_irq_num, &rtlx_irq); + err =request_irq (rtlx_irq_num, rtlx_interrupt,0 ,"RTLX" , rtlx);if (err) goto out_class;
arch/mips/kernel/smp.c +12 -21
@@ -207,25 +207,13 @@ static irqreturn_t ipi_call_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction irq_resched = { - .handler = ipi_resched_interrupt, - .flags =IRQF_PERCPU , - .name ="IPI resched" -}; - -static struct irqaction irq_call = { - .handler = ipi_call_interrupt, - .flags =IRQF_PERCPU , - .name ="IPI call" -}; - -static void smp_ipi_init_one (unsigned int virq, -struct irqaction *action) +static void smp_ipi_init_one (unsigned int virq,const char *name, +irq_handler_t handler) {int ret;irq_set_handler (virq, handle_percpu_irq); - ret =setup_irq (virq, action); + ret =request_irq (virq, handler,IRQF_PERCPU , name,NULL );BUG_ON (ret); }
@@ -278,12 +266,15 @@ int mips_smp_ipi_allocate(const struct cpumask *mask)int cpu;for_each_cpu (cpu, mask) { -smp_ipi_init_one (call_virq + cpu, &irq_call); -smp_ipi_init_one (sched_virq + cpu, &irq_resched); +smp_ipi_init_one (call_virq + cpu,"IPI call" , + ipi_call_interrupt); +smp_ipi_init_one (sched_virq + cpu,"IPI resched" , + ipi_resched_interrupt); } }else { -smp_ipi_init_one (call_virq, &irq_call); -smp_ipi_init_one (sched_virq, &irq_resched); +smp_ipi_init_one (call_virq,"IPI call" , ipi_call_interrupt); +smp_ipi_init_one (sched_virq,"IPI resched" , + ipi_resched_interrupt); }return 0 ;
@@ -311,8 +302,8 @@ int mips_smp_ipi_free(const struct cpumask *mask)int cpu;for_each_cpu (cpu, mask) { -remove_irq (call_virq + cpu, &irq_call); -remove_irq (sched_virq + cpu, &irq_resched); +free_irq (call_virq + cpu,NULL ); +free_irq (sched_virq + cpu,NULL ); } }irq_destroy_ipi (call_virq, mask);
arch/mips/lasat/interrupt.c +3 -7
@@ -90,12 +90,6 @@ asmlinkage void plat_irq_dispatch(void) } } -static struct irqaction cascade = { - .handler = no_action, - .name ="cascade" , - .flags =IRQF_NO_THREAD , -}; -void __init arch_init_irq (void ) {int i;
@@ -119,5 +113,7 @@ void __init arch_init_irq(void)for (i =LASAT_IRQ_BASE ; i <=LASAT_IRQ_END ; i++)irq_set_chip_and_handler (i, &lasat_irq_type, handle_level_irq); -setup_irq (LASAT_CASCADE_IRQ , &cascade); +if (request_irq (LASAT_CASCADE_IRQ , no_action,IRQF_NO_THREAD ,"cascade" , +NULL )) +pr_err ("request_irq() on %s failed\n" ,"cascade" ); }
arch/mips/loongson2ef/common/bonito-irq.c +3 -6
@@ -30,11 +30,6 @@ static struct irq_chip bonito_irq_type = { .irq_unmask = bonito_irq_enable, }; -static struct irqaction __maybe_unused dma_timeout_irqaction = { - .handler = no_action, - .name ="dma_timeout" , -}; -void bonito_irq_init (void ) {u32 i;
@@ -44,6 +39,8 @@ void bonito_irq_init(void) handle_level_irq);#ifdef CONFIG_CPU_LOONGSON2E -setup_irq (LOONGSON_IRQ_BASE +10 , &dma_timeout_irqaction); +if (request_irq (LOONGSON_IRQ_BASE +10 , no_action,0 ,"dma_timeout" , +NULL )) +pr_err ("request_irq() on %s failed\n" ,"dma_timeout" );#endif }
arch/mips/loongson2ef/common/cs5536/cs5536_mfgpt.c +3 -7
@@ -100,12 +100,6 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction irq5 = { - .handler = timer_interrupt, - .flags =IRQF_NOBALANCING |IRQF_TIMER , - .name ="timer" -}; -/* * Initialize the conversion factor and the min/max deltas of the clock event * structure and register the clock event source with the framework.
@@ -134,7 +128,9 @@ void __init setup_mfgpt0_timer(void)clockevents_register_device (cd); -setup_irq (CS5536_MFGPT_INTR , &irq5); +if (request_irq (CS5536_MFGPT_INTR , timer_interrupt, +IRQF_NOBALANCING |IRQF_TIMER ,"timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"timer" ); }/*
arch/mips/loongson2ef/fuloong-2e/irq.c +6 -8
@@ -35,12 +35,6 @@ asmlinkage void mach_irq_dispatch(unsigned int pending)spurious_interrupt (); } -static struct irqaction cascade_irqaction = { - .handler = no_action, - .name ="cascade" , - .flags =IRQF_NO_THREAD , -}; -void __init mach_init_irq (void ) {/* init all controller
@@ -59,7 +53,11 @@ void __init mach_init_irq(void)bonito_irq_init ();/* bonito irq at IP2 */ -setup_irq (MIPS_CPU_IRQ_BASE +2 , &cascade_irqaction); +if (request_irq (MIPS_CPU_IRQ_BASE +2 , no_action,IRQF_NO_THREAD , +"cascade" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"cascade" );/* 8259 irq at IP5 */ -setup_irq (MIPS_CPU_IRQ_BASE +5 , &cascade_irqaction); +if (request_irq (MIPS_CPU_IRQ_BASE +5 , no_action,IRQF_NO_THREAD , +"cascade" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"cascade" ); }
arch/mips/loongson2ef/lemote-2f/irq.c +6 -14
@@ -90,18 +90,6 @@ static irqreturn_t ip6_action(int cpl, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction ip6_irqaction = { - .handler = ip6_action, - .name ="cascade" , - .flags =IRQF_SHARED |IRQF_NO_THREAD , -}; - -static struct irqaction cascade_irqaction = { - .handler = no_action, - .name ="cascade" , - .flags =IRQF_NO_THREAD |IRQF_NO_SUSPEND , -}; -void __init mach_init_irq (void ) {/* init all controller
@@ -120,7 +108,11 @@ void __init mach_init_irq(void)bonito_irq_init ();/* setup north bridge irq (bonito) */ -setup_irq (LOONGSON_NORTH_BRIDGE_IRQ , &ip6_irqaction); +if (request_irq (LOONGSON_NORTH_BRIDGE_IRQ , ip6_action, +IRQF_SHARED |IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"cascade" );/* setup source bridge irq (i8259) */ -setup_irq (LOONGSON_SOUTH_BRIDGE_IRQ , &cascade_irqaction); +if (request_irq (LOONGSON_SOUTH_BRIDGE_IRQ , no_action, +IRQF_NO_THREAD |IRQF_NO_SUSPEND ,"cascade" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"cascade" ); }
arch/mips/loongson32/common/irq.c +10 -11
@@ -149,12 +149,6 @@ asmlinkage void plat_irq_dispatch(void) } -static struct irqaction cascade_irqaction = { - .handler = no_action, - .name ="cascade" , - .flags =IRQF_NO_THREAD , -}; -static void __init ls1x_irq_init (int base) {int n;
@@ -176,12 +170,17 @@ static void __init ls1x_irq_init(int base) handle_level_irq); } -setup_irq (INT0_IRQ , &cascade_irqaction); -setup_irq (INT1_IRQ , &cascade_irqaction); -setup_irq (INT2_IRQ , &cascade_irqaction); -setup_irq (INT3_IRQ , &cascade_irqaction); +if (request_irq (INT0_IRQ , no_action,IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"cascade" ); +if (request_irq (INT1_IRQ , no_action,IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"cascade" ); +if (request_irq (INT2_IRQ , no_action,IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"cascade" ); +if (request_irq (INT3_IRQ , no_action,IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"cascade" );#if defined(CONFIG_LOONGSON1_LS1C ) -setup_irq (INT4_IRQ , &cascade_irqaction); +if (request_irq (INT4_IRQ , no_action,IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"cascade" );#endif }
arch/mips/loongson32/common/time.c +4 -8
@@ -176,13 +176,6 @@ static struct clock_event_device ls1x_clockevent = { .tick_resume = ls1x_clockevent_tick_resume, }; -static struct irqaction ls1x_pwmtimer_irqaction = { - .name ="ls1x-pwmtimer" , - .handler = ls1x_clockevent_isr, - .dev_id = &ls1x_clockevent, - .flags =IRQF_PERCPU |IRQF_TIMER , -}; -static void __init ls1x_time_init (void ) {struct clock_event_device *cd = &ls1x_clockevent;
@@ -206,7 +199,10 @@ static void __init ls1x_time_init(void)if (ret)panic (KERN_ERR "Failed to register clocksource: %d\n" , ret); - setup_irq(LS1X_TIMER_IRQ, &ls1x_pwmtimer_irqaction); +if (request_irq (LS1X_TIMER_IRQ , ls1x_clockevent_isr, +IRQF_PERCPU |IRQF_TIMER ,"ls1x-pwmtimer" , + &ls1x_clockevent)) + pr_err("request_irq() on %s failed\n", "ls1x-pwmtimer"); }#endif /* CONFIG_CEVT_CSRC_LS1X */
arch/mips/loongson64/hpet.c +3 -7
@@ -187,12 +187,6 @@ static irqreturn_t hpet_irq_handler(int irq, void *data)return IRQ_NONE ; } -static struct irqaction hpet_irq = { - .handler = hpet_irq_handler, - .flags =IRQF_NOBALANCING |IRQF_TIMER , - .name ="hpet" , -}; -/* * hpet address assignation and irq setting should be done in bios. * but pmon don't do this, we just setup here directly.
@@ -247,7 +241,9 @@ void __init setup_hpet_timer(void) cd->min_delta_ticks =HPET_MIN_PROG_DELTA ;clockevents_register_device (cd); -setup_irq (HPET_T0_IRQ , &hpet_irq); +if (request_irq (HPET_T0_IRQ , hpet_irq_handler, +IRQF_NOBALANCING |IRQF_TIMER ,"hpet" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"hpet" );pr_info ("hpet clock event device register\n" ); }
arch/mips/mti-malta/malta-int.c +3 -7
@@ -144,12 +144,6 @@ static irqreturn_t corehi_handler(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction corehi_irqaction = { - .handler = corehi_handler, - .name ="CoreHi" , - .flags =IRQF_NO_THREAD , -}; -static msc_irqmap_t msc_irqmap[]__initdata = { {MSC01C_INT_TMR ,MSC01_IRQ_EDGE ,0 }, {MSC01C_INT_PCI ,MSC01_IRQ_LEVEL ,0 },
@@ -223,5 +217,7 @@ void __init arch_init_irq(void) corehi_irq =MIPS_CPU_IRQ_BASE +MIPSCPU_INT_COREHI ; } -setup_irq (corehi_irq, &corehi_irqaction); +if (request_irq (corehi_irq, corehi_handler,IRQF_NO_THREAD ,"CoreHi" , +NULL )) +pr_err ("request_irq() on %s failed\n" ,"CoreHi" ); }
arch/mips/netlogic/xlr/fmn.c +2 -7
@@ -110,12 +110,6 @@ static irqreturn_t fmn_message_handler(int irq, void *data)return IRQ_HANDLED ; } -struct irqaction fmn_irqaction = { - .handler = fmn_message_handler, - .flags =IRQF_PERCPU , - .name ="fmn" , -}; -void xlr_percpu_fmn_init (void ) {struct xlr_fmn_info *cpu_fmn_info;
@@ -196,7 +190,8 @@ void nlm_setup_fmn_irq(void)uint32_t flags;/* setup irq only once */ -setup_irq (IRQ_FMN , &fmn_irqaction); +if (request_irq (IRQ_FMN , fmn_message_handler,IRQF_PERCPU ,"fmn" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"fmn" ); flags =nlm_cop2_enable_irqsave ();nlm_fmn_setup_intr (IRQ_FMN , (1 << nlm_threads_per_core) -1 );
arch/mips/pmcs-msp71xx/msp_irq.c +12 -16
@@ -107,18 +107,6 @@ asmlinkage void plat_irq_dispatch(void)do_IRQ (MSP_INT_SW1 ); } -static struct irqaction cic_cascade_msp = { - .handler = no_action, - .name ="MSP CIC cascade" , - .flags =IRQF_NO_THREAD , -}; - -static struct irqaction per_cascade_msp = { - .handler = no_action, - .name ="MSP PER cascade" , - .flags =IRQF_NO_THREAD , -}; -void __init arch_init_irq (void ) {/* assume we'll be using vectored interrupt mode except in UP mode*/
@@ -142,8 +130,12 @@ void __init arch_init_irq(void)#endif /* CONFIG_MIPS_MT_SMP */ #endif /* CONFIG_MIPS_MT */ /* setup the cascaded interrupts */ -setup_irq (MSP_INT_CIC , &cic_cascade_msp); -setup_irq (MSP_INT_PER , &per_cascade_msp); +if (request_irq (MSP_INT_CIC , no_action,IRQF_NO_THREAD , +"MSP CIC cascade" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"MSP CIC cascade" ); +if (request_irq (MSP_INT_PER , no_action,IRQF_NO_THREAD , +"MSP PER cascade" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"MSP PER cascade" );#else /*
@@ -153,7 +145,11 @@ void __init arch_init_irq(void)msp_slp_irq_init ();/* setup the cascaded SLP/PER interrupts */ -setup_irq (MSP_INT_SLP , &cic_cascade_msp); -setup_irq (MSP_INT_PER , &per_cascade_msp); +if (request_irq (MSP_INT_SLP , no_action,IRQF_NO_THREAD , +"MSP CIC cascade" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"MSP CIC cascade" ); +if (request_irq (MSP_INT_PER , no_action,IRQF_NO_THREAD , +"MSP PER cascade" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"MSP PER cascade" );#endif }
arch/mips/pmcs-msp71xx/msp_smp.c +6 -16
@@ -38,21 +38,10 @@ static irqreturn_t ipi_call_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction irq_resched = { - .handler = ipi_resched_interrupt, - .flags =IRQF_PERCPU , - .name ="IPI_resched" -}; - -static struct irqaction irq_call = { - .handler = ipi_call_interrupt, - .flags =IRQF_PERCPU , - .name ="IPI_call" -}; - -void __init arch_init_ipiirq (int irq,struct irqaction *action) +void __init arch_init_ipiirq (int irq,const char *name,irq_handler_t handler) { -setup_irq (irq, action); +if (request_irq (irq, handler,IRQF_PERCPU , name,NULL )) +pr_err ("request_irq() on %s failed\n" , name);irq_set_handler (irq, handle_percpu_irq); }
@@ -60,7 +49,8 @@ void __init msp_vsmp_int_init(void) {set_vi_handler (MIPS_CPU_IPI_RESCHED_IRQ , ipi_resched_dispatch);set_vi_handler (MIPS_CPU_IPI_CALL_IRQ , ipi_call_dispatch); -arch_init_ipiirq (MIPS_CPU_IPI_RESCHED_IRQ , &irq_resched); -arch_init_ipiirq (MIPS_CPU_IPI_CALL_IRQ , &irq_call); +arch_init_ipiirq (MIPS_CPU_IPI_RESCHED_IRQ ,"IPI_resched" , + ipi_resched_interrupt); +arch_init_ipiirq (MIPS_CPU_IPI_CALL_IRQ ,"IPI_call" , ipi_call_interrupt); }#endif /* CONFIG_MIPS_MT_SMP */
arch/mips/pmcs-msp71xx/msp_time.c +4 -3
@@ -27,7 +27,6 @@#define get_current_vpe () \ ((read_c0_tcbind() >> TCBIND_CURVPE_SHIFT) & TCBIND_CURVPE) -static struct irqaction timer_vpe1;static int tim_installed;void __init plat_time_init (void )
@@ -79,8 +78,10 @@ unsigned int get_c0_compare_int(void) {/* MIPS_MT modes may want timer for second VPE */ if ((get_current_vpe ()) && !tim_installed) { -memcpy (&timer_vpe1, &c0_compare_irqaction,sizeof (timer_vpe1)); -setup_irq (MSP_INT_VPE1_TIMER , &timer_vpe1); +if (request_irq (MSP_INT_VPE1_TIMER , c0_compare_interrupt, +IRQF_PERCPU |IRQF_TIMER |IRQF_SHARED ,"timer" , +NULL )) +pr_err ("request_irq() on %s failed\n" ,"timer" ); tim_installed++; }
arch/mips/ralink/cevt-rt3352.c +8 -9
@@ -82,12 +82,6 @@ static struct systick_device systick = { }, }; -static struct irqaction systick_irqaction = { - .handler = systick_interrupt, - .flags =IRQF_PERCPU |IRQF_TIMER , - .dev_id = &systick.dev, -}; -static int systick_shutdown (struct clock_event_device *evt) {struct systick_device *sdev;
@@ -108,8 +102,14 @@ static int systick_set_oneshot(struct clock_event_device *evt) sdev = container_of(evt, struct systick_device, dev); -if (!sdev->irq_requested) -setup_irq (systick.dev.irq, &systick_irqaction); +if (!sdev->irq_requested) { +if (request_irq (systick.dev.irq, systick_interrupt, +IRQF_PERCPU |IRQF_TIMER , systick.dev.name, + &systick.dev)) { +pr_err ("request_irq() on %s failed\n" , + systick.dev.name); + } + } sdev->irq_requested =1 ;iowrite32 (CFG_EXT_STK_EN |CFG_CNT_EN , systick.membase +SYSTICK_CONFIG );
@@ -125,7 +125,6 @@ static int __init ralink_systick_init(struct device_node *np)if (!systick.membase)return -ENXIO ; - systick_irqaction.name = np->name; systick.dev.name = np->name;clockevents_calc_mult_shift (&systick.dev,SYSTICK_FREQ ,60 ); systick.dev.max_delta_ns =clockevent_delta2ns (0x7fff , &systick.dev);
arch/mips/sgi-ip22/ip22-eisa.c +2 -6
@@ -92,11 +92,6 @@ static irqreturn_t ip22_eisa_intr(int irq, void *dev_id)return IRQ_NONE ; } -static struct irqaction eisa_action = { - .handler = ip22_eisa_intr, - .name ="EISA" , -}; -int __init ip22_eisa_init (void ) {int i, c;
@@ -138,7 +133,8 @@ int __init ip22_eisa_init(void)/* Cannot use request_irq because of kmalloc not being ready at such * an early stage. Yes, I've been bitten... */ -setup_irq (SGI_EISA_IRQ , &eisa_action); +if (request_irq (SGI_EISA_IRQ , ip22_eisa_intr,0 ,"EISA" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"EISA" ); EISA_bus =1 ;return 0 ;
arch/mips/sgi-ip22/ip22-int.c +15 -34
65 lines not on this page · raw message
arch/mips/sgi-ip32/ip32-irq.c +6 -12
@@ -111,16 +111,6 @@ static inline void flush_mace_bus(void)extern irqreturn_t crime_memerr_intr (int irq,void *dev_id);extern irqreturn_t crime_cpuerr_intr (int irq,void *dev_id); -static struct irqaction memerr_irq = { - .handler = crime_memerr_intr, - .name ="CRIME memory error" , -}; - -static struct irqaction cpuerr_irq = { - .handler = crime_cpuerr_intr, - .name ="CRIME CPU error" , -}; -/* * This is for pure CRIME interrupts - ie not MACE. The advantage? * We get to split the register in half and do faster lookups.
@@ -497,8 +487,12 @@ void __init arch_init_irq(void)break ; } } -setup_irq (CRIME_MEMERR_IRQ , &memerr_irq); -setup_irq (CRIME_CPUERR_IRQ , &cpuerr_irq); +if (request_irq (CRIME_MEMERR_IRQ , crime_memerr_intr,0 , +"CRIME memory error" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"CRIME memory error" ); +if (request_irq (CRIME_CPUERR_IRQ , crime_cpuerr_intr,0 , +"CRIME CPU error" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"CRIME CPU error" );#define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5)change_c0_status (ST0_IM ,ALLINTS );
arch/mips/sni/a20r.c +3 -1
@@ -222,7 +222,9 @@ void __init sni_a20r_irq_init(void)irq_set_chip_and_handler (i, &a20r_irq_type, handle_level_irq); sni_hwint = a20r_hwint;change_c0_status (ST0_IM ,IE_IRQ0 ); -setup_irq (SNI_A20R_IRQ_BASE +3 , &sni_isa_irq); +if (request_irq (SNI_A20R_IRQ_BASE +3 , sni_isa_irq_handler, +IRQF_SHARED ,"ISA" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"ISA" ); }void sni_a20r_init (void )
arch/mips/sni/irq.c +1 -7
@@ -27,7 +27,7 @@ asmlinkage void plat_irq_dispatch(void) }/* ISA irq handler */ -static irqreturn_t sni_isa_irq_handler (int dummy,void *p) +irqreturn_t sni_isa_irq_handler (int dummy,void *p) {int irq;
@@ -39,12 +39,6 @@ static irqreturn_t sni_isa_irq_handler(int dummy, void *p)return IRQ_HANDLED ; } -struct irqaction sni_isa_irq = { - .handler = sni_isa_irq_handler, - .name ="ISA" , - .flags =IRQF_SHARED -}; -/* * On systems with i8259-style interrupt controllers we assume for * driver compatibility reasons interrupts 0 - 15 to be the i8295
arch/mips/sni/pcit.c +6 -2
@@ -244,7 +244,9 @@ void __init sni_pcit_irq_init(void) *(volatile u32 *)SNI_PCIT_INT_REG =0 ; sni_hwint = sni_pcit_hwint;change_c0_status (ST0_IM ,IE_IRQ1 ); -setup_irq (SNI_PCIT_INT_START +6 , &sni_isa_irq); +if (request_irq (SNI_PCIT_INT_START +6 , sni_isa_irq_handler, +IRQF_SHARED ,"ISA" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"ISA" ); }void __init sni_pcit_cplus_irq_init (void )
@@ -257,7 +259,9 @@ void __init sni_pcit_cplus_irq_init(void) *(volatile u32 *)SNI_PCIT_INT_REG =0x40000000 ; sni_hwint = sni_pcit_hwint_cplus;change_c0_status (ST0_IM ,IE_IRQ0 ); -setup_irq (MIPS_CPU_IRQ_BASE +3 , &sni_isa_irq); +if (request_irq (MIPS_CPU_IRQ_BASE +3 , sni_isa_irq_handler, +IRQF_SHARED ,"ISA" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"ISA" ); }void __init sni_pcit_init (void )
arch/mips/sni/rm200.c +9 -14
@@ -356,11 +356,6 @@ void sni_rm200_init_8259A(void)/* * IRQ2 is cascade interrupt to second interrupt controller */ -static struct irqaction sni_rm200_irq2 = { - .handler = no_action, - .name ="cascade" , - .flags =IRQF_NO_THREAD , -};static struct resource sni_rm200_pic1_resource = { .name ="onboard ISA pic1" ,
@@ -389,12 +384,6 @@ static irqreturn_t sni_rm200_i8259A_irq_handler(int dummy, void *p)return IRQ_HANDLED ; } -struct irqaction sni_rm200_i8259A_irq = { - .handler = sni_rm200_i8259A_irq_handler, - .name ="onboard ISA" , - .flags =IRQF_SHARED -}; -void __init sni_rm200_i8259_irqs (void ) {int i;
@@ -417,7 +406,9 @@ void __init sni_rm200_i8259_irqs(void)irq_set_chip_and_handler (i, &sni_rm200_i8259A_chip, handle_level_irq); -setup_irq (RM200_I8259A_IRQ_BASE +PIC_CASCADE_IR , &sni_rm200_irq2); +if (request_irq (RM200_I8259A_IRQ_BASE +PIC_CASCADE_IR , no_action, +IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"cascade" ); }
@@ -481,8 +472,12 @@ void __init sni_rm200_irq_init(void)irq_set_chip_and_handler (i, &rm200_irq_type, handle_level_irq); sni_hwint = sni_rm200_hwint;change_c0_status (ST0_IM ,IE_IRQ0 ); -setup_irq (SNI_RM200_INT_START +0 , &sni_rm200_i8259A_irq); -setup_irq (SNI_RM200_INT_START +1 , &sni_isa_irq); +if (request_irq (SNI_RM200_INT_START +0 , sni_rm200_i8259A_irq_handler, +IRQF_SHARED ,"onboard ISA" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"onboard ISA" ); +if (request_irq (SNI_RM200_INT_START +1 , sni_isa_irq_handler, +IRQF_SHARED ,"ISA" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"ISA" ); }void __init sni_rm200_init (void )
arch/mips/sni/time.c +3 -7
@@ -55,12 +55,6 @@ static irqreturn_t a20r_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction a20r_irqaction = { - .handler = a20r_interrupt, - .flags =IRQF_PERCPU |IRQF_TIMER , - .name ="a20r-timer" , -}; -/* * a20r platform uses 2 counters to divide the input frequency. * Counter 2 output is connected to Counter 0 & 1 input.
@@ -74,7 +68,9 @@ static void __init sni_a20r_timer_setup(void) cd->cpumask =cpumask_of (cpu);clockevents_register_device (cd); action->dev_id = cd; -setup_irq (SNI_A20R_IRQ_TIMER , &a20r_irqaction); +if (request_irq (SNI_A20R_IRQ_TIMER , a20r_interrupt, +IRQF_PERCPU |IRQF_TIMER ,"a20r-timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"a20r-timer" ); }#define SNI_8254_TICK_RATE 1193182UL
arch/mips/vr41xx/common/irq.c +2 -7
@@ -17,12 +17,6 @@ typedef struct irq_cascade { static irq_cascade_t irq_cascade[NR_IRQS] __cacheline_aligned; -static struct irqaction cascade_irqaction = { - .handler = no_action, - .name ="cascade" , - .flags =IRQF_NO_THREAD , -}; -int cascade_irq (unsigned int irq,int (*get_irq)(unsigned int )) {int retval =0 ;
@@ -36,7 +30,8 @@ int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int)) irq_cascade[irq].get_irq = get_irq;if (get_irq !=NULL ) { - retval =setup_irq (irq, &cascade_irqaction); + retval =request_irq (irq, no_action,IRQF_NO_THREAD , +"cascade" ,NULL );if (retval <0 ) irq_cascade[irq].get_irq =NULL ; }
Signature · 1 line
2.24.1
PATCH 9/18 parisc: Replace setup_irq() by request_irq()
In reply to afzal mohammedrequest_irq() is preferred over setup_irq(). Existing callers of setup_irq() reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.
Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early interrupts were initialized.
Hence replace setup_irq() by request_irq().
Seldom remove_irq() usage has been observed coupled with setup_irq(), wherever that has been found, it too has been replaced by free_irq().
[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
---
Since cc'ing cover letter to all maintainers/reviewers would be too many, refer for cover letter,
https://lkml.kernel.org/r/[email protected]
arch/parisc/kernel/irq.c | 21 +++++---------------- drivers/parisc/eisa.c | 8 ++------ 2 files changed, 7 insertions(+), 22 deletions(-)
arch/parisc/kernel/irq.c +5 -16
@@ -560,20 +560,6 @@ void do_cpu_irq_mask(struct pt_regs *regs) goto out; } -static struct irqaction timer_action = { - .handler = timer_interrupt, - .name ="timer" , - .flags =IRQF_TIMER |IRQF_PERCPU |IRQF_IRQPOLL , -}; - -#ifdef CONFIG_SMP -static struct irqaction ipi_action = { - .handler = ipi_interrupt, - .name ="IPI" , - .flags =IRQF_PERCPU , -}; -#endif -static void claim_cpu_irqs (void ) {int i;
@@ -583,10 +569,13 @@ static void claim_cpu_irqs(void) }irq_set_handler (TIMER_IRQ , handle_percpu_irq); -setup_irq (TIMER_IRQ , &timer_action); +if (request_irq (TIMER_IRQ , timer_interrupt, +IRQF_TIMER |IRQF_PERCPU |IRQF_IRQPOLL ,"timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"timer" );#ifdef CONFIG_SMP irq_set_handler (IPI_IRQ , handle_percpu_irq); -setup_irq (IPI_IRQ , &ipi_action); +if (request_irq (IPI_IRQ , ipi_interrupt,IRQF_PERCPU ,"IPI" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"IPI" );#endif }
drivers/parisc/eisa.c +2 -6
@@ -243,11 +243,6 @@ static irqreturn_t dummy_irq2_handler(int _, void *dev)return IRQ_HANDLED ; } -static struct irqaction irq2_action = { - .handler = dummy_irq2_handler, - .name ="cascade" , -}; -static void init_eisa_pic (void ) {unsigned long flags;
@@ -335,7 +330,8 @@ static int __init eisa_probe(struct parisc_device *dev) }/* Reserve IRQ2 */ -setup_irq (2 , &irq2_action); +if (request_irq (2 , dummy_irq2_handler,0 ,"cascade" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"cascade" );for (i =0 ; i <16 ; i++) {irq_set_chip_and_handler (i, &eisa_interrupt_type, handle_simple_irq);
Signature · 1 line
2.24.1
PATCH 10/18 powerpc: Replace setup_irq() by request_irq()
In reply to afzal mohammedrequest_irq() is preferred over setup_irq(). Existing callers of setup_irq() reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.
Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early interrupts were initialized.
Hence replace setup_irq() by request_irq().
Seldom remove_irq() usage has been observed coupled with setup_irq(), wherever that has been found, it too has been replaced by free_irq().
[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
---
Since cc'ing cover letter to all maintainers/reviewers would be too many, refer for cover letter,
https://lkml.kernel.org/r/[email protected]
arch/powerpc/platforms/85xx/mpc85xx_cds.c | 10 +++----- arch/powerpc/platforms/8xx/cpm1.c | 9 ++----- arch/powerpc/platforms/8xx/m8xx_setup.c | 9 ++----- arch/powerpc/platforms/chrp/setup.c | 14 ++++------ arch/powerpc/platforms/powermac/pic.c | 31 ++++++++++------------- arch/powerpc/platforms/powermac/smp.c | 9 ++----- 6 files changed, 27 insertions(+), 55 deletions(-)
arch/powerpc/platforms/85xx/mpc85xx_cds.c +3 -7
@@ -218,12 +218,6 @@ static irqreturn_t mpc85xx_8259_cascade_action(int irq, void *dev_id) {return IRQ_HANDLED ; } - -static struct irqaction mpc85xxcds_8259_irqaction = { - .handler = mpc85xx_8259_cascade_action, - .flags =IRQF_SHARED |IRQF_NO_THREAD , - .name ="8259 cascade" , -};#endif /* PPC_I8259 */ #endif /* CONFIG_PCI */
@@ -271,7 +265,9 @@ static int mpc85xx_cds_8259_attach(void)* disabled when the last user of the shared IRQ line frees their * interrupt. */ -if ((ret =setup_irq (cascade_irq, &mpc85xxcds_8259_irqaction))) { + ret =request_irq (cascade_irq, mpc85xx_8259_cascade_action, +IRQF_SHARED |IRQF_NO_THREAD ,"8259 cascade" ,NULL ); +if (ret) {printk (KERN_ERR "Failed to setup cascade interrupt\n" );return ret; }
arch/powerpc/platforms/8xx/cpm1.c +2 -7
@@ -120,12 +120,6 @@ static irqreturn_t cpm_error_interrupt(int irq, void *dev)return IRQ_HANDLED ; } -static struct irqaction cpm_error_irqaction = { - .handler = cpm_error_interrupt, - .flags =IRQF_NO_THREAD , - .name ="error" , -}; -static const struct irq_domain_ops cpm_pic_host_ops = { .map = cpm_pic_host_map, };
@@ -187,7 +181,8 @@ unsigned int __init cpm_pic_init(void)if (!eirq) goto end; -if (setup_irq (eirq, &cpm_error_irqaction)) +if (request_irq (eirq, cpm_error_interrupt,IRQF_NO_THREAD ,"error" , +NULL ))printk (KERN_ERR "Could not allocate CPM error IRQ!" );setbits32 (&cpic_reg->cpic_cicr,CICR_IEN );
arch/powerpc/platforms/8xx/m8xx_setup.c +2 -7
@@ -39,12 +39,6 @@ static irqreturn_t timebase_interrupt(int irq, void *dev)return IRQ_HANDLED ; } -static struct irqaction tbint_irqaction = { - .handler = timebase_interrupt, - .flags =IRQF_NO_THREAD , - .name ="tbint" , -}; -/* per-board overridable init_internal_rtc() function. */ void __init __attribute__ ((weak))init_internal_rtc (void )
@@ -157,7 +151,8 @@ void __init mpc8xx_calibrate_decr(void) (TBSCR_TBF | TBSCR_TBE));immr_unmap (sys_tmr2); -if (setup_irq (virq, &tbint_irqaction)) +if (request_irq (virq, timebase_interrupt,IRQF_NO_THREAD ,"tbint" , +NULL ))panic ("Could not allocate timer IRQ!" ); }
arch/powerpc/platforms/chrp/setup.c +5 -9
@@ -451,13 +451,6 @@ static void __init chrp_find_openpic(void)of_node_put (np); } -#if defined(CONFIG_VT ) && defined(CONFIG_INPUT_ADBHID ) && defined(CONFIG_XMON ) -static struct irqaction xmon_irqaction = { - .handler = xmon_irq, - .name ="XMON break" , -}; -#endif -static void __init chrp_find_8259 (void ) {struct device_node *np, *pic =NULL ;
@@ -541,8 +534,11 @@ static void __init chrp_init_IRQ(void)if (of_node_is_type (kbd->parent,"adb" ))break ;of_node_put (kbd); -if (kbd) -setup_irq (HYDRA_INT_ADB_NMI , &xmon_irqaction); +if (kbd) { +if (request_irq (HYDRA_INT_ADB_NMI , xmon_irq,0 ,"XMON break" , +NULL )) +pr_err ("request_irq() on %s failed\n" ,"XMON break" ); + }#endif }
arch/powerpc/platforms/powermac/pic.c +13 -18
@@ -250,20 +250,6 @@ static unsigned int pmac_pic_get_irq(void)return irq_linear_revmap (pmac_pic_host, irq); } -#ifdef CONFIG_XMON -static struct irqaction xmon_action = { - .handler = xmon_irq, - .flags =IRQF_NO_THREAD , - .name ="NMI - XMON" -}; -#endif - -static struct irqaction gatwick_cascade_action = { - .handler = gatwick_action, - .flags =IRQF_NO_THREAD , - .name ="cascade" , -}; -static int pmac_pic_host_match (struct irq_domain *h,struct device_node *node,enum irq_domain_bus_token bus_token) {
@@ -384,12 +370,17 @@ static void __init pmac_pic_probe_oldstyle(void)out_le32 (&pmac_irq_hw[i]->enable,0 );/* Hookup cascade irq */ -if (slave && pmac_irq_cascade) -setup_irq (pmac_irq_cascade, &gatwick_cascade_action); +if (slave && pmac_irq_cascade) { +if (request_irq (pmac_irq_cascade, gatwick_action, +IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"cascade" ); + }printk (KERN_INFO "irq: System has %d possible interrupts\n" , max_irqs);#ifdef CONFIG_XMON -setup_irq (irq_create_mapping (NULL ,20 ), &xmon_action); +if (request_irq (irq_create_mapping (NULL ,20 ), xmon_irq,IRQF_NO_THREAD , +"NMI - XMON" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"NMI - XMON" );#endif }
@@ -441,7 +432,11 @@ static void __init pmac_pic_setup_mpic_nmi(struct mpic *mpic) nmi_irq =irq_of_parse_and_map (pswitch,0 );if (nmi_irq) {mpic_irq_set_priority (nmi_irq,9 ); -setup_irq (nmi_irq, &xmon_action); +if (request_irq (nmi_irq, xmon_irq,IRQF_NO_THREAD , +"NMI - XMON" ,NULL )) { +pr_err ("request_irq() on %s failed\n" , +"NMI - XMON" ); + } }of_node_put (pswitch); }
arch/powerpc/platforms/powermac/smp.c +2 -7
@@ -399,12 +399,6 @@ static int __init smp_psurge_kick_cpu(int nr)return 0 ; } -static struct irqaction psurge_irqaction = { - .handler = psurge_ipi_intr, - .flags =IRQF_PERCPU |IRQF_NO_THREAD , - .name ="primary IPI" , -}; -static void __init smp_psurge_setup_cpu (int cpu_nr) {if (cpu_nr !=0 || !psurge_start)
@@ -413,7 +407,8 @@ static void __init smp_psurge_setup_cpu(int cpu_nr)/* reset the entry point so if we get another intr we won't * try to startup again */ out_be32 (psurge_start,0x100 ); -if (setup_irq (irq_create_mapping (NULL ,30 ), &psurge_irqaction)) +if (request_irq (irq_create_mapping (NULL ,30 ), psurge_ipi_intr, +IRQF_PERCPU |IRQF_NO_THREAD ,"primary IPI" ,NULL ))printk (KERN_ERR "Couldn't get primary IPI interrupt" ); }
Signature · 1 line
2.24.1
PATCH 11/18 s390: replace setup_irq() by request_irq()
In reply to afzal mohammedrequest_irq() is preferred over setup_irq(). Existing callers of setup_irq() reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.
Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early interrupts were initialized.
Hence replace setup_irq() by request_irq().
Seldom remove_irq() usage has been observed coupled with setup_irq(), wherever that has been found, it too has been replaced by free_irq().
[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
---
Since cc'ing cover letter to all maintainers/reviewers would be too many, refer for cover letter,
https://lkml.kernel.org/r/[email protected]
arch/s390/kernel/irq.c | 8 ++------ drivers/s390/cio/airq.c | 8 ++------ drivers/s390/cio/cio.c | 8 ++------ 3 files changed, 6 insertions(+), 18 deletions(-)
arch/s390/kernel/irq.c +2 -6
@@ -294,11 +294,6 @@ static irqreturn_t do_ext_interrupt(int irq, void *dummy)return IRQ_HANDLED ; } -static struct irqaction external_interrupt = { - .name ="EXT" , - .handler = do_ext_interrupt, -}; -void __init init_ext_interrupts (void ) {int idx;
@@ -308,7 +303,8 @@ void __init init_ext_interrupts(void)irq_set_chip_and_handler (EXT_INTERRUPT , &dummy_irq_chip, handle_percpu_irq); -setup_irq (EXT_INTERRUPT , &external_interrupt); +if (request_irq (EXT_INTERRUPT , do_ext_interrupt,0 ,"EXT" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"EXT" ); }static DEFINE_SPINLOCK (irq_subclass_lock);
drivers/s390/cio/airq.c +2 -6
@@ -105,16 +105,12 @@ static irqreturn_t do_airq_interrupt(int irq, void *dummy)return IRQ_HANDLED ; } -static struct irqaction airq_interrupt = { - .name ="AIO" , - .handler = do_airq_interrupt, -}; -void __init init_airq_interrupts (void ) {irq_set_chip_and_handler (THIN_INTERRUPT , &dummy_irq_chip, handle_percpu_irq); -setup_irq (THIN_INTERRUPT , &airq_interrupt); +if (request_irq (THIN_INTERRUPT , do_airq_interrupt,0 ,"AIO" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"AIO" ); }static inline unsigned long iv_size (unsigned long bits)
drivers/s390/cio/cio.c +2 -6
@@ -563,16 +563,12 @@ static irqreturn_t do_cio_interrupt(int irq, void *dummy)return IRQ_HANDLED ; } -static struct irqaction io_interrupt = { - .name ="I/O" , - .handler = do_cio_interrupt, -}; -void __init init_cio_interrupts (void ) {irq_set_chip_and_handler (IO_INTERRUPT , &dummy_irq_chip, handle_percpu_irq); -setup_irq (IO_INTERRUPT , &io_interrupt); +if (request_irq (IO_INTERRUPT , do_cio_interrupt,0 ,"I/O" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"I/O" ); }#ifdef CONFIG_CCW_CONSOLE
Signature · 1 line
2.24.1
PATCH 12/18 sh: replace setup_irq() by request_irq()
In reply to afzal mohammedrequest_irq() is preferred over setup_irq(). Existing callers of setup_irq() reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.
Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early interrupts were initialized.
Hence replace setup_irq() by request_irq().
Seldom remove_irq() usage has been observed coupled with setup_irq(), wherever that has been found, it too has been replaced by free_irq().
[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
---
Since cc'ing cover letter to all maintainers/reviewers would be too many, refer for cover letter,
https://lkml.kernel.org/r/[email protected]
arch/sh/boards/mach-cayman/irq.c | 18 ++++++------------ arch/sh/drivers/dma/dma-pvr2.c | 9 +++------ 2 files changed, 9 insertions(+), 18 deletions(-)
arch/sh/boards/mach-cayman/irq.c +6 -12
@@ -40,16 +40,6 @@ static irqreturn_t cayman_interrupt_pci2(int irq, void *dev_id)return IRQ_NONE ; } -static struct irqaction cayman_action_smsc = { - .name ="Cayman SMSC Mux" , - .handler = cayman_interrupt_smsc, -}; - -static struct irqaction cayman_action_pci2 = { - .name ="Cayman PCI2 Mux" , - .handler = cayman_interrupt_pci2, -}; -static void enable_cayman_irq (struct irq_data *data) {unsigned int irq = data->irq;
@@ -149,6 +139,10 @@ void init_cayman_irq(void) }/* Setup the SMSC interrupt */ -setup_irq (SMSC_IRQ , &cayman_action_smsc); -setup_irq (PCI2_IRQ , &cayman_action_pci2); +if (request_irq (SMSC_IRQ , cayman_interrupt_smsc,0 ,"Cayman SMSC Mux" , +NULL )) +pr_err ("request_irq() on %s failed\n" ,"Cayman SMSC Mux" ); +if (request_irq (PCI2_IRQ , cayman_interrupt_pci2,0 ,"Cayman PCI2 Mux" , +NULL )) +pr_err ("request_irq() on %s failed\n" ,"Cayman PCI2 Mux" ); }
arch/sh/drivers/dma/dma-pvr2.c +3 -6
@@ -64,11 +64,6 @@ static int pvr2_xfer_dma(struct dma_channel *chan)return 0 ; } -static struct irqaction pvr2_dma_irq = { - .name ="pvr2 DMA handler" , - .handler = pvr2_dma_interrupt, -}; -static struct dma_ops pvr2_dma_ops = { .request = pvr2_request_dma, .get_residue = pvr2_get_dma_residue,
@@ -84,7 +79,9 @@ static struct dma_info pvr2_dma_info = {static int __init pvr2_dma_init (void ) { -setup_irq (HW_EVENT_PVR2_DMA , &pvr2_dma_irq); +if (request_irq (HW_EVENT_PVR2_DMA , pvr2_dma_interrupt,0 , +"pvr2 DMA handler" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"pvr2 DMA handler" );request_dma (PVR2_CASCADE_CHAN ,"pvr2 cascade" );return register_dmac (&pvr2_dma_info);
Signature · 1 line
2.24.1
PATCH 13/18 unicore32: replace setup_irq() by request_irq()
In reply to afzal mohammedrequest_irq() is preferred over setup_irq(). Existing callers of setup_irq() reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.
Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early interrupts were initialized.
Hence replace setup_irq() by request_irq().
Seldom remove_irq() usage has been observed coupled with setup_irq(), wherever that has been found, it too has been replaced by free_irq().
[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
---
Since cc'ing cover letter to all maintainers/reviewers would be too many, refer for cover letter,
https://lkml.kernel.org/r/[email protected]
arch/unicore32/kernel/time.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
arch/unicore32/kernel/time.c +3 -8
@@ -72,13 +72,6 @@ static struct clocksource cksrc_puv3_oscr = { .flags = CLOCK_SOURCE_IS_CONTINUOUS, }; -static struct irqaction puv3_timer_irq = { - .name ="ost0" , - .flags =IRQF_TIMER |IRQF_IRQPOLL , - .handler = puv3_ost0_interrupt, - .dev_id = &ckevt_puv3_osmr0, -}; -void __init time_init (void ) {writel (0 ,OST_OIER );/* disable any timer interrupts */
@@ -94,7 +87,9 @@ void __init time_init(void) ckevt_puv3_osmr0.min_delta_ticks =MIN_OSCR_DELTA *2 ; ckevt_puv3_osmr0.cpumask =cpumask_of (0 ); -setup_irq (IRQ_TIMER0 , &puv3_timer_irq); +if (request_irq (IRQ_TIMER0 , puv3_ost0_interrupt, +IRQF_TIMER |IRQF_IRQPOLL ,"ost0" , &ckevt_puv3_osmr0)) +pr_err ("request_irq() on %s failed\n" ,"ost0" );clocksource_register_hz (&cksrc_puv3_oscr,CLOCK_TICK_RATE );clockevents_register_device (&ckevt_puv3_osmr0);
Signature · 1 line
2.24.1
PATCH 14/18 x86: Replace setup_irq() by request_irq()
In reply to afzal mohammedrequest_irq() is preferred over setup_irq(). Existing callers of setup_irq() reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.
Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early interrupts were initialized.
Hence replace setup_irq() by request_irq().
Seldom remove_irq() usage has been observed coupled with setup_irq(), wherever that has been found, it too has been replaced by free_irq().
[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
---
Since cc'ing cover letter to all maintainers/reviewers would be too many, refer for cover letter,
https://lkml.kernel.org/r/[email protected]
arch/x86/kernel/irqinit.c | 18 +++++++----------- arch/x86/kernel/time.c | 10 +++------- 2 files changed, 10 insertions(+), 18 deletions(-)
arch/x86/kernel/irqinit.c +7 -11
@@ -44,15 +44,6 @@* (these are usually mapped into the 0x30-0xff vector range) */ -/* -* IRQ2 is cascade interrupt to second interrupt controller -*/ -static struct irqaction irq2 = { - .handler = no_action, - .name ="cascade" , - .flags =IRQF_NO_THREAD , -}; - DEFINE_PER_CPU(vector_irq_t, vector_irq) = { [0 ... NR_VECTORS - 1] = VECTOR_UNUSED, };
@@ -104,6 +95,11 @@ void __init native_init_IRQ(void)idt_setup_apic_and_irq_gates ();lapic_assign_system_vectors (); -if (!acpi_ioapic && !of_ioapic &&nr_legacy_irqs ()) -setup_irq (2 , &irq2); +if (!acpi_ioapic && !of_ioapic &&nr_legacy_irqs ()) { +/* +* IRQ2 is cascade interrupt to second interrupt controller +*/ +if (request_irq (2 , no_action,IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"cascade" ); + } }
arch/x86/kernel/time.c +3 -7
@@ -62,19 +62,15 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction irq0 = { - .handler = timer_interrupt, - .flags =IRQF_NOBALANCING |IRQF_IRQPOLL |IRQF_TIMER , - .name ="timer" -}; -static void __init setup_default_timer_irq (void ) {/* * Unconditionally register the legacy timer; even without legacy * PIC/PIT we need this for the HPET0 in legacy replacement mode. */ -if (setup_irq (0 , &irq0)) +if (request_irq (0 , timer_interrupt, +IRQF_NOBALANCING |IRQF_IRQPOLL |IRQF_TIMER ,"timer" , +NULL ))pr_info ("Failed to register legacy timer interrupt\n" ); }
Signature · 1 line
2.24.1
PATCH 15/18 xtensa: replace setup_irq() by request_irq()
In reply to afzal mohammedrequest_irq() is preferred over setup_irq(). Existing callers of setup_irq() reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.
Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early interrupts were initialized.
Hence replace setup_irq() by request_irq().
Seldom remove_irq() usage has been observed coupled with setup_irq(), wherever that has been found, it too has been replaced by free_irq().
[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
---
Since cc'ing cover letter to all maintainers/reviewers would be too many, refer for cover letter,
https://lkml.kernel.org/r/[email protected]
arch/xtensa/kernel/smp.c | 8 ++------ arch/xtensa/kernel/time.c | 10 +++------- 2 files changed, 5 insertions(+), 13 deletions(-)
arch/xtensa/kernel/smp.c +2 -6
@@ -53,16 +53,12 @@ static void system_flush_invalidate_dcache_range(unsigned long start,#define IPI_IRQ 0static irqreturn_t ipi_interrupt (int irq,void *dev_id); -static struct irqaction ipi_irqaction = { - .handler = ipi_interrupt, - .flags =IRQF_PERCPU , - .name ="ipi" , -};void ipi_init (void ) {unsigned irq =irq_create_mapping (NULL ,IPI_IRQ ); -setup_irq (irq, &ipi_irqaction); +if (request_irq (irq, ipi_interrupt,IRQF_PERCPU ,"ipi" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"ipi" ); }static inline unsigned int get_core_count (void )
arch/xtensa/kernel/time.c +3 -7
@@ -128,12 +128,6 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction timer_irqaction = { - .handler = timer_interrupt, - .flags =IRQF_TIMER , - .name ="timer" , -}; -void local_timer_setup (unsigned cpu) {struct ccount_timer *timer = &per_cpu (ccount_timer, cpu);
@@ -199,7 +193,9 @@ void __init time_init(void) __func__);clocksource_register_hz (&ccount_clocksource, ccount_freq);local_timer_setup (0 ); -setup_irq (this_cpu_ptr (&ccount_timer)->evt.irq, &timer_irqaction); +if (request_irq (this_cpu_ptr (&ccount_timer)->evt.irq, timer_interrupt, +IRQF_TIMER ,"timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"timer" );sched_clock_register (ccount_sched_clock_read,32 , ccount_freq);timer_probe (); }
Signature · 1 line
2.24.1
PATCH 16/18 clocksource: Replace setup_irq() by request_irq()
In reply to afzal mohammedrequest_irq() is preferred over setup_irq(). Existing callers of setup_irq() reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.
Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early interrupts were initialized.
Hence replace setup_irq() by request_irq().
Seldom remove_irq() usage has been observed coupled with setup_irq(), wherever that has been found, it too has been replaced by free_irq().
[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
---
Since cc'ing cover letter to all maintainers/reviewers would be too many, refer for cover letter,
https://lkml.kernel.org/r/[email protected]
drivers/clocksource/bcm2835_timer.c | 8 +--- drivers/clocksource/bcm_kona_timer.c | 10 ++--- drivers/clocksource/dw_apb_timer.c | 11 ++--- drivers/clocksource/exynos_mct.c | 12 ++---- drivers/clocksource/mxs_timer.c | 10 +---- drivers/clocksource/nomadik-mtu.c | 11 ++--- drivers/clocksource/samsung_pwm_timer.c | 12 ++---- drivers/clocksource/timer-atlas7.c | 50 +++++++++++------------ drivers/clocksource/timer-cs5535.c | 10 ++--- drivers/clocksource/timer-efm32.c | 10 +---- drivers/clocksource/timer-fsl-ftm.c | 10 +---- drivers/clocksource/timer-imx-gpt.c | 10 +---- drivers/clocksource/timer-integrator-ap.c | 11 ++--- drivers/clocksource/timer-meson6.c | 11 ++--- drivers/clocksource/timer-orion.c | 9 +--- drivers/clocksource/timer-prima2.c | 11 +---- drivers/clocksource/timer-pxa.c | 10 +---- drivers/clocksource/timer-sp804.c | 11 ++--- drivers/clocksource/timer-u300.c | 9 +--- drivers/clocksource/timer-vf-pit.c | 10 +---- drivers/clocksource/timer-vt8500.c | 11 ++--- drivers/clocksource/timer-zevio.c | 13 +++--- include/linux/dw_apb_timer.h | 1 - 23 files changed, 81 insertions(+), 190 deletions(-)
drivers/clocksource/bcm2835_timer.c +2 -6
@@ -31,7 +31,6 @@ struct bcm2835_timer {void __iomem *compare;int match_mask;struct clock_event_device evt; -struct irqaction act; };static void __iomem *system_clock__read_mostly ;
@@ -113,12 +112,9 @@ static int __init bcm2835_timer_init(struct device_node *node) timer->evt.features =CLOCK_EVT_FEAT_ONESHOT ; timer->evt.set_next_event = bcm2835_time_set_next_event; timer->evt.cpumask =cpumask_of (0 ); - timer->act.name = node->name; - timer->act.flags =IRQF_TIMER |IRQF_SHARED ; - timer->act.dev_id = timer; - timer->act.handler = bcm2835_time_interrupt; - ret =setup_irq (irq, &timer->act); + ret =request_irq (irq, bcm2835_time_interrupt,IRQF_TIMER |IRQF_SHARED , + node->name, timer);if (ret) {pr_err ("Can't set up timer IRQ\n" ); goto err_timer_free;
drivers/clocksource/bcm_kona_timer.c +3 -7
@@ -160,12 +160,6 @@ static irqreturn_t kona_timer_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction kona_timer_irq = { - .name ="Kona Timer Tick" , - .flags =IRQF_TIMER , - .handler = kona_timer_interrupt, -}; -static int __init kona_timer_init (struct device_node *node) {u32 freq;
@@ -192,7 +186,9 @@ static int __init kona_timer_init(struct device_node *node)kona_timer_disable_and_clear (timers.tmr_regs);kona_timer_clockevents_init (); -setup_irq (timers.tmr_irq, &kona_timer_irq); +if (request_irq (timers.tmr_irq, kona_timer_interrupt,IRQF_TIMER , +"Kona Timer Tick" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"Kona Timer Tick" );kona_timer_set_next_event ((arch_timer_rate /HZ ),NULL );return 0 ;
drivers/clocksource/dw_apb_timer.c +3 -8
@@ -270,15 +270,10 @@ dw_apb_clockevent_init(int cpu, const char *name, unsigned rating, dw_ced->ced.rating = rating; dw_ced->ced.name = name; - dw_ced->irqaction.name = dw_ced->ced.name; - dw_ced->irqaction.handler = dw_apb_clockevent_irq; - dw_ced->irqaction.dev_id = &dw_ced->ced; - dw_ced->irqaction.irq = irq; - dw_ced->irqaction.flags =IRQF_TIMER |IRQF_IRQPOLL | -IRQF_NOBALANCING ; - dw_ced->eoi = apbt_eoi; - err =setup_irq (irq, &dw_ced->irqaction); + err =request_irq (irq, dw_apb_clockevent_irq, +IRQF_TIMER |IRQF_IRQPOLL |IRQF_NOBALANCING , + dw_ced->ced.name, &dw_ced->ced);if (err) {pr_err ("failed to request timer irq\n" );kfree (dw_ced);
drivers/clocksource/exynos_mct.c +4 -8
@@ -329,19 +329,15 @@ static irqreturn_t exynos4_mct_comp_isr(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction mct_comp_event_irq = { - .name ="mct_comp_irq" , - .flags =IRQF_TIMER |IRQF_IRQPOLL , - .handler = exynos4_mct_comp_isr, - .dev_id = &mct_comp_device, -}; -static int exynos4_clockevent_init (void ) { mct_comp_device.cpumask =cpumask_of (0 );clockevents_config_and_register (&mct_comp_device, clk_rate,0xf ,0xffffffff ); -setup_irq (mct_irqs[MCT_G0_IRQ ], &mct_comp_event_irq); +if (request_irq (mct_irqs[MCT_G0_IRQ ], exynos4_mct_comp_isr, +IRQF_TIMER |IRQF_IRQPOLL ,"mct_comp_irq" , + &mct_comp_device)) +pr_err ("request_irq() on %s failed\n" ,"mct_comp_irq" );return 0 ; }
drivers/clocksource/mxs_timer.c +2 -8
@@ -117,13 +117,6 @@ static irqreturn_t mxs_timer_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction mxs_timer_irq = { - .name ="MXS Timer Tick" , - .dev_id = &mxs_clockevent_device, - .flags =IRQF_TIMER |IRQF_IRQPOLL , - .handler = mxs_timer_interrupt, -}; -static void mxs_irq_clear (char *state) {/* Disable interrupt in timer module */
@@ -277,6 +270,7 @@ static int __init mxs_timer_init(struct device_node *np)if (irq <=0 )return -EINVAL ; -return setup_irq (irq, &mxs_timer_irq); +return request_irq (irq, mxs_timer_interrupt,IRQF_TIMER |IRQF_IRQPOLL , +"MXS Timer Tick" , &mxs_clockevent_device); }TIMER_OF_DECLARE (mxs,"fsl,timrot" , mxs_timer_init);
drivers/clocksource/nomadik-mtu.c +3 -8
@@ -181,13 +181,6 @@ static irqreturn_t nmdk_timer_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction nmdk_timer_irq = { - .name ="Nomadik Timer Tick" , - .flags =IRQF_TIMER , - .handler = nmdk_timer_interrupt, - .dev_id = &nmdk_clkevt, -}; -static int __init nmdk_timer_init (void __iomem *base,int irq,struct clk *pclk,struct clk *clk) {
@@ -232,7 +225,9 @@ static int __init nmdk_timer_init(void __iomem *base, int irq,sched_clock_register (nomadik_read_sched_clock,32 , rate);/* Timer 1 is used for events, register irq and clockevents */ -setup_irq (irq, &nmdk_timer_irq); +if (request_irq (irq, nmdk_timer_interrupt,IRQF_TIMER , +"Nomadik Timer Tick" , &nmdk_clkevt)) +pr_err ("request_irq() on %s failed\n" ,"Nomadik Timer Tick" ); nmdk_clkevt.cpumask =cpumask_of (0 ); nmdk_clkevt.irq = irq;clockevents_config_and_register (&nmdk_clkevt, rate,2 ,0xffffffffU );
drivers/clocksource/samsung_pwm_timer.c +4 -8
@@ -256,13 +256,6 @@ static irqreturn_t samsung_clock_event_isr(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction samsung_clock_event_irq = { - .name ="samsung_time_irq" , - .flags =IRQF_TIMER |IRQF_IRQPOLL , - .handler = samsung_clock_event_isr, - .dev_id = &time_event_device, -}; -static void __init samsung_clockevent_init (void ) {unsigned long pclk;
@@ -282,7 +275,10 @@ static void __init samsung_clockevent_init(void) clock_rate, 1, pwm.tcnt_max); irq_number = pwm.irq[pwm.event_id]; -setup_irq (irq_number, &samsung_clock_event_irq); +if (request_irq (irq_number, samsung_clock_event_isr, +IRQF_TIMER |IRQF_IRQPOLL ,"samsung_time_irq" , + &time_event_device)) +pr_err ("request_irq() on %s failed\n" ,"samsung_time_irq" );if (pwm.variant.has_tint_cstat) {u32 mask = (1 << pwm.event_id);
drivers/clocksource/timer-atlas7.c +23 -27
87 lines not on this page · raw message
drivers/clocksource/timer-cs5535.c +3 -7
@@ -131,12 +131,6 @@ static irqreturn_t mfgpt_tick(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction mfgptirq = { - .handler = mfgpt_tick, - .flags =IRQF_NOBALANCING |IRQF_TIMER |IRQF_SHARED , - .name =DRV_NAME , -}; -static int __init cs5535_mfgpt_init (void ) {struct cs5535_mfgpt_timer *timer;
@@ -158,7 +152,9 @@ static int __init cs5535_mfgpt_init(void) }/* And register it with the kernel */ - ret =setup_irq (timer_irq, &mfgptirq); + ret =request_irq (timer_irq, mfgpt_tick, +IRQF_NOBALANCING |IRQF_TIMER |IRQF_SHARED , +DRV_NAME ,NULL );if (ret) { printk(KERN_ERR DRV_NAME ": Unable to set up the interrupt.\n"); goto err_irq;
drivers/clocksource/timer-efm32.c +2 -8
@@ -119,13 +119,6 @@ static struct efm32_clock_event_ddata clock_event_ddata = { }, }; -static struct irqaction efm32_clock_event_irq = { - .name ="efm32 clockevent" , - .flags =IRQF_TIMER , - .handler = efm32_clock_event_handler, - .dev_id = &clock_event_ddata, -}; -static int __init efm32_clocksource_init (struct device_node *np) {struct clk *clk;
@@ -230,7 +223,8 @@ static int __init efm32_clockevent_init(struct device_node *np)DIV_ROUND_CLOSEST (rate,1024 ), 0xf, 0xffff); - ret =setup_irq (irq, &efm32_clock_event_irq); + ret =request_irq (irq, efm32_clock_event_handler,IRQF_TIMER , +"efm32 clockevent" , &clock_event_ddata);if (ret) {pr_err ("Failed setup irq\n" ); goto err_setup_irq;
drivers/clocksource/timer-fsl-ftm.c +2 -8
@@ -176,13 +176,6 @@ static struct clock_event_device ftm_clockevent = { .rating = 300, }; -static struct irqaction ftm_timer_irq = { - .name ="Freescale ftm timer" , - .flags =IRQF_TIMER |IRQF_IRQPOLL , - .handler = ftm_evt_interrupt, - .dev_id = &ftm_clockevent, -}; -static int __init ftm_clockevent_init (unsigned long freq,int irq) {int err;
@@ -192,7 +185,8 @@ static int __init ftm_clockevent_init(unsigned long freq, int irq)ftm_reset_counter (priv->clkevt_base); - err =setup_irq (irq, &ftm_timer_irq); + err =request_irq (irq, ftm_evt_interrupt,IRQF_TIMER |IRQF_IRQPOLL , +"Freescale ftm timer" , &ftm_clockevent);if (err) {pr_err ("ftm: setup irq failed: %d\n" , err);return err;
drivers/clocksource/timer-imx-gpt.c +2 -8
@@ -67,7 +67,6 @@ struct imx_timer {struct clk *clk_ipg;const struct imx_gpt_data *gpt;struct clock_event_device ced; -struct irqaction act; };struct imx_gpt_data {
@@ -273,7 +272,6 @@ static irqreturn_t mxc_timer_interrupt(int irq, void *dev_id)static int __init mxc_clockevent_init (struct imx_timer *imxtm) {struct clock_event_device *ced = &imxtm->ced; -struct irqaction *act = &imxtm->act; ced->name ="mxc_timer1" ; ced->features =CLOCK_EVT_FEAT_ONESHOT |CLOCK_EVT_FEAT_DYNIRQ ;
@@ -287,12 +285,8 @@ static int __init mxc_clockevent_init(struct imx_timer *imxtm)clockevents_config_and_register (ced,clk_get_rate (imxtm->clk_per),0xff ,0xfffffffe ); - act->name ="i.MX Timer Tick" ; - act->flags =IRQF_TIMER |IRQF_IRQPOLL ; - act->handler = mxc_timer_interrupt; - act->dev_id = ced; - -return setup_irq (imxtm->irq, act); +return request_irq (imxtm->irq, mxc_timer_interrupt, +IRQF_TIMER |IRQF_IRQPOLL ,"i.MX Timer Tick" , ced); }static void imx1_gpt_setup_tctl (struct imx_timer *imxtm)
drivers/clocksource/timer-integrator-ap.c +3 -8
@@ -123,13 +123,6 @@ static struct clock_event_device integrator_clockevent = { .rating = 300, }; -static struct irqaction integrator_timer_irq = { - .name ="timer" , - .flags =IRQF_TIMER |IRQF_IRQPOLL , - .handler = integrator_timer_interrupt, - .dev_id = &integrator_clockevent, -}; -static int integrator_clockevent_init (unsigned long inrate,void __iomem *base,int irq) {
@@ -149,7 +142,9 @@ static int integrator_clockevent_init(unsigned long inrate, timer_reload = rate /HZ ;writel (ctrl, clkevt_base +TIMER_CTRL ); - ret =setup_irq (irq, &integrator_timer_irq); + ret =request_irq (irq, integrator_timer_interrupt, +IRQF_TIMER |IRQF_IRQPOLL ,"timer" , + &integrator_clockevent);if (ret)return ret;
drivers/clocksource/timer-meson6.c +3 -8
@@ -150,13 +150,6 @@ static irqreturn_t meson6_timer_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction meson6_timer_irq = { - .name ="meson6_timer" , - .flags =IRQF_TIMER |IRQF_IRQPOLL , - .handler = meson6_timer_interrupt, - .dev_id = &meson6_clockevent, -}; -static int __init meson6_timer_init (struct device_node *node) {u32 val;
@@ -194,7 +187,9 @@ static int __init meson6_timer_init(struct device_node *node)/* Stop the timer A */ meson6_clkevt_time_stop (); - ret =setup_irq (irq, &meson6_timer_irq); + ret =request_irq (irq, meson6_timer_interrupt, +IRQF_TIMER |IRQF_IRQPOLL ,"meson6_timer" , + &meson6_clockevent);if (ret) {pr_warn ("failed to setup irq %d\n" , irq);return ret;
drivers/clocksource/timer-orion.c +2 -7
@@ -114,12 +114,6 @@ static irqreturn_t orion_clkevt_irq_handler(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction orion_clkevt_irq = { - .name ="orion_event" , - .flags =IRQF_TIMER , - .handler = orion_clkevt_irq_handler, -}; -static int __init orion_timer_init (struct device_node *np) {unsigned long rate;
@@ -172,7 +166,8 @@ static int __init orion_timer_init(struct device_node *np)sched_clock_register (orion_read_sched_clock,32 , rate);/* setup timer1 as clockevent timer */ - ret =setup_irq (irq, &orion_clkevt_irq); + ret =request_irq (irq, orion_clkevt_irq_handler,IRQF_TIMER , +"orion_event" ,NULL );if (ret) {pr_err ("%pOFn: unable to setup irq\n" , np);return ret;
drivers/clocksource/timer-prima2.c +2 -9
@@ -165,14 +165,6 @@ static struct clocksource sirfsoc_clocksource = { .resume = sirfsoc_clocksource_resume, }; -static struct irqaction sirfsoc_timer_irq = { - .name ="sirfsoc_timer0" , - .flags =IRQF_TIMER , - .irq =0 , - .handler = sirfsoc_timer_interrupt, - .dev_id = &sirfsoc_clockevent, -}; -/* Overwrite weak default sched_clock with more precise one */ static u64 notrace sirfsoc_read_sched_clock(void) {
@@ -234,7 +226,8 @@ static int __init sirfsoc_prima2_timer_init(struct device_node *np)sched_clock_register (sirfsoc_read_sched_clock,64 ,PRIMA2_CLOCK_FREQ ); - ret =setup_irq (sirfsoc_timer_irq.irq, &sirfsoc_timer_irq); + ret =request_irq (sirfsoc_timer_irq.irq, sirfsoc_timer_interrupt, +IRQF_TIMER ,"sirfsoc_timer0" , &sirfsoc_clockevent);if (ret) {pr_err ("Failed to setup irq\n" );return ret;
drivers/clocksource/timer-pxa.c +2 -8
@@ -143,13 +143,6 @@ static struct clock_event_device ckevt_pxa_osmr0 = { .resume = pxa_timer_resume, }; -static struct irqaction pxa_ost0_irq = { - .name ="ost0" , - .flags =IRQF_TIMER |IRQF_IRQPOLL , - .handler = pxa_ost0_interrupt, - .dev_id = &ckevt_pxa_osmr0, -}; -static int __init pxa_timer_common_init (int irq,unsigned long clock_tick_rate) {int ret;
@@ -161,7 +154,8 @@ static int __init pxa_timer_common_init(int irq, unsigned long clock_tick_rate) ckevt_pxa_osmr0.cpumask =cpumask_of (0 ); - ret =setup_irq (irq, &pxa_ost0_irq); + ret =request_irq (irq, pxa_ost0_interrupt,IRQF_TIMER |IRQF_IRQPOLL , +"ost0" , &ckevt_pxa_osmr0);if (ret) {pr_err ("Failed to setup irq\n" );return ret;
drivers/clocksource/timer-sp804.c +3 -8
@@ -168,13 +168,6 @@ static struct clock_event_device sp804_clockevent = { .rating = 300, }; -static struct irqaction sp804_timer_irq = { - .name ="timer" , - .flags =IRQF_TIMER |IRQF_IRQPOLL , - .handler = sp804_timer_interrupt, - .dev_id = &sp804_clockevent, -}; -int __init __sp804_clockevents_init (void __iomem *base,unsigned int irq,struct clk *clk,const char *name) {struct clock_event_device *evt = &sp804_clockevent;
@@ -200,7 +193,9 @@ int __init __sp804_clockevents_init(void __iomem *base, unsigned int irq, structwritel (0 , base +TIMER_CTRL ); -setup_irq (irq, &sp804_timer_irq); +if (request_irq (irq, sp804_timer_interrupt,IRQF_TIMER |IRQF_IRQPOLL , +"timer" , &sp804_clockevent)) +pr_err ("request_irq() on %s failed\n" ,"timer" );clockevents_config_and_register (evt, rate,0xf ,0xffffffff );return 0 ;
drivers/clocksource/timer-u300.c +2 -7
@@ -330,12 +330,6 @@ static irqreturn_t u300_timer_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction u300_timer_irq = { - .name ="U300 Timer Tick" , - .flags =IRQF_TIMER |IRQF_IRQPOLL , - .handler = u300_timer_interrupt, -}; -/* * Override the global weak sched_clock symbol with this * local implementation which uses the clocksource to get some
@@ -420,7 +414,8 @@ static int __init u300_timer_init_of(struct device_node *np) u300_timer_base + U300_TIMER_APP_RGPT1);/* Set up the IRQ handler */ - ret =setup_irq (irq, &u300_timer_irq); + ret =request_irq (irq, u300_timer_interrupt, +IRQF_TIMER |IRQF_IRQPOLL ,"U300 Timer Tick" ,NULL );if (ret)return ret;
drivers/clocksource/timer-vf-pit.c +2 -8
@@ -123,19 +123,13 @@ static struct clock_event_device clockevent_pit = { .rating = 300, }; -static struct irqaction pit_timer_irq = { - .name ="VF pit timer" , - .flags =IRQF_TIMER |IRQF_IRQPOLL , - .handler = pit_timer_interrupt, - .dev_id = &clockevent_pit, -}; -static int __init pit_clockevent_init (unsigned long rate,int irq) {__raw_writel (0 , clkevt_base +PITTCTRL );__raw_writel (PITTFLG_TIF , clkevt_base +PITTFLG ); -BUG_ON (setup_irq (irq, &pit_timer_irq)); +BUG_ON (request_irq (irq, pit_timer_interrupt,IRQF_TIMER |IRQF_IRQPOLL , + "VF pit timer", &clockevent_pit); clockevent_pit.cpumask =cpumask_of (0 ); clockevent_pit.irq = irq;
drivers/clocksource/timer-vt8500.c +3 -8
@@ -101,13 +101,6 @@ static irqreturn_t vt8500_timer_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction irq = { - .name ="vt8500_timer" , - .flags =IRQF_TIMER |IRQF_IRQPOLL , - .handler = vt8500_timer_interrupt, - .dev_id = &clockevent, -}; -static int __init vt8500_timer_init (struct device_node *np) {int timer_irq, ret;
@@ -139,7 +132,9 @@ static int __init vt8500_timer_init(struct device_node *np) clockevent.cpumask =cpumask_of (0 ); - ret =setup_irq (timer_irq, &irq); + ret =request_irq (timer_irq, vt8500_timer_interrupt, +IRQF_TIMER |IRQF_IRQPOLL ,"vt8500_timer" , + &clockevent);if (ret) {pr_err ("%s: setup_irq failed for %s\n" , __func__, clockevent.name);
drivers/clocksource/timer-zevio.c +6 -7
@@ -53,7 +53,6 @@ struct zevio_timer {struct clk *clk;struct clock_event_device clkevt; -struct irqaction clkevt_irq;char clocksource_name[64 ];char clockevent_name[64 ];
@@ -172,12 +171,12 @@ static int __init zevio_timer_add(struct device_node *node)/* Interrupt to occur when timer value matches 0 */ writel (0 , timer->base +IO_MATCH (TIMER_MATCH )); - timer->clkevt_irq.name = timer->clockevent_name; - timer->clkevt_irq.handler = zevio_timer_interrupt; - timer->clkevt_irq.dev_id = timer; - timer->clkevt_irq.flags =IRQF_TIMER |IRQF_IRQPOLL ; - -setup_irq (irqnr, &timer->clkevt_irq); +if (request_irq (irqnr, zevio_timer_interrupt, +IRQF_TIMER |IRQF_IRQPOLL , + timer->clockevent_name, timer)) { +pr_err ("request_irq() on %s failed\n" , + timer->clockevent_name); + }clockevents_config_and_register (&timer->clkevt,clk_get_rate (timer->clk),0x0001 ,0xffff );
include/linux/dw_apb_timer.h +0 -1
@@ -25,7 +25,6 @@ struct dw_apb_timer {struct dw_apb_clock_event_device {struct clock_event_device ced;struct dw_apb_timer timer; -struct irqaction irqaction;void (*eoi)(struct dw_apb_timer *); };
Signature · 1 line
2.24.1
PATCH 17/18 irqchip: Replace setup_irq() by request_irq()
In reply to afzal mohammedrequest_irq() is preferred over setup_irq(). Existing callers of setup_irq() reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.
Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early interrupts were initialized.
Hence replace setup_irq() by request_irq().
Seldom remove_irq() usage has been observed coupled with setup_irq(), wherever that has been found, it too has been replaced by free_irq().
[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
---
Since cc'ing cover letter to all maintainers/reviewers would be too many, refer for cover letter,
https://lkml.kernel.org/r/[email protected]
drivers/irqchip/irq-i8259.c | 9 +++------ drivers/irqchip/irq-ingenic.c | 11 +++++------ 2 files changed, 8 insertions(+), 12 deletions(-)
drivers/irqchip/irq-i8259.c +3 -6
@@ -271,11 +271,6 @@ static void init_8259A(int auto_eoi)/* * IRQ2 is cascade interrupt to second interrupt controller */ -static struct irqaction irq2 = { - .handler = no_action, - .name ="cascade" , - .flags =IRQF_NO_THREAD , -};static struct resource pic1_io_resource = { .name ="pic1" ,
@@ -323,7 +318,9 @@ struct irq_domain * __init __init_i8259_irqs(struct device_node *node)if (!domain)panic ("Failed to add i8259 IRQ domain" ); -setup_irq (I8259A_IRQ_BASE +PIC_CASCADE_IR , &irq2); +if (request_irq (I8259A_IRQ_BASE +PIC_CASCADE_IR , no_action, +IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"cascade" );register_syscore_ops (&i8259_syscore_ops);return domain; }
drivers/irqchip/irq-ingenic.c +5 -6
@@ -58,11 +58,6 @@ static irqreturn_t intc_cascade(int irq, void *data)return IRQ_HANDLED ; } -static struct irqaction intc_cascade_action = { - .handler = intc_cascade, - .name ="SoC intc cascade interrupt" , -}; -static int __init ingenic_intc_of_init (struct device_node *node,unsigned num_chips) {
@@ -130,7 +125,11 @@ static int __init ingenic_intc_of_init(struct device_node *node,irq_reg_writel (gc,IRQ_MSK (32 ),JZ_REG_INTC_SET_MASK ); } -setup_irq (parent_irq, &intc_cascade_action); +if (request_irq (parent_irq, intc_cascade,0 , +"SoC intc cascade interrupt" ,NULL )) { +pr_err ("request_irq() on %s failed\n" , +"SoC intc cascade interrupt" ); + }return 0 ; out_domain_remove:
Signature · 1 line
2.24.1
PATCH 18/18 genirq: Remove setup_irq() and remove_irq()
In reply to afzal mohammedNow that all the users of setup_irq() & remove_irq() has been replaced by request_irq() & free_irq() respectively, delete them.
---
Since cc'ing cover letter to all maintainers/reviewers would be too many, refer for cover letter,
https://lkml.kernel.org/r/[email protected]
include/linux/irq.h | 2 -- kernel/irq/manage.c | 44 -------------------------------------------- 2 files changed, 46 deletions(-)
include/linux/irq.h +0 -2
@@ -560,8 +560,6 @@ enum {#define IRQ_DEFAULT_INIT_FLAGS ARCH_IRQ_INIT_FLAGSstruct irqaction ; -extern int setup_irq (unsigned int irq,struct irqaction *new); -extern void remove_irq (unsigned int irq,struct irqaction *act);extern int setup_percpu_irq (unsigned int irq,struct irqaction *new);extern void remove_percpu_irq (unsigned int irq,struct irqaction *act);
kernel/irq/manage.c +0 -44
56 lines not on this page · raw message
Signature · 1 line
2.24.1
Re: [PATCH 02/18] ARM: replace setup_irq() by request_irq()
In reply to afzal mohammedQuoted 36 lines · afzal mohammed
request_irq()is preferred oversetup_irq(). Existing callers ofsetup_irq()reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.Per tglx[1],
setup_irq()existed in olden days when allocators were not ready by the time early interrupts were initialized.Hence replace
setup_irq()byrequest_irq().Seldom
remove_irq()usage has been observed coupled withsetup_irq(), wherever that has been found, it too has been replaced byfree_irq().[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
Signed-off-by afzal mohammed <[email protected]>--- arch/arm/mach-spear/time.c | 9 ++-------arch/arm/mach-spear/time.c +0
-6@@ -181,12 +181,6 @@ static irqreturn_t spear_timer_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction spear_timer_irq = { - .name ="timer" , - .flags =IRQF_TIMER , - .handler = spear_timer_interrupt -}; -static void __init spear_clockevent_init (int irq) {u32 tick_rate;
arch/arm/mach-spear/time.c static void __init spear_clockevent_init(int irq) · line 200
Quoted 7 lines
arch/arm/mach-spear/time.c +2
-1@@ -201,7 +195,8 @@ static void __init spear_clockevent_init(int irq)clockevents_config_and_register (&clkevt, tick_rate,3 ,0xfff0 ); -setup_irq (irq, &spear_timer_irq); +if (request_irq (irq, spear_timer_interrupt,IRQF_TIMER ,"timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"timer" ); }
Signature · 1 line
viresh
Re: [PATCH 15/18] xtensa: replace setup_irq() by request_irq()
In reply to afzal mohammedQuoted 13 lines · afzal mohammed
request_irq()is preferred oversetup_irq(). Existing callers ofsetup_irq()reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.Per tglx[1],
setup_irq()existed in olden days when allocators were not ready by the time early interrupts were initialized.Hence replace
setup_irq()byrequest_irq().Seldom
remove_irq()usage has been observed coupled withsetup_irq(), wherever that has been found, it too has been replaced byfree_irq().
Quoted 7 lines
[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
Signed-off-by afzal mohammed <[email protected]>--- arch/xtensa/kernel/smp.c | 8 ++------ arch/xtensa/kernel/time.c | 10 +++------- 2 files changed, 5 insertions(+), 13 deletions(-)
Signature · 2 lines
Thanks. -- Max
Re: [PATCH 06/18] m68k: Replace setup_irq() by request_irq()
In reply to afzal mohammedQuoted 45 lines · afzal mohammed
request_irq()is preferred oversetup_irq(). Existing callers ofsetup_irq()reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.Per tglx[1],
setup_irq()existed in olden days when allocators were not ready by the time early interrupts were initialized.Hence replace
setup_irq()byrequest_irq().Seldom
remove_irq()usage has been observed coupled withsetup_irq(), wherever that has been found, it too has been replaced byfree_irq().[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
Signed-off-by afzal mohammed <[email protected]>---
Since cc'ing cover letter to all maintainers/reviewers would be too many, refer for cover letter,
https://lkml.kernel.org/r/[email protected]arch/m68k/68000/timers.c | 9 ++------- arch/m68k/coldfire/pit.c | 9 ++------- arch/m68k/coldfire/sltimers.c | 19 +++++-------------- arch/m68k/coldfire/timers.c | 19 +++++-------------- 4 files changed, 14 insertions(+), 42 deletions(-)arch/m68k/68000/timers.c +0
-6@@ -68,12 +68,6 @@ static irqreturn_t hw_tick(int irq, void *dummy)/***************************************************************************/ -static struct irqaction m68328_timer_irq = { - .name ="timer" , - .flags =IRQF_TIMER , - .handler = hw_tick, -}; -/***************************************************************************/ static u64 m68328_read_clk (struct clocksource *cs)
arch/m68k/68000/timers.c void hw_timer_init(irq_handler_t handler) · line 104
Quoted 6 lines
arch/m68k/68000/timers.c +2
-1@@ -106,7 +100,8 @@ void hw_timer_init(irq_handler_t handler)TCTL =0 ;/* set ISR */ -setup_irq (TMR_IRQ_NUM , &m68328_timer_irq); +if (request_irq (TMR_IRQ_NUM , hw_tick,IRQF_TIMER ,"timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"timer" );
"request_irq() on timer failed" is bad grammar and doesn't convey what went wrong. It could be taken to mean that request_irq() was called because a timer went off.
Have you considered,
pr_err("%s: request_irq() failed\n", "timer");I think that would be more typical of error messages on UNIX. E.g.
$ grep x -- /tmp/foo grep: /tmp/foo: No such file or directory
Quoted 21 lines
arch/m68k/68000/timers.c +0
-0/* Restart mode, Enable int, Set clock source */ TCTL =TCTL_OM |TCTL_IRQEN |CLOCK_SOURCE ;arch/m68k/coldfire/pit.c +0
-6@@ -111,12 +111,6 @@ static irqreturn_t pit_tick(int irq, void *dummy)/***************************************************************************/ -static struct irqaction pit_irq = { - .name ="timer" , - .flags =IRQF_TIMER , - .handler = pit_tick, -}; -/***************************************************************************/ static u64 pit_read_clk (struct clocksource *cs)
arch/m68k/coldfire/pit.c void hw_timer_init(irq_handler_t handler) · line 155
Quoted 7 lines
arch/m68k/coldfire/pit.c +2
-1@@ -156,7 +150,8 @@ void hw_timer_init(irq_handler_t handler) cf_pit_clockevent.min_delta_ticks =0x3f ;clockevents_register_device (&cf_pit_clockevent); -setup_irq (MCF_IRQ_PIT1 , &pit_irq); +if (request_irq (MCF_IRQ_PIT1 , pit_tick,IRQF_TIMER ,"timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"timer" );
Same here.
Quoted 16 lines
arch/m68k/coldfire/pit.c +0
-0clocksource_register_hz (&pit_clk,FREQ ); }arch/m68k/coldfire/sltimers.c +0
-6@@ -50,18 +50,14 @@ irqreturn_t mcfslt_profile_tick(int irq, void *dummy)return IRQ_HANDLED ; } -static struct irqaction mcfslt_profile_irq = { - .name ="profile timer" , - .flags =IRQF_TIMER , - .handler = mcfslt_profile_tick, -}; -
arch/m68k/coldfire/sltimers.c irqreturn_t mcfslt_profile_tick(int irq, void *dummy) · line 61
Quoted 10 lines
arch/m68k/coldfire/sltimers.c +3
-1void mcfslt_profile_init (void ) {printk (KERN_INFO "PROFILE: lodging TIMER 1 @ %dHz as profile timer\n" ,PROFILEHZ ); -setup_irq (MCF_IRQ_PROFILER , &mcfslt_profile_irq); +if (request_irq (MCF_IRQ_PROFILER , mcfslt_profile_tick,IRQF_TIMER , +"profile timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"profile timer" );
And here.
Quoted 16 lines
arch/m68k/coldfire/sltimers.c +0
-6/* Set up TIMER 2 as high speed profile clock */ __raw_writel (MCF_BUSCLK /PROFILEHZ -1 ,PA (MCFSLT_STCNT ));@@ -92,12 +88,6 @@ static irqreturn_t mcfslt_tick(int irq, void *dummy)return timer_interrupt (irq, dummy); } -static struct irqaction mcfslt_timer_irq = { - .name ="timer" , - .flags =IRQF_TIMER , - .handler = mcfslt_tick, -}; -static u64 mcfslt_read_clk (struct clocksource *cs) {unsigned long flags;
arch/m68k/coldfire/sltimers.c void hw_timer_init(irq_handler_t handler) · line 135
Quoted 7 lines
arch/m68k/coldfire/sltimers.c +2
-1@@ -140,7 +130,8 @@ void hw_timer_init(irq_handler_t handler) mcfslt_cnt = mcfslt_cycles_per_jiffy; timer_interrupt = handler; -setup_irq (MCF_IRQ_TIMER , &mcfslt_timer_irq); +if (request_irq (MCF_IRQ_TIMER , mcfslt_tick,IRQF_TIMER ,"timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"timer" );
And so on.
Quoted 54 lines
arch/m68k/coldfire/sltimers.c +0
-0clocksource_register_hz (&mcfslt_clk,MCF_BUSCLK );arch/m68k/coldfire/timers.c +5
-14@@ -82,12 +82,6 @@ static irqreturn_t mcftmr_tick(int irq, void *dummy)/***************************************************************************/ -static struct irqaction mcftmr_timer_irq = { - .name ="timer" , - .flags =IRQF_TIMER , - .handler = mcftmr_tick, -}; -/***************************************************************************/ static u64 mcftmr_read_clk (struct clocksource *cs)@@ -134,7 +128,8 @@ void hw_timer_init(irq_handler_t handler) timer_interrupt = handler;init_timer_irq (); -setup_irq (MCF_IRQ_TIMER , &mcftmr_timer_irq); +if (request_irq (MCF_IRQ_TIMER , mcftmr_tick,IRQF_TIMER ,"timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"timer" );#ifdef CONFIG_HIGHPROFILE coldfire_profile_init ();@@ -170,12 +165,6 @@ irqreturn_t coldfire_profile_tick(int irq, void *dummy)/***************************************************************************/ -static struct irqaction coldfire_profile_irq = { - .name ="profile timer" , - .flags =IRQF_TIMER , - .handler = coldfire_profile_tick, -}; -void coldfire_profile_init (void ) { printk(KERN_INFO "PROFILE: lodging TIMER2 @ %dHz as profile timer\n",@@ -188,7 +177,9 @@ void coldfire_profile_init(void)__raw_writew (MCFTIMER_TMR_ENORI |MCFTIMER_TMR_CLK16 |MCFTIMER_TMR_RESTART |MCFTIMER_TMR_ENABLE ,PA (MCFTIMER_TMR )); -setup_irq (MCF_IRQ_PROFILER , &coldfire_profile_irq); +if (request_irq (MCF_IRQ_PROFILER , coldfire_profile_tick,IRQF_TIMER , +"profile timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"profile timer" ); }/***************************************************************************/
Re: [PATCH 02/18] ARM: replace setup_irq() by request_irq()
In reply to afzal mohammedHi!
Quoted 7 lines · On Wed, 12 Feb 2020 13:32:43 +0530 afzal mohammed <[email protected]>…
request_irq()is preferred oversetup_irq(). Existing callers ofsetup_irq()reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.Per tglx[1],
setup_irq()existed in olden days when allocators were not ready by the time early interrupts were initialized.
Quoted 8 lines
Hence replace
setup_irq()byrequest_irq().Seldom
remove_irq()usage has been observed coupled withsetup_irq(), wherever that has been found, it too has been replaced byfree_irq().[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
Signed-off-by afzal mohammed <[email protected]>
For the EP93xx part:
Quoted 30 lines
arch/arm/mach-ep93xx/timer-ep93xx.c +4
-8@@ -117,13 +117,6 @@ static irqreturn_t ep93xx_timer_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction ep93xx_timer_irq = { - .name ="ep93xx timer" , - .flags =IRQF_TIMER |IRQF_IRQPOLL , - .handler = ep93xx_timer_interrupt, - .dev_id = &ep93xx_clockevent, -}; -void __init ep93xx_timer_init (void ) {/* Enable and register clocksource and sched_clock on timer 4 */ @@ -136,7 +129,10 @@ void __init ep93xx_timer_init(void) EP93XX_TIMER4_RATE);/* Set up clockevent on timer 3 */ -setup_irq (IRQ_EP93XX_TIMER3 , &ep93xx_timer_irq); +if (request_irq (IRQ_EP93XX_TIMER3 , ep93xx_timer_interrupt, +IRQF_TIMER |IRQF_IRQPOLL ,"ep93xx timer" , + &ep93xx_clockevent)) +pr_err ("request_irq() on %s failed\n" ,"ep93xx timer" ); clockevents_config_and_register(&ep93xx_clockevent, EP93XX_TIMER123_RATE, 1,
Signature · 1 line
Alexander Sverdlin.
Re: [PATCH 06/18] m68k: Replace setup_irq() by request_irq()
In reply to Finn ThainHi,
Quoted 11 lines · Finn Thain
arch/m68k/68000/timers.c void hw_timer_init(irq_handler_t handler) · line 104
Quoted 3 lines
arch/m68k/68000/timers.c +2
-1-setup_irq (TMR_IRQ_NUM , &m68328_timer_irq); +if (request_irq (TMR_IRQ_NUM , hw_tick,IRQF_TIMER ,"timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"timer" );"
request_irq()on timer failed" is bad grammar and doesn't convey what went wrong. It could be taken to mean thatrequest_irq()was called because a timer went off.Have you considered,
pr_err("%s: request_irq() failed\n", "timer");
i was uncomfortable with the string contents, since that didn't seem nonsense and to avoid pondering time over it, it was used.
Your suggestion is definitely better, will use that instead.
Regards
afzal
Greg Ungerer
maintainerRe: [PATCH 06/18] m68k: Replace setup_irq() by request_irq()
In reply to afzal mohammedHi Afzal,
Quoted 32 lines · afzal mohammed
request_irq()is preferred oversetup_irq(). Existing callers ofsetup_irq()reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.Per tglx[1],
setup_irq()existed in olden days when allocators were not ready by the time early interrupts were initialized.Hence replace
setup_irq()byrequest_irq().Seldom
remove_irq()usage has been observed coupled withsetup_irq(), wherever that has been found, it too has been replaced byfree_irq().[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
Signed-off-by afzal mohammed <[email protected]>---
Since cc'ing cover letter to all maintainers/reviewers would be too many, refer for cover letter,
https://lkml.kernel.org/r/[email protected]arch/m68k/68000/timers.c | 9 ++------- arch/m68k/coldfire/pit.c | 9 ++------- arch/m68k/coldfire/sltimers.c | 19 +++++-------------- arch/m68k/coldfire/timers.c | 19 +++++-------------- 4 files changed, 14 insertions(+), 42 deletions(-)arch/m68k/68000/timers.c +0
-0
arch/m68k/68000/timers.c static irqreturn_t hw_tick(int irq, void *dummy) · line 71
Quoted 10 lines
arch/m68k/68000/timers.c +0
-6@@ -68,12 +68,6 @@ static irqreturn_t hw_tick(int irq, void *dummy)/***************************************************************************/ -static struct irqaction m68328_timer_irq = { - .name ="timer" , - .flags =IRQF_TIMER , - .handler = hw_tick, -}; -/***************************************************************************/
Remove this comment line as well. Nothing left to separate between those comment lines with the struct initialization removed.
Quoted 16 lines
arch/m68k/68000/timers.c +2
-1static u64 m68328_read_clk (struct clocksource *cs)@@ -106,7 +100,8 @@ void hw_timer_init(irq_handler_t handler)TCTL =0 ;/* set ISR */ -setup_irq (TMR_IRQ_NUM , &m68328_timer_irq); +if (request_irq (TMR_IRQ_NUM , hw_tick,IRQF_TIMER ,"timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"timer" );/* Restart mode, Enable int, Set clock source */ TCTL =TCTL_OM |TCTL_IRQEN |CLOCK_SOURCE ;arch/m68k/coldfire/pit.c +0
-0
arch/m68k/coldfire/pit.c static irqreturn_t pit_tick(int irq, void *dummy) · line 114
Quoted 10 lines
arch/m68k/coldfire/pit.c +0
-6@@ -111,12 +111,6 @@ static irqreturn_t pit_tick(int irq, void *dummy)/***************************************************************************/ -static struct irqaction pit_irq = { - .name ="timer" , - .flags =IRQF_TIMER , - .handler = pit_tick, -}; -/***************************************************************************/
Remove this comment line as well.
Quoted 65 lines
arch/m68k/coldfire/pit.c +2
-1static u64 pit_read_clk (struct clocksource *cs)@@ -156,7 +150,8 @@ void hw_timer_init(irq_handler_t handler) cf_pit_clockevent.min_delta_ticks =0x3f ;clockevents_register_device (&cf_pit_clockevent); -setup_irq (MCF_IRQ_PIT1 , &pit_irq); +if (request_irq (MCF_IRQ_PIT1 , pit_tick,IRQF_TIMER ,"timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"timer" );clocksource_register_hz (&pit_clk,FREQ ); }arch/m68k/coldfire/sltimers.c +5
-14@@ -50,18 +50,14 @@ irqreturn_t mcfslt_profile_tick(int irq, void *dummy)return IRQ_HANDLED ; } -static struct irqaction mcfslt_profile_irq = { - .name ="profile timer" , - .flags =IRQF_TIMER , - .handler = mcfslt_profile_tick, -}; -void mcfslt_profile_init (void ) {printk (KERN_INFO "PROFILE: lodging TIMER 1 @ %dHz as profile timer\n" ,PROFILEHZ ); -setup_irq (MCF_IRQ_PROFILER , &mcfslt_profile_irq); +if (request_irq (MCF_IRQ_PROFILER , mcfslt_profile_tick,IRQF_TIMER , +"profile timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"profile timer" );/* Set up TIMER 2 as high speed profile clock */ __raw_writel (MCF_BUSCLK /PROFILEHZ -1 ,PA (MCFSLT_STCNT ));@@ -92,12 +88,6 @@ static irqreturn_t mcfslt_tick(int irq, void *dummy)return timer_interrupt (irq, dummy); } -static struct irqaction mcfslt_timer_irq = { - .name ="timer" , - .flags =IRQF_TIMER , - .handler = mcfslt_tick, -}; -static u64 mcfslt_read_clk (struct clocksource *cs) {unsigned long flags;@@ -140,7 +130,8 @@ void hw_timer_init(irq_handler_t handler) mcfslt_cnt = mcfslt_cycles_per_jiffy; timer_interrupt = handler; -setup_irq (MCF_IRQ_TIMER , &mcfslt_timer_irq); +if (request_irq (MCF_IRQ_TIMER , mcfslt_tick,IRQF_TIMER ,"timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"timer" );clocksource_register_hz (&mcfslt_clk,MCF_BUSCLK );arch/m68k/coldfire/timers.c +0
-0
arch/m68k/coldfire/timers.c static irqreturn_t mcftmr_tick(int irq, void *dummy) · line 85
Quoted 10 lines
arch/m68k/coldfire/timers.c +0
-6@@ -82,12 +82,6 @@ static irqreturn_t mcftmr_tick(int irq, void *dummy)/***************************************************************************/ -static struct irqaction mcftmr_timer_irq = { - .name ="timer" , - .flags =IRQF_TIMER , - .handler = mcftmr_tick, -}; -/***************************************************************************/
Remove comment line here too.
Quoted 25 lines
arch/m68k/coldfire/timers.c +2
-7static u64 mcftmr_read_clk (struct clocksource *cs)@@ -134,7 +128,8 @@ void hw_timer_init(irq_handler_t handler) timer_interrupt = handler;init_timer_irq (); -setup_irq (MCF_IRQ_TIMER , &mcftmr_timer_irq); +if (request_irq (MCF_IRQ_TIMER , mcftmr_tick,IRQF_TIMER ,"timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"timer" );#ifdef CONFIG_HIGHPROFILE coldfire_profile_init ();@@ -170,12 +165,6 @@ irqreturn_t coldfire_profile_tick(int irq, void *dummy)/***************************************************************************/ -static struct irqaction coldfire_profile_irq = { - .name ="profile timer" , - .flags =IRQF_TIMER , - .handler = coldfire_profile_tick, -}; -void coldfire_profile_init (void ) { printk(KERN_INFO "PROFILE: lodging TIMER2 @ %dHz as profile timer\n",
arch/m68k/coldfire/timers.c void coldfire_profile_init(void) · line 185
Quoted 10 lines
arch/m68k/coldfire/timers.c +3
-1@@ -188,7 +177,9 @@ void coldfire_profile_init(void)__raw_writew (MCFTIMER_TMR_ENORI |MCFTIMER_TMR_CLK16 |MCFTIMER_TMR_RESTART |MCFTIMER_TMR_ENABLE ,PA (MCFTIMER_TMR )); -setup_irq (MCF_IRQ_PROFILER , &coldfire_profile_irq); +if (request_irq (MCF_IRQ_PROFILER , coldfire_profile_tick,IRQF_TIMER , +"profile timer" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"profile timer" ); }/***************************************************************************/
I tested this out on ColdFire hardware I have, worked fine. All defconfigs still compiled too.
Regards
Greg
Re: [PATCH 10/18] powerpc: Replace setup_irq() by request_irq()
In reply to afzal mohammedLe 12/02/2020 à 09:04, afzal mohammed a écrit :
Quoted 7 lines
request_irq()is preferred oversetup_irq(). Existing callers ofsetup_irq()reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.Per tglx[1],
setup_irq()existed in olden days when allocators were not ready by the time early interrupts were initialized.
Quoted 8 lines
Hence replace
setup_irq()byrequest_irq().Seldom
remove_irq()usage has been observed coupled withsetup_irq(), wherever that has been found, it too has been replaced byfree_irq().[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
Signed-off-by afzal mohammed <[email protected]>
Quoted 14 lines
---
Since cc'ing cover letter to all maintainers/reviewers would be too many, refer for cover letter,
https://lkml.kernel.org/r/[email protected]arch/powerpc/platforms/85xx/mpc85xx_cds.c | 10 +++----- arch/powerpc/platforms/8xx/cpm1.c | 9 ++----- arch/powerpc/platforms/8xx/m8xx_setup.c | 9 ++----- arch/powerpc/platforms/chrp/setup.c | 14 ++++------ arch/powerpc/platforms/powermac/pic.c | 31 ++++++++++------------- arch/powerpc/platforms/powermac/smp.c | 9 ++----- 6 files changed, 27 insertions(+), 55 deletions(-)
Re: [PATCH 17/18] irqchip: Replace setup_irq() by request_irq()
In reply to a message not in the archiveHi,
Quoted 7 lines · afzal mohammed
request_irq()is preferred oversetup_irq(). Existing callers ofsetup_irq()reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.Per tglx[1],
setup_irq()existed in olden days when allocators were not ready by the time early interrupts were initialized.
Quoted 8 lines
Hence replace
setup_irq()byrequest_irq().Seldom
remove_irq()usage has been observed coupled withsetup_irq(), wherever that has been found, it too has been replaced byfree_irq().[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
Signed-off-by afzal mohammed <[email protected]>
Quoted 73 lines
---
Since cc'ing cover letter to all maintainers/reviewers would be too many, refer for cover letter,
https://lkml.kernel.org/r/[email protected]
drivers/irqchip/irq-i8259.c | 9 +++------ drivers/irqchip/irq-ingenic.c | 11 +++++------ 2 files changed, 8 insertions(+), 12 deletions(-)drivers/irqchip/irq-i8259.c +3
-6@@ -271,11 +271,6 @@ static void init_8259A(int auto_eoi)/* * IRQ2 is cascade interrupt to second interrupt controller */ -static struct irqaction irq2 = { - .handler = no_action, - .name ="cascade" , - .flags =IRQF_NO_THREAD , -};static struct resource pic1_io_resource = { .name ="pic1" ,@@ -323,7 +318,9 @@ struct irq_domain * __init __init_i8259_irqs(struct device_node *node) if (!domain) panic("Failed to add i8259 IRQ domain"); -setup_irq (I8259A_IRQ_BASE +PIC_CASCADE_IR , &irq2); +if (request_irq (I8259A_IRQ_BASE +PIC_CASCADE_IR , no_action, +IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"cascade" );register_syscore_ops (&i8259_syscore_ops);return domain;}
drivers/irqchip/irq-ingenic.c +0
-5@@ -58,11 +58,6 @@ static irqreturn_t intc_cascade(int irq, void *data)return IRQ_HANDLED ; } -static struct irqaction intc_cascade_action = { - .handler = intc_cascade, - .name ="SoC intc cascade interrupt" , -}; -static int __init ingenic_intc_of_init (struct device_node *node,unsigned num_chips){
drivers/irqchip/irq-ingenic.c +5
-1@@ -130,7 +125,11 @@ static int __init ingenic_intc_of_init(struct device_node *node,irq_reg_writel (gc,IRQ_MSK (32 ),JZ_REG_INTC_SET_MASK ); } -setup_irq (parent_irq, &intc_cascade_action); +if (request_irq (parent_irq, intc_cascade,0 , +"SoC intc cascade interrupt" ,NULL )) { +pr_err ("request_irq() on %s failed\n" , +"SoC intc cascade interrupt" ); + }return 0 ;
out_domain_remove:
--
2.24.1
Re: [PATCH 03/18] c6x: replace setup_irq() by request_irq()
In reply to afzal mohammedQuoted 43 lines · afzal mohammed
request_irq()is preferred oversetup_irq(). Existing callers ofsetup_irq()reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.Per tglx[1],
setup_irq()existed in olden days when allocators were not ready by the time early interrupts were initialized.Hence replace
setup_irq()byrequest_irq().Seldom
remove_irq()usage has been observed coupled withsetup_irq(), wherever that has been found, it too has been replaced byfree_irq().[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
Signed-off-by afzal mohammed <[email protected]>---
Since cc'ing cover letter to all maintainers/reviewers would be too many, refer for cover letter,
https://lkml.kernel.org/r/[email protected]arch/c6x/platforms/timer64.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)arch/c6x/platforms/timer64.c +0
-7@@ -165,13 +165,6 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction timer_iact = { - .name ="timer" , - .flags =IRQF_TIMER , - .handler = timer_interrupt, - .dev_id = &t64_clockevent_device, -}; -void __init timer64_init (void ) {struct clock_event_device *cd = &t64_clockevent_device;
arch/c6x/platforms/timer64.c void __init timer64_init(void) · line 239
Quoted 10 lines
arch/c6x/platforms/timer64.c +3
-1@@ -238,7 +231,9 @@ void __init timer64_init(void) cd->cpumask =cpumask_of (smp_processor_id ());clockevents_register_device (cd); -setup_irq (cd->irq, &timer_iact); +if (request_irq (cd->irq, timer_interrupt,IRQF_TIMER ,"timer" , + &t64_clockevent_device)) +pr_err ("request_irq() on %s failed\n" ,"timer" ); out:of_node_put (np);
Re: [PATCH 06/18] m68k: Replace setup_irq() by request_irq()
In reply to Greg UngererHi Greg,
Quoted 18 lines · Greg Ungerer
arch/m68k/68000/timers.c static irqreturn_t hw_tick(int irq, void *dummy) · line 69
Quoted 13 lines · afzal mohammed
arch/m68k/68000/timers.c +0
-6@@ -68,12 +68,6 @@ static irqreturn_t hw_tick(int irq, void *dummy)/***************************************************************************/ -static struct irqaction m68328_timer_irq = { - .name ="timer" , - .flags =IRQF_TIMER , - .handler = hw_tick, -}; -/***************************************************************************/ Remove this comment line as well. Nothing left to separate between those comment lines with the struct initialization removed.
i will remove above as well as the similar ones.
Because you mentioned, i checked cocci o/p (change above was provided as is by running cocci). Cocci by default removes the comment line you mentioned. Initially that was the way cocci was run, but then it was observed that in another file in addition to removing associated comments, it was swallowing other unrelated comments that were living together. Also sometimes associated comments had to be retained, just that it had to be relocated near added code (that is not applicable in this case). So i ran cocci w/ "--keep-comments" option & decided to manually handle comment related, in this file i failed noticing the unneeded comment line during self review.
Quoted 2 lines
I tested this out on ColdFire hardware I have, worked fine. All defconfigs still compiled too.
Thanks for testing
Regards
afzal
Re: [PATCH 16/18] clocksource: Replace setup_irq() by request_irq()
In reply to afzal mohammedQuoted 7 lines · afzal mohammed
request_irq()is preferred oversetup_irq(). Existing callers ofsetup_irq()reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.Per tglx[1],
setup_irq()existed in olden days when allocators were not ready by the time early interrupts were initialized.
Quoted 8 lines
Hence replace
setup_irq()byrequest_irq().Seldom
remove_irq()usage has been observed coupled withsetup_irq(), wherever that has been found, it too has been replaced byfree_irq().[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
Signed-off-by afzal mohammed <[email protected]>
Nice, thanks for this cleanup
[ ... ]
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
Re: [PATCH 16/18] clocksource: Replace setup_irq() by request_irq()
In reply to afzal mohammedQuoted 7 lines · afzal mohammed
request_irq()is preferred oversetup_irq(). Existing callers ofsetup_irq()reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.Per tglx[1],
setup_irq()existed in olden days when allocators were not ready by the time early interrupts were initialized.
Quoted 8 lines
Hence replace
setup_irq()byrequest_irq().Seldom
remove_irq()usage has been observed coupled withsetup_irq(), wherever that has been found, it too has been replaced byfree_irq().[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
Signed-off-by afzal mohammed <[email protected]>
This makes the kernel a better place.
Yours,
Linus Walleij
Re: [PATCH 18/18] genirq: Remove setup_irq() and remove_irq()
In reply to afzal mohammedQuoted 4 lines · afzal mohammed
Now that all the users of
setup_irq()&remove_irq()has been replaced byrequest_irq()&free_irq()respectively, delete them.Signed-off-by afzal mohammed <[email protected]>
Nice, cutting down and simplifying core code.
Yours,
Linus Walleij
Afzal,
Quoted 11 lines · afzal mohammed
While trying to understand internals of irq handling, came across a thread [1] in which tglx was referring to avoid usage of
setup_irq(). Existing callers ofsetup_irq()reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.Hence instances of
setup_irq()is replaced byrequest_irq()&setup_irq()(along withremove_irq()) definition deleted in the last patch.Seldom
remove_irq()usage has been observed coupled withsetup_irq(), wherever that has been found, it too has been replaced byfree_irq().
thanks a lot for tackling this!
Vs. merging this series, I suggest the following approach:
- Resubmit the individual changes as single patches or small series to the relevant maintainers and subsystem mailing lists. They have no dependency on a core change and can be applied where they belong to.
- After 5.6-rc6, verify which parts have made their way into linux-next and resubmit the ignored ones as a series to me along with the removal of the core parts.
That way we can avoid conflicting changes between subsystems and the tip irq/core branch as much as possible.
Thanks,
tglx
Re: [PATCH 14/18] x86: Replace setup_irq() by request_irq()
In reply to afzal mohammedQuoted 11 lines · afzal mohammed
request_irq()is preferred oversetup_irq(). Existing callers ofsetup_irq()reached mostly via 'init_IRQ()' & 'time_init()', while memory allocators are ready by 'mm_init()'.Per tglx[1],
setup_irq()existed in olden days when allocators were not ready by the time early interrupts were initialized.Hence replace
setup_irq()byrequest_irq().Seldom
remove_irq()usage has been observed coupled withsetup_irq(), wherever that has been found, it too has been replaced byfree_irq().
Please do not copy the irrelevant parts of your boilerplate text into individual changelogs. Changelogs should have the information which is relevant to the patch they describe.
arch/x86/kernel/irqinit.c void __init native_init_IRQ(void) · line 103
Quoted 12 lines
arch/x86/kernel/irqinit.c +6
-2@@ -104,6 +95,11 @@ void __init native_init_IRQ(void)idt_setup_apic_and_irq_gates ();lapic_assign_system_vectors (); -if (!acpi_ioapic && !of_ioapic &&nr_legacy_irqs ()) -setup_irq (2 , &irq2); +if (!acpi_ioapic && !of_ioapic &&nr_legacy_irqs ()) { +/* +* IRQ2 is cascade interrupt to second interrupt controller +*/ +if (request_irq (2 , no_action,IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"cascade" );
What's the purpose of the %s indirection here?
Also that error message is not really helpful:
request_irq() on cascade failed
Something like:
Failed to request irq 2 (cascade).
Hmm?
Quoted 16 lines
arch/x86/kernel/irqinit.c +1
-0+ } }arch/x86/kernel/time.c +0
-6@@ -62,19 +62,15 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction irq0 = { - .handler = timer_interrupt, - .flags =IRQF_NOBALANCING |IRQF_IRQPOLL |IRQF_TIMER , - .name ="timer" -}; -
arch/x86/kernel/time.c static irqreturn_t timer_interrupt(int irq, void *dev_id) · line 73
Quoted 10 lines
arch/x86/kernel/time.c +3
-1static void __init setup_default_timer_irq (void ) {/* * Unconditionally register the legacy timer; even without legacy * PIC/PIT we need this for the HPET0 in legacy replacement mode. */ -if (setup_irq (0 , &irq0)) +if (request_irq (0 , timer_interrupt, +IRQF_NOBALANCING |IRQF_IRQPOLL |IRQF_TIMER ,"timer" , +NULL ))
This is realy ugly.
unsigned long flags = IRQF_NOBALANCING | IRQF_IRQPOLL | IRQF_TIMER;
....
if (request_irq(0, timer_interrupt, flags, "timer", NULL))
....takes the same amount of lines, but is readable.
Thanks,
tglx
Hi Thomas,
Quoted 7 lines · Thomas Gleixner
Vs. merging this series, I suggest the following approach:
- Resubmit the individual changes as single patches or small series to the relevant maintainers and subsystem mailing lists. They have no dependency on a core change and can be applied where they belong to.
Quoted 6 lines
- After 5.6-rc6, verify which parts have made their way into linux-next and resubmit the ignored ones as a series to me along with the removal of the core parts.
That way we can avoid conflicting changes between subsystems and the tip irq/core branch as much as possible.
Okay, i will do accordingly.
[ your mail crossed my v3 (only one patch) posting ]
Regards
afzal
Re: [PATCH 14/18] x86: Replace setup_irq() by request_irq()
In reply to Thomas GleixnerHi Thomas,
Quoted 8 lines · Thomas Gleixner
Quoted 2 lines · afzal mohammed
Seldom
remove_irq()usage has been observed coupled withsetup_irq(), wherever that has been found, it too has been replaced byfree_irq().Please do not copy the irrelevant parts of your boilerplate text into individual changelogs. Changelogs should have the information which is relevant to the patch they describe.
Sure, i will change.
Quoted 4 lines
arch/x86/kernel/irqinit.c void __init native_init_IRQ(void) · line 103
Quoted 2 lines
arch/x86/kernel/irqinit.c +2
-0+if (request_irq (2 , no_action,IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"cascade" );What's the purpose of the %s indirection here?
Putting that indirection helped me automate making these kind of changes w/ cocci. As there were >150 instances of setup_irq and since "failed", "request_irq()" were common, putting a %s indirection with the timer name that changes in each instance, it was easy to take help of cocci to automatically create it (though not fully).
Would you be okay to keep that indirection ?, if not , i will make the changes manually.
Quoted 7 lines
Also that error message is not really helpful:
request_irq()on cascade failedSomething like:
Failed to request irq 2 (cascade).
Yes, as i mentioned in m86k patch (6/18) [1], i was uncomfortable w/ that string, based on Finn's feedback, in v2, it was modified to,
cascade: request_irq() failed
though still using %s indirection.
Quoted 7 lines
arch/x86/kernel/time.c static irqreturn_t timer_interrupt(int irq, void *dev_id) · line 73
Quoted 4 lines
arch/x86/kernel/time.c +3
-1-if (setup_irq (0 , &irq0)) +if (request_irq (0 , timer_interrupt, +IRQF_NOBALANCING |IRQF_IRQPOLL |IRQF_TIMER ,"timer" , +NULL ))This is realy ugly.
Quoted 7 lines
unsigned long flags = IRQF_NOBALANCING | IRQF_IRQPOLL | IRQF_TIMER; .... if (request_irq(0, timer_interrupt, flags, "timer", NULL)) ....takes the same amount of lines, but is readable.
Yeah, i had felt it, the reason i went ahead that way was cocci could automate that way for me for three-fourth of >150 instances making things easy for me. Another reason was to reduce manual changes so as to make it less error prone.
Seems you are against taking the easy route of taking cocci's help, in that case, i will change as you suggest.
There was discussion on m68k (6/18) patch [2], but v2 series on similar lines, not w.r.t flags, but mainly w.r.t return value.
[1] http://lkml.kernel.org/r/20200213020330.GC2684@teres
[2] http://lkml.kernel.org/r/20200227081805.GA5746@afzalpc
Regards
afzal
Re: [PATCH 14/18] x86: Replace setup_irq() by request_irq()
Afzal,
Quoted 32 lines · afzal mohammed
Quoted 8 lines · Thomas Gleixner
Quoted 2 lines · afzal mohammed
Seldom
remove_irq()usage has been observed coupled withsetup_irq(), wherever that has been found, it too has been replaced byfree_irq().Please do not copy the irrelevant parts of your boilerplate text into individual changelogs. Changelogs should have the information which is relevant to the patch they describe.
Sure, i will change.
Quoted 4 lines
arch/x86/kernel/irqinit.c void __init native_init_IRQ(void) · line 103
Quoted 2 lines
arch/x86/kernel/irqinit.c +2
-0+if (request_irq (2 , no_action,IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("request_irq() on %s failed\n" ,"cascade" );What's the purpose of the %s indirection here?
Putting that indirection helped me automate making these kind of changes w/ cocci. As there were >150 instances of
setup_irqand since "failed", "request_irq()" were common, putting a %s indirection with the timer name that changes in each instance, it was easy to take help of cocci to automatically create it (though not fully).Would you be okay to keep that indirection ?, if not , i will make the changes manually.
Quoted 6 lines
Also that error message is not really helpful:
request_irq()on cascade failedSomething like:
Quoted 8 lines
Quoted 1 line
Failed to request irq 2 (cascade).
Yes, as i mentioned in m86k patch (6/18) [1], i was uncomfortable w/ that string, based on Finn's feedback, in v2, it was modified to,
cascade:
request_irq()failedthough still using %s indirection.
Using scripting to find the spots and automatically convert them to something which is functionally and semantically correct is perfectly fine. But scripts neither have taste nor common sense.
So going over a scripted conversion and fixing non-sensical stuff up manually is a good thing.
Quoted 7 lines
Yeah, i had felt it, the reason i went ahead that way was cocci could automate that way for me for three-fourth of >150 instances making things easy for me. Another reason was to reduce manual changes so as to make it less error prone.
Seems you are against taking the easy route of taking cocci's help, in that case, i will change as you suggest.
The easy route is fine for the initial step. See above.
Thanks,
tglx
Re: [PATCH 14/18] x86: Replace setup_irq() by request_irq()
Hi Thomas,
Quoted 8 lines · Thomas Gleixner
Using scripting to find the spots and automatically convert them to something which is functionally and semantically correct is perfectly fine. But scripts neither have taste nor common sense.
So going over a scripted conversion and fixing non-sensical stuff up manually is a good thing.
The easy route is fine for the initial step. See above.
Sure, i will do the changes as per your suggestion.
Regards
afzal
Hi Thomas,
Quoted 9 lines · afzal mohammed
Quoted 7 lines · Thomas Gleixner
Vs. merging this series, I suggest the following approach:
- Resubmit the individual changes as single patches or small series to the relevant maintainers and subsystem mailing lists. They have no dependency on a core change and can be applied where they belong to.
Quoted 8 lines
Quoted 6 lines
- After 5.6-rc6, verify which parts have made their way into linux-next and resubmit the ignored ones as a series to me along with the removal of the core parts.
That way we can avoid conflicting changes between subsystems and the tip irq/core branch as much as possible.
Okay, i will do accordingly.
i am on it, is delayed due to the reason as mentioned at,
https://lkml.kernel.org/r/20200321172626.GA6323@afzalpc
[ not repeating contents here since other mail was sent just now,
cc'ing you ]
Regards
afzal
cover Kill setup_irq()
Hi Thomas,
As compared to the situation mentioned earlier[1], now powerpc patch is also in -next, and the pending ARM patches has been picked up by ARM SoC maintainers today and is expected to show up in next -next. All other subsytem patches has been picked by relevant maintainers & are already in -next except alpha, c6x, hexagon, unicore32 & sh.
As it is the case, i am sending you patches for the above 5 architecture's plus the core removal patch.
Status of 5 arch's:
-------------------
alpha: received ack from Matt Turner, build test success
c6x: did receive ack from Mark Salter in v1, the final
version (v3) was with minor changes, hence removed his ack & cc'ed him, build test success
hexagon: build test success
unicore32: couldn't get toolchain from kernel.org, 0day test robot
or Segher's buildall
sh: To compile the relevant changes sh64 compiler is
required, couldn't get it from above mentioned 3 sources.
Note 1: sh toolchain is available, but that will not make the
relevant changes compile as it has dependency of 64bit arch toolchain, did try a Kconfig hack to make it compile w/ 32bit sh toolchain, but it failed due to other reasons (unknown operands), so gave up on that.
Note 2: hexagon final image creation fails even w/o my patch, but it
has been ensured that w/ my changes relevant object files are getting built w/o warnings.
Regards
afzal
[1] https://lkml.kernel.org/r/20200321172626.GA6323@afzalpc
afzal mohammed (6):
alpha: Replace setup_irq() by request_irq()
c6x: replace setup_irq() by request_irq()
hexagon: replace setup_irq() by request_irq()
sh: replace setup_irq() by request_irq()
unicore32: replace setup_irq() by request_irq()
genirq: Remove setup_irq() and remove_irq()
arch/alpha/kernel/irq_alpha.c | 29 ++++---------------- arch/alpha/kernel/irq_i8259.c | 8 ++---- arch/alpha/kernel/irq_impl.h | 7 +---- arch/alpha/kernel/irq_pyxis.c | 3 ++- arch/alpha/kernel/sys_alcor.c | 3 ++- arch/alpha/kernel/sys_cabriolet.c | 3 ++- arch/alpha/kernel/sys_eb64p.c | 3 ++- arch/alpha/kernel/sys_marvel.c | 2 +- arch/alpha/kernel/sys_miata.c | 6 +++-- arch/alpha/kernel/sys_ruffian.c | 3 ++- arch/alpha/kernel/sys_rx164.c | 3 ++- arch/alpha/kernel/sys_sx164.c | 3 ++- arch/alpha/kernel/sys_wildfire.c | 7 ++--- arch/alpha/kernel/time.c | 6 ++--- arch/c6x/platforms/timer64.c | 11 +++----- arch/hexagon/kernel/smp.c | 22 ++++++++-------- arch/hexagon/kernel/time.c | 11 +++----- arch/sh/boards/mach-cayman/irq.c | 18 +++++-------- arch/sh/drivers/dma/dma-pvr2.c | 9 +++---- arch/unicore32/kernel/time.c | 11 +++----- include/linux/irq.h | 2 -- kernel/irq/manage.c | 44 ------------------------------- 22 files changed, 60 insertions(+), 154 deletions(-)
Signature · 1 line
2.25.1
PATCH v5 1/6 alpha: Replace setup_irq() by request_irq()
request_irq() is preferred over setup_irq(). Invocations of setup_irq() occur after memory allocators are ready.
Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early interrupts were initialized.
Hence replace setup_irq() by request_irq().
[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
---
Link to v4, v3, v2 & v1,
[v4] https://lkml.kernel.org/r/[email protected]
[v3] https://lkml.kernel.org/r/[email protected]
[v2] https://lkml.kernel.org/r/[email protected]
[v1] https://lkml.kernel.org/r/[email protected]
v5:
* Add tag
v4:
* Fix build error @ init_rtc_irq arg
v3:
* Split out from tree wide series, as Thomas suggested to get it thr' respective maintainers
* Modify pr_err displayed in case of error
* Re-arrange code & choose pr_err args as required to improve readability
* Remove irrelevant parts from commit message & improve
v2:
* Replace pr_err("request_irq() on %s failed" by
pr_err("%s: request_irq() failed"* Commit message massage
arch/alpha/kernel/irq_alpha.c | 29 +++++------------------------ arch/alpha/kernel/irq_i8259.c | 8 ++------ arch/alpha/kernel/irq_impl.h | 7 +------ arch/alpha/kernel/irq_pyxis.c | 3 ++- arch/alpha/kernel/sys_alcor.c | 3 ++- arch/alpha/kernel/sys_cabriolet.c | 3 ++- arch/alpha/kernel/sys_eb64p.c | 3 ++- arch/alpha/kernel/sys_marvel.c | 2 +- arch/alpha/kernel/sys_miata.c | 6 ++++-- arch/alpha/kernel/sys_ruffian.c | 3 ++- arch/alpha/kernel/sys_rx164.c | 3 ++- arch/alpha/kernel/sys_sx164.c | 3 ++- arch/alpha/kernel/sys_wildfire.c | 7 ++----- arch/alpha/kernel/time.c | 6 ++---- 14 files changed, 31 insertions(+), 55 deletions(-)
arch/alpha/kernel/irq_alpha.c +5 -24
@@ -213,32 +213,13 @@ process_mcheck_info(unsigned long vector, unsigned long la_ptr,* The special RTC interrupt type. The interrupt itself was * processed by PALcode, and comes in via entInt vector 1. */ - -struct irqaction timer_irqaction = { - .handler = rtc_timer_interrupt, - .name ="timer" , -}; -void __init -init_rtc_irq (void ) +init_rtc_irq (irq_handler_t handler) {irq_set_chip_and_handler_name (RTC_IRQ , &dummy_irq_chip, handle_percpu_irq,"RTC" ); -setup_irq (RTC_IRQ , &timer_irqaction); +if (!handler) + handler = rtc_timer_interrupt; +if (request_irq (RTC_IRQ , handler,0 ,"timer" ,NULL )) +pr_err ("Failed to register timer interrupt\n" ); } - -/* Dummy irqactions. */ -struct irqaction isa_cascade_irqaction = { - .handler = no_action, - .name ="isa-cascade" -}; - -struct irqaction timer_cascade_irqaction = { - .handler = no_action, - .name ="timer-cascade" -}; - -struct irqaction halt_switch_irqaction = { - .handler = no_action, - .name ="halt-switch" -};
arch/alpha/kernel/irq_i8259.c +2 -6
@@ -82,11 +82,6 @@ struct irq_chip i8259a_irq_type = {void __init init_i8259a_irqs (void ) { -static struct irqaction cascade = { - .handler = no_action, - .name ="cascade" , - }; -long i;outb (0xff ,0x21 );/* mask all of 8259A-1 */
@@ -96,7 +91,8 @@ init_i8259a_irqs(void)irq_set_chip_and_handler (i, &i8259a_irq_type, handle_level_irq); } -setup_irq (2 , &cascade); +if (request_irq (2 , no_action,0 ,"cascade" ,NULL )) +pr_err ("Failed to request irq 2 (cascade)\n" ); }
arch/alpha/kernel/irq_impl.h +1 -6
@@ -21,14 +21,9 @@ extern void isa_no_iack_sc_device_interrupt(unsigned long);extern void srm_device_interrupt (unsigned long );extern void pyxis_device_interrupt (unsigned long ); -extern struct irqaction timer_irqaction; -extern struct irqaction isa_cascade_irqaction; -extern struct irqaction timer_cascade_irqaction; -extern struct irqaction halt_switch_irqaction; -extern void init_srm_irqs (long ,unsigned long );extern void init_pyxis_irqs (unsigned long ); -extern void init_rtc_irq (void ); +extern void init_rtc_irq (irq_handler_t handler);extern void common_init_isa_dma (void );
arch/alpha/kernel/irq_pyxis.c +2 -1
@@ -107,5 +107,6 @@ init_pyxis_irqs(unsigned long ignore_mask)irq_set_status_flags (i,IRQ_LEVEL ); } -setup_irq (16 +7 , &isa_cascade_irqaction); +if (request_irq (16 +7 , no_action,0 ,"isa-cascade" ,NULL )) +pr_err ("Failed to register isa-cascade interrupt\n" ); }
arch/alpha/kernel/sys_alcor.c +2 -1
@@ -133,7 +133,8 @@ alcor_init_irq(void)init_i8259a_irqs ();common_init_isa_dma (); -setup_irq (16 +31 , &isa_cascade_irqaction); +if (request_irq (16 +31 , no_action,0 ,"isa-cascade" ,NULL )) +pr_err ("Failed to register isa-cascade interrupt\n" ); }
arch/alpha/kernel/sys_cabriolet.c +2 -1
@@ -112,7 +112,8 @@ common_init_irq(void (*srm_dev_int)(unsigned long v)) }common_init_isa_dma (); -setup_irq (16 +4 , &isa_cascade_irqaction); +if (request_irq (16 +4 , no_action,0 ,"isa-cascade" ,NULL )) +pr_err ("Failed to register isa-cascade interrupt\n" ); }#ifndef CONFIG_ALPHA_PC164
arch/alpha/kernel/sys_eb64p.c +2 -1
@@ -123,7 +123,8 @@ eb64p_init_irq(void) }common_init_isa_dma (); -setup_irq (16 +5 , &isa_cascade_irqaction); +if (request_irq (16 +5 , no_action,0 ,"isa-cascade" ,NULL )) +pr_err ("Failed to register isa-cascade interrupt\n" ); }/*
arch/alpha/kernel/sys_marvel.c +1 -1
@@ -397,7 +397,7 @@ marvel_init_pci(void)static void __init marvel_init_rtc (void ) { -init_rtc_irq (); +init_rtc_irq (NULL ); } static void
arch/alpha/kernel/sys_miata.c +4 -2
@@ -81,8 +81,10 @@ miata_init_irq(void)init_pyxis_irqs (0x63b0000 );common_init_isa_dma (); -setup_irq (16 +2 , &halt_switch_irqaction);/* SRM only? */ -setup_irq (16 +6 , &timer_cascade_irqaction); +if (request_irq (16 +2 , no_action,0 ,"halt-switch" ,NULL )) +pr_err ("Failed to register halt-switch interrupt\n" ); +if (request_irq (16 +6 , no_action,0 ,"timer-cascade" ,NULL )) +pr_err ("Failed to register timer-cascade interrupt\n" ); }
arch/alpha/kernel/sys_ruffian.c +2 -1
@@ -82,7 +82,8 @@ ruffian_init_rtc(void)outb (0x31 ,0x42 );outb (0x13 ,0x42 ); -setup_irq (0 , &timer_irqaction); +if (request_irq (0 , rtc_timer_interrupt,0 ,"timer" ,NULL )) +pr_err ("Failed to request irq 0 (timer)\n" ); } static void
arch/alpha/kernel/sys_rx164.c +2 -1
@@ -106,7 +106,8 @@ rx164_init_irq(void)init_i8259a_irqs ();common_init_isa_dma (); -setup_irq (16 +20 , &isa_cascade_irqaction); +if (request_irq (16 +20 , no_action,0 ,"isa-cascade" ,NULL )) +pr_err ("Failed to register isa-cascade interrupt\n" ); }
arch/alpha/kernel/sys_sx164.c +2 -1
@@ -54,7 +54,8 @@ sx164_init_irq(void)else init_pyxis_irqs (0xff00003f0000UL ); -setup_irq (16 +6 , &timer_cascade_irqaction); +if (request_irq (16 +6 , no_action,0 ,"timer-cascade" ,NULL )) +pr_err ("Failed to register timer-cascade interrupt\n" ); }/*
arch/alpha/kernel/sys_wildfire.c +2 -5
@@ -156,10 +156,6 @@ static void __init wildfire_init_irq_per_pca(int qbbno, int pcano) { int i, irq_bias; -static struct irqaction isa_enable = { - .handler = no_action, - .name ="isa_enable" , - }; irq_bias = qbbno * (WILDFIRE_PCA_PER_QBB *WILDFIRE_IRQ_PER_PCA ) + pcano *WILDFIRE_IRQ_PER_PCA ;
@@ -198,7 +194,8 @@ wildfire_init_irq_per_pca(int qbbno, int pcano)irq_set_status_flags (i + irq_bias,IRQ_LEVEL ); } -setup_irq (32 +irq_bias, &isa_enable); +if (request_irq (32 + irq_bias, no_action,0 ,"isa_enable" ,NULL )) +pr_err ("Failed to register isa_enable interrupt\n" ); } static void __init
arch/alpha/kernel/time.c +2 -4
@@ -242,7 +242,7 @@ common_init_rtc(void)outb (0x31 ,0x42 );outb (0x13 ,0x42 ); -init_rtc_irq (); +init_rtc_irq (NULL ); }
@@ -396,9 +396,7 @@ time_init(void)if (alpha_using_qemu) {clocksource_register_hz (&qemu_cs,NSEC_PER_SEC );init_qemu_clockevent (); - - timer_irqaction.handler = qemu_timer_interrupt; -init_rtc_irq (); +init_rtc_irq (qemu_timer_interrupt);return ; }
Signature · 1 line
2.25.1
PATCH v5 2/6 c6x: replace setup_irq() by request_irq()
In reply to afzal mohammedrequest_irq() is preferred over setup_irq(). Invocations of setup_irq() occur after memory allocators are ready.
Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early interrupts were initialized.
Hence replace setup_irq() by request_irq().
[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
---
Link to v3, v2 & v1,
[v3] https://lkml.kernel.org/r/[email protected]
[v2] https://lkml.kernel.org/r/[email protected]
[v1] https://lkml.kernel.org/r/[email protected]
v5:
* No change
v4:
* Non-existent
v3:
* Split out from tree wide series, as Thomas suggested to get it thr' respective maintainers
* Modify pr_err displayed in case of error
* Re-arrange code & choose pr_err args as required to improve readability
* Remove irrelevant parts from commit message & improve
v2:
* Replace pr_err("request_irq() on %s failed" by
pr_err("%s: request_irq() failed"* Commit message massage
arch/c6x/platforms/timer64.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
arch/c6x/platforms/timer64.c +3 -8
@@ -165,13 +165,6 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct irqaction timer_iact = { - .name ="timer" , - .flags =IRQF_TIMER , - .handler = timer_interrupt, - .dev_id = &t64_clockevent_device, -}; -void __init timer64_init (void ) {struct clock_event_device *cd = &t64_clockevent_device;
@@ -238,7 +231,9 @@ void __init timer64_init(void) cd->cpumask =cpumask_of (smp_processor_id ());clockevents_register_device (cd); -setup_irq (cd->irq, &timer_iact); +if (request_irq (cd->irq, timer_interrupt,IRQF_TIMER ,"timer" , + &t64_clockevent_device)) +pr_err ("Failed to request irq %d (timer)\n" , cd->irq); out:of_node_put (np);
Signature · 1 line
2.25.1
PATCH v5 3/6 hexagon: replace setup_irq() by request_irq()
In reply to afzal mohammedrequest_irq() is preferred over setup_irq(). Invocations of setup_irq() occur after memory allocators are ready.
Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early interrupts were initialized.
Hence replace setup_irq() by request_irq().
[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
---
Link to v3, v2 & v1,
[v3] https://lkml.kernel.org/r/[email protected]
[v2] https://lkml.kernel.org/r/[email protected]
[v1] https://lkml.kernel.org/r/[email protected]
v5:
* No change
v4:
* Non-existent
v3:
* Split out from tree wide series, as Thomas suggested to get it thr' respective maintainers
* Modify pr_err displayed in case of error
* Re-arrange code & choose pr_err args as required to improve readability
* Remove irrelevant parts from commit message & improve
v2:
* Replace pr_err("request_irq() on %s failed" by
pr_err("%s: request_irq() failed"* Commit message massage
arch/hexagon/kernel/smp.c | 22 +++++++++++----------- arch/hexagon/kernel/time.c | 11 +++-------- 2 files changed, 14 insertions(+), 19 deletions(-)
arch/hexagon/kernel/smp.c +11 -11
@@ -114,12 +114,6 @@ void send_ipi(const struct cpumask *cpumask, enum ipi_message_type msg)local_irq_restore (flags); } -static struct irqaction ipi_intdesc = { - .handler = handle_ipi, - .flags =IRQF_TRIGGER_RISING , - .name ="ipi_handler" -}; -void __init smp_prepare_boot_cpu (void ) { }
@@ -132,8 +126,8 @@ void __init smp_prepare_boot_cpu(void)void start_secondary (void ) { -unsigned int cpu;unsigned long thread_ptr; +unsigned int cpu, irq;/* Calculate thread_info pointer from stack pointer */ __asm__ __volatile__(
@@ -155,7 +149,10 @@ void start_secondary(void) cpu =smp_processor_id (); -setup_irq (BASE_IPI_IRQ + cpu, &ipi_intdesc); + irq =BASE_IPI_IRQ + cpu; +if (request_irq (irq, handle_ipi,IRQF_TRIGGER_RISING ,"ipi_handler" , +NULL )) +pr_err ("Failed to request irq %u (ipi_handler)\n" , irq);/* Register the clock_event dummy */ setup_percpu_clockdev ();
@@ -201,7 +198,7 @@ void __init smp_cpus_done(unsigned int max_cpus)void __init smp_prepare_cpus (unsigned int max_cpus) { -int i; +int i, irq =BASE_IPI_IRQ ;/* * should eventually have some sort of machine
@@ -213,8 +210,11 @@ void __init smp_prepare_cpus(unsigned int max_cpus)set_cpu_present (i, true);/* Also need to register the interrupts for IPI */ -if (max_cpus >1 ) -setup_irq (BASE_IPI_IRQ , &ipi_intdesc); +if (max_cpus >1 ) { +if (request_irq (irq, handle_ipi,IRQF_TRIGGER_RISING , +"ipi_handler" ,NULL )) +pr_err ("Failed to request irq %d (ipi_handler)\n" , irq); + } }void smp_send_reschedule (int cpu)
arch/hexagon/kernel/time.c +3 -8
@@ -143,13 +143,6 @@ static irqreturn_t timer_interrupt(int irq, void *devid)return IRQ_HANDLED ; } -/* This should also be pulled from devtree */ -static struct irqaction rtos_timer_intdesc = { - .handler = timer_interrupt, - .flags =IRQF_TIMER |IRQF_TRIGGER_RISING , - .name ="rtos_timer" -}; -/* * time_init_deferred - called by start_kernel to set up timer/clock source *
@@ -163,6 +156,7 @@ void __init time_init_deferred(void) {struct resource *resource =NULL ;struct clock_event_device *ce_dev = &hexagon_clockevent_dev; +unsigned long flag =IRQF_TIMER |IRQF_TRIGGER_RISING ; ce_dev->cpumask = cpu_all_mask;
@@ -195,7 +189,8 @@ void __init time_init_deferred(void)#endif clockevents_register_device (ce_dev); -setup_irq (ce_dev->irq, &rtos_timer_intdesc); +if (request_irq (ce_dev->irq, timer_interrupt, flag,"rtos_timer" ,NULL )) +pr_err ("Failed to register rtos_timer interrupt\n" ); }void __init time_init (void )
Signature · 1 line
2.25.1
PATCH v5 4/6 sh: replace setup_irq() by request_irq()
In reply to afzal mohammedrequest_irq() is preferred over setup_irq(). Invocations of setup_irq() occur after memory allocators are ready.
Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early interrupts were initialized.
Hence replace setup_irq() by request_irq().
[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
---
Link to v3, v2 & v1,
[v3] https://lkml.kernel.org/r/[email protected]
[v2] https://lkml.kernel.org/r/[email protected]
[v1] https://lkml.kernel.org/r/[email protected]
v5:
* No change
v4:
* Non-existent
v3:
* Split out from tree wide series, as Thomas suggested to get it thr' respective maintainers
* Modify pr_err displayed in case of error
* Re-arrange code & choose pr_err args as required to improve readability
* Remove irrelevant parts from commit message & improve
v2:
* Replace pr_err("request_irq() on %s failed" by
pr_err("%s: request_irq() failed"* Commit message massage
arch/sh/boards/mach-cayman/irq.c | 18 ++++++------------ arch/sh/drivers/dma/dma-pvr2.c | 9 +++------ 2 files changed, 9 insertions(+), 18 deletions(-)
arch/sh/boards/mach-cayman/irq.c +6 -12
@@ -40,16 +40,6 @@ static irqreturn_t cayman_interrupt_pci2(int irq, void *dev_id)return IRQ_NONE ; } -static struct irqaction cayman_action_smsc = { - .name ="Cayman SMSC Mux" , - .handler = cayman_interrupt_smsc, -}; - -static struct irqaction cayman_action_pci2 = { - .name ="Cayman PCI2 Mux" , - .handler = cayman_interrupt_pci2, -}; -static void enable_cayman_irq (struct irq_data *data) {unsigned int irq = data->irq;
@@ -149,6 +139,10 @@ void init_cayman_irq(void) }/* Setup the SMSC interrupt */ -setup_irq (SMSC_IRQ , &cayman_action_smsc); -setup_irq (PCI2_IRQ , &cayman_action_pci2); +if (request_irq (SMSC_IRQ , cayman_interrupt_smsc,0 ,"Cayman SMSC Mux" , +NULL )) +pr_err ("Failed to register Cayman SMSC Mux interrupt\n" ); +if (request_irq (PCI2_IRQ , cayman_interrupt_pci2,0 ,"Cayman PCI2 Mux" , +NULL )) +pr_err ("Failed to register Cayman PCI2 Mux interrupt\n" ); }
arch/sh/drivers/dma/dma-pvr2.c +3 -6
@@ -64,11 +64,6 @@ static int pvr2_xfer_dma(struct dma_channel *chan)return 0 ; } -static struct irqaction pvr2_dma_irq = { - .name ="pvr2 DMA handler" , - .handler = pvr2_dma_interrupt, -}; -static struct dma_ops pvr2_dma_ops = { .request = pvr2_request_dma, .get_residue = pvr2_get_dma_residue,
@@ -84,7 +79,9 @@ static struct dma_info pvr2_dma_info = {static int __init pvr2_dma_init (void ) { -setup_irq (HW_EVENT_PVR2_DMA , &pvr2_dma_irq); +if (request_irq (HW_EVENT_PVR2_DMA , pvr2_dma_interrupt,0 , +"pvr2 DMA handler" ,NULL )) +pr_err ("Failed to register pvr2 DMA handler interrupt\n" );request_dma (PVR2_CASCADE_CHAN ,"pvr2 cascade" );return register_dmac (&pvr2_dma_info);
Signature · 1 line
2.25.1
PATCH v5 5/6 unicore32: replace setup_irq() by request_irq()
In reply to afzal mohammedrequest_irq() is preferred over setup_irq(). Invocations of setup_irq() occur after memory allocators are ready.
Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early interrupts were initialized.
Hence replace setup_irq() by request_irq().
[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
---
Link to v3, v2 & v1,
[v3] https://lkml.kernel.org/r/[email protected]
[v2] https://lkml.kernel.org/r/[email protected]
[v1] https://lkml.kernel.org/r/[email protected]
v5:
* No change
v4:
* Non-existent
v3:
* Split out from tree wide series, as Thomas suggested to get it thr' respective maintainers
* Modify pr_err displayed in case of error
* Re-arrange code & choose pr_err args as required to improve readability
* Remove irrelevant parts from commit message & improve
v2:
* Replace pr_err("request_irq() on %s failed" by
pr_err("%s: request_irq() failed"* Commit message massage
arch/unicore32/kernel/time.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
arch/unicore32/kernel/time.c +3 -8
@@ -72,13 +72,6 @@ static struct clocksource cksrc_puv3_oscr = { .flags = CLOCK_SOURCE_IS_CONTINUOUS, }; -static struct irqaction puv3_timer_irq = { - .name ="ost0" , - .flags =IRQF_TIMER |IRQF_IRQPOLL , - .handler = puv3_ost0_interrupt, - .dev_id = &ckevt_puv3_osmr0, -}; -void __init time_init (void ) {writel (0 ,OST_OIER );/* disable any timer interrupts */
@@ -94,7 +87,9 @@ void __init time_init(void) ckevt_puv3_osmr0.min_delta_ticks =MIN_OSCR_DELTA *2 ; ckevt_puv3_osmr0.cpumask =cpumask_of (0 ); -setup_irq (IRQ_TIMER0 , &puv3_timer_irq); +if (request_irq (IRQ_TIMER0 , puv3_ost0_interrupt, +IRQF_TIMER |IRQF_IRQPOLL ,"ost0" , &ckevt_puv3_osmr0)) +pr_err ("Failed to register ost0 interrupt\n" );clocksource_register_hz (&cksrc_puv3_oscr,CLOCK_TICK_RATE );clockevents_register_device (&ckevt_puv3_osmr0);
Signature · 1 line
2.25.1
PATCH v5 6/6 genirq: Remove setup_irq() and remove_irq()
In reply to afzal mohammedNow that all the users of setup_irq() & remove_irq() has been replaced by request_irq() & free_irq() respectively, delete them.
---
v5:
* No change
v4-v3:
* Non-existent
v2:
* Add tags
include/linux/irq.h | 2 -- kernel/irq/manage.c | 44 -------------------------------------------- 2 files changed, 46 deletions(-)
include/linux/irq.h +0 -2
@@ -560,8 +560,6 @@ enum {#define IRQ_DEFAULT_INIT_FLAGS ARCH_IRQ_INIT_FLAGSstruct irqaction ; -extern int setup_irq (unsigned int irq,struct irqaction *new); -extern void remove_irq (unsigned int irq,struct irqaction *act);extern int setup_percpu_irq (unsigned int irq,struct irqaction *new);extern void remove_percpu_irq (unsigned int irq,struct irqaction *act);
kernel/irq/manage.c +0 -44
56 lines not on this page · raw message
Signature · 1 line
2.25.1
RE: [PATCH 0/6] Kill setup_irq()
In reply to afzal mohammedQuoted 13 lines
-----Original Message-----
From: [email protected] <linux-hexagon- [email protected]> On Behalf Of afzal mohammed
Sent: Friday, March 27, 2020 11:08 AM
To: Thomas Gleixner <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; [email protected]; linuxppc- [email protected]; [email protected]; linux- [email protected]; [email protected]; linux- [email protected]; [email protected]; linux-c6x-dev@linux- c6x.org; [email protected]; [email protected]
Subject: [PATCH 0/6] Killsetup_irq()
...
Quoted 1 line
Note 1: sh toolchain is available, but that will not make the relevant
changes
Quoted 1 line
compile as it has dependency of 64bit arch toolchain, did try a
Kconfig
hack
Quoted 1 line
to make it compile w/ 32bit sh toolchain, but it failed due to other
reasons
Quoted 3 lines
(unknown operands), so gave up on that.
Note 2: hexagon final image creation fails even w/o my patch, but it has been ensured that w/ my changes relevant object files are getting built
w/o
Quoted 1 line
warnings.
Afzal,
What's the nature of the failure in "Note 2"?
-Brian
Re: [PATCH 0/6] Kill setup_irq()
Hi Brian,
Quoted 3 lines · Brian Cain
Quoted 1 line
Note 2: hexagon final image creation fails even w/o my patch
What's the nature of the failure in "Note 2"?
drivers/base/firmware_loader/main.o: In function `fw_is_builtin_firmware':
/devel/src/kernel6/drivers/base/firmware_loader/main.c:132:(.text+0xc8): relocation truncated to fit: R_HEX_16_X against symbol `__start_builtin_fw' defined in .modinfo section in .tmp_vmlinux1 Makefile:1077: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1
[ i had deleted the toolchain earlier, since you asked, download again & checked ]
Regards
afzal
RE: [PATCH 0/6] Kill setup_irq()
Quoted 3 lines
-----Original Message-----
From: [email protected] <linux-hexagon- [email protected]> On Behalf Of afzal mohammed
...
Quoted 9 lines · Brian Cain
Quoted 4 lines
Quoted 2 lines
Note 2: hexagon final image creation fails even w/o my patch
What's the nature of the failure in "Note 2"?
drivers/base/firmware_loader/main.o: In function `fw_is_builtin_firmware':
/devel/src/kernel6/drivers/base/firmware_loader/main.c:132:(.text+0xc8):
relocation truncated to fit:R_HEX_16_Xagainst symbol
`__start_builtin_fw'
Quoted 3 lines
defined in .modinfo section in .tmp_vmlinux1
Makefile:1077: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1
Thanks for reporting it -- I will make a patch to fix it.
-Brian
Re: [PATCH v5 6/6] genirq: Remove setup_irq() and remove_irq()
In reply to afzal mohammedHi Thomas,
Quoted 2 lines · afzal mohammed
Now that all the users of
setup_irq()&remove_irq()has been replaced byrequest_irq()&free_irq()respectively, delete them.
All the setup_irq() & remove_irq() replacements have hit Linus's HEAD. Any time this change can be sent to mainline.
Regards
afzal