MIPS: Replace setup_irq() by request_irq()
Subsystems (7)
PATCH v3 1/1 MIPS: 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().
remove_irq() has been replaced by free_irq() as well.
[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
---
Hi mips maintainers,
if okay w/ this change, please consider taking it thr' your tree, else please let me know.
Regards
afzal
Link to v2 & v1,
[v2] https://lkml.kernel.org/r/[email protected]
[v1] https://lkml.kernel.org/r/[email protected]
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/mips/alchemy/common/time.c | 11 +--- arch/mips/ar7/irq.c | 16 ++--- arch/mips/ath25/ar2315.c | 9 +-- arch/mips/ath25/ar5312.c | 9 +-- arch/mips/bcm63xx/irq.c | 41 +++++-------- arch/mips/cobalt/irq.c | 18 +++--- arch/mips/dec/setup.c | 59 ++++++++----------- arch/mips/emma/markeins/irq.c | 21 ++++--- 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 | 11 ++-- 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 | 16 ++--- 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 | 11 +--- arch/mips/pmcs-msp71xx/msp_irq.c | 28 ++++----- arch/mips/pmcs-msp71xx/msp_smp.c | 22 ++----- arch/mips/pmcs-msp71xx/msp_time.c | 8 ++- arch/mips/ralink/cevt-rt3352.c | 16 +++-- arch/mips/sgi-ip22/ip22-eisa.c | 10 +--- 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, 237 insertions(+), 410 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 ("Failed to register timer interrupt\n" );printk (KERN_INFO "Alchemy clocksource installed\n" );
arch/mips/ar7/irq.c +8 -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,14 @@ 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 ("Failed to request irq 2 (AR7 cascade interrupt)\n" ); +if (request_irq (ar7_irq_base, no_action,IRQF_NO_THREAD , +"AR7 cascade interrupt" ,NULL )) { +pr_err ("Failed to request irq %d (AR7 cascade interrupt)\n" , + ar7_irq_base); + }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 ("Failed to register ar2315-ahb-error interrupt\n" );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 ("Failed to register ar5312-ahb-error interrupt\n" );irq_set_chained_handler_and_data (AR5312_IRQ_MISC , ar5312_misc_irq_handler, domain);
arch/mips/bcm63xx/irq.c +16 -25
63 lines not on this page · raw message
arch/mips/cobalt/irq.c +10 -8
@@ -45,18 +45,20 @@ 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 ("Failed to request irq %d (cascade)\n" , +GT641XX_CASCADE_IRQ ); + } +if (request_irq (I8259_CASCADE_IRQ , no_action,IRQF_NO_THREAD , +"cascade" ,NULL )) { +pr_err ("Failed to request irq %d (cascade)\n" , +I8259_CASCADE_IRQ ); + } }
arch/mips/dec/setup.c +24 -35
93 lines not on this page · raw message
arch/mips/emma/markeins/irq.c +10 -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 */
@@ -236,6 +228,7 @@ void emma2rh_irq_dispatch(void)void __init arch_init_irq (void ) {u32 reg; +int irq;/* by default, interrupts are disabled. */ emma2rh_out32 (EMMA2RH_BHIF_INT_EN_0 ,0 );
@@ -272,9 +265,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); + irq =EMMA2RH_IRQ_BASE +EMMA2RH_SW_CASCADE ; +if (request_irq (irq, no_action,IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("Failed to request irq %d (cascade)\n" , irq); + irq =EMMA2RH_IRQ_BASE +EMMA2RH_GPIO_CASCADE ; +if (request_irq (irq, no_action,IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("Failed to request irq %d (cascade)\n" , irq); + irq =MIPS_CPU_IRQ_BASE +2 ; +if (request_irq (irq, no_action,IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("Failed to request irq %d (cascade)\n" , irq); } 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 ("Failed to register R4030 timer interrupt\n" );/* * Set clock to 100Hz.
arch/mips/kernel/cevt-bcm1480.c +3 -8
@@ -91,16 +91,15 @@ 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); +unsigned long flags =IRQF_PERCPU |IRQF_TIMER ;BUG_ON (cpu >3 );/* Only have 4 general purpose timers */
@@ -133,11 +132,7 @@ 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, flags, name, cd)) +pr_err ("Failed to request irq %d (%s)\n" , irq, name); }
arch/mips/kernel/cevt-ds1287.c +2 -7
@@ -100,14 +100,9 @@ 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) { +unsigned long flags =IRQF_PERCPU |IRQF_TIMER ;struct clock_event_device *cd; cd = &ds1287_clockevent;
@@ -122,5 +117,5 @@ int __init ds1287_clockevent_init(int irq)clockevents_register_device (&ds1287_clockevent); -return setup_irq (irq, &ds1287_irqaction); +return request_irq (irq, ds1287_interrupt, flags,"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
@@ -252,6 +252,7 @@ unsigned int __weak get_c0_compare_int(void)int r4k_clockevent_init (void ) { +unsigned long flags =IRQF_PERCPU |IRQF_TIMER |IRQF_SHARED ;unsigned int cpu =smp_processor_id ();struct clock_event_device *cd;unsigned int irq, min_delta;
@@ -291,7 +292,8 @@ int r4k_clockevent_init(void) cp0_timer_irq_installed =1 ; -setup_irq (irq, &c0_compare_irqaction); +if (request_irq (irq, c0_compare_interrupt, flags,"timer" ,NULL )) +pr_err ("Failed to request irq %d (timer)\n" , irq);return 0 ; }
arch/mips/kernel/cevt-sb1250.c +3 -8
@@ -90,16 +90,15 @@ 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); +unsigned long flags =IRQF_PERCPU |IRQF_TIMER ;/* Only have 4 general purpose timers, and we use last one as hpt */ BUG_ON (cpu >2 );
@@ -133,11 +132,7 @@ 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, flags, name, cd)) +pr_err ("Failed to request irq %d (%s)\n" , irq, 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 ("Failed to request irq %d (txx9tmr)\n" , irq);printk (KERN_INFO "TXx9: clockevent device at 0x%lx, irq %d\n" , baseaddr, irq); }
arch/mips/kernel/i8253.c +4 -7
@@ -18,16 +18,13 @@ 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 ) { +unsigned long flags =IRQF_NOBALANCING |IRQF_TIMER ; +clockevent_i8253_init (true); -setup_irq (0 , &irq0); +if (request_irq (0 , timer_interrupt, flags,"timer" ,NULL )) +pr_err ("Failed to request irq 0 (timer)\n" ); }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,14 +90,9 @@ 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 irq =LASAT_CASCADE_IRQ ;int i;if (IS_LASAT_200 ()) {
@@ -119,5 +114,6 @@ 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 (irq, no_action,IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("Failed to request irq %d (cascade)\n" , irq); }
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); + i =LOONGSON_IRQ_BASE +10 ; +if (request_irq (i, no_action,0 ,"dma_timeout" ,NULL )) +pr_err ("Failed to request irq %d (dma_timeout)\n" , i);#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 ("Failed to register timer interrupt\n" ); }/*
arch/mips/loongson2ef/fuloong-2e/irq.c +8 -8
@@ -35,14 +35,10 @@ 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 ) { +int irq; +/* init all controller * 0-15 ------> i8259 interrupt * 16-23 ------> mips cpu interrupt
@@ -59,7 +55,11 @@ void __init mach_init_irq(void)bonito_irq_init ();/* bonito irq at IP2 */ -setup_irq (MIPS_CPU_IRQ_BASE +2 , &cascade_irqaction); + irq =MIPS_CPU_IRQ_BASE +2 ; +if (request_irq (irq, no_action,IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("Failed to request irq %d (cascade)\n" , irq);/* 8259 irq at IP5 */ -setup_irq (MIPS_CPU_IRQ_BASE +5 , &cascade_irqaction); + irq =MIPS_CPU_IRQ_BASE +5 ; +if (request_irq (irq, no_action,IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("Failed to request irq %d (cascade)\n" , irq); }
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 ("Failed to register north bridge cascade interrupt\n" );/* 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 ("Failed to register south bridge cascade interrupt\n" ); }
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 ("Failed to request irq %d (cascade)\n" ,INT0_IRQ ); +if (request_irq (INT1_IRQ , no_action,IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("Failed to request irq %d (cascade)\n" ,INT1_IRQ ); +if (request_irq (INT2_IRQ , no_action,IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("Failed to request irq %d (cascade)\n" ,INT2_IRQ ); +if (request_irq (INT3_IRQ , no_action,IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("Failed to request irq %d (cascade)\n" ,INT3_IRQ );#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 ("Failed to request irq %d (cascade)\n" ,INT4_IRQ );#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("Failed to register ls1x-pwmtimer interrupt\n"); }#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.
@@ -224,6 +218,7 @@ static void hpet_setup(void)void __init setup_hpet_timer (void ) { +unsigned long flags =IRQF_NOBALANCING |IRQF_TIMER ;unsigned int cpu =smp_processor_id ();struct clock_event_device *cd;
@@ -247,7 +242,8 @@ 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, flags,"hpet" ,NULL )) +pr_err ("Failed to request irq %d (hpet)\n" ,HPET_T0_IRQ );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 ("Failed to request irq %d (CoreHi)\n" , corehi_irq); }
arch/mips/netlogic/xlr/fmn.c +3 -8
@@ -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;
@@ -195,8 +189,9 @@ void nlm_setup_fmn_irq(void) {uint32_t flags; -/* setup irq only once */ -setup_irq (IRQ_FMN , &fmn_irqaction); +/* request irq only once */ +if (request_irq (IRQ_FMN , fmn_message_handler,IRQF_PERCPU ,"fmn" ,NULL )) +pr_err ("Failed to request irq %d (fmn)\n" ,IRQ_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 ("Failed to register MSP CIC cascade interrupt\n" ); +if (request_irq (MSP_INT_PER , no_action,IRQF_NO_THREAD , +"MSP PER cascade" ,NULL )) +pr_err ("Failed to register MSP PER cascade interrupt\n" );#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 ("Failed to register MSP CIC cascade interrupt\n" ); +if (request_irq (MSP_INT_PER , no_action,IRQF_NO_THREAD , +"MSP PER cascade" ,NULL )) +pr_err ("Failed to register MSP PER cascade interrupt\n" );#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 ("Failed to request irq %d (%s)\n" , irq, 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 +5 -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 )
@@ -77,10 +76,13 @@ void __init plat_time_init(void)unsigned int get_c0_compare_int (void ) { +unsigned log flags =IRQF_PERCPU |IRQF_TIMER |IRQF_SHARED ; +/* 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, flags, +"timer" ,NULL )) +pr_err ("Failed to register timer interrupt\n" ); tim_installed++; }
arch/mips/ralink/cevt-rt3352.c +7 -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;
@@ -104,12 +98,17 @@ static int systick_shutdown(struct clock_event_device *evt)static int systick_set_oneshot (struct clock_event_device *evt) { +const char *name = systick.dev.name;struct systick_device *sdev; +int irq = systick.dev.irq; 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 (irq, systick_interrupt, +IRQF_PERCPU |IRQF_TIMER , name, &systick.dev)) +pr_err ("Failed to request irq %d (%s)\n" , irq, name); + } sdev->irq_requested =1 ;iowrite32 (CFG_EXT_STK_EN |CFG_CNT_EN , systick.membase +SYSTICK_CONFIG );
@@ -125,7 +124,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 -8
@@ -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;
@@ -136,9 +131,8 @@ int __init ip22_eisa_init(void)init_i8259_irqs (); -/* 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 ("Failed to request irq %d (EISA)\n" ,SGI_EISA_IRQ ); 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 ("Failed to register CRIME memory error interrupt\n" ); +if (request_irq (CRIME_CPUERR_IRQ , crime_cpuerr_intr,0 , +"CRIME CPU error" ,NULL )) +pr_err ("Failed to register CRIME CPU error interrupt\n" );#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 ("Failed to register ISA interrupt\n" ); }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 ("Failed to register ISA interrupt\n" ); }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 ("Failed to register ISA interrupt\n" ); }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 ("Failed to register cascade interrupt\n" ); }
@@ -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 ("Failed to register onboard ISA interrupt\n" ); +if (request_irq (SNI_RM200_INT_START +1 , sni_isa_irq_handler, +IRQF_SHARED ,"ISA" ,NULL )) +pr_err ("Failed to register ISA interrupt\n" ); }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 ("Failed to register a20r-timer interrupt\n" ); }#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.25.1
kbuild test robot
build botThank you for the patch! Yet something to improve:
Hi afzal,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linux/master]
[also build test ERROR on arm-soc/for-next linus/master v5.6-rc4 next-20200304] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/afzal-mohammed/MIPS-Replace-setup_irq-by-request_irq/20200304-150513 base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git f5ae2ea6347a308cfe91f53b53682ce635497d0d config: mips-rm200_defconfig (attached as .config) compiler: mipsel-linux-gcc (GCC) 5.5.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=5.5.0 make.cross ARCH=mips
If you fix the issue, kindly add following tag
All errors (new ones prefixed by >>):
In file included from arch/mips/sni/reset.c:11:0:
>> arch/mips/include/asm/sni.h:242:8: error: unknown type name 'irqreturn_t'
extern irqreturn_t sni_isa_irq_handler(int dummy, void *p);
^
--
arch/mips/sni/time.c: In function 'sni_a20r_timer_setup':
>> arch/mips/sni/time.c:65:30: error: 'a20r_irqaction' undeclared (first use in this function)
struct irqaction *action = &a20r_irqaction;
^ arch/mips/sni/time.c:65:30: note: each undeclared identifier is reported only once for each function it appears in
vim +/irqreturn_t +242 arch/mips/include/asm/sni.h
239
240 /* common irq stuff */
241 extern void (*sni_hwint)(void);
> 242 extern irqreturn_t sni_isa_irq_handler(int dummy, void *p);
243
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
Thomas Bogendoerfer
maintainerQuoted 4 lines · afzal mohammed
Hi mips maintainers,
if okay w/ this change, please consider taking it thr' your tree, else please let me know.
sorry this doesn't even compile for the first platform I've tested:
In file included from /home/tbogendoerfer/wip/korg/linux/arch/mips/sni/reset.c:11:0:/home/tbogendoerfer/wip/korg/linux/arch/mips/include/asm/sni.h:242:8: error: unknown type name ‘irqreturn_t’
extern irqreturn_t sni_isa_irq_handler(int dummy, void *p);
~~~~~~~~~~~Thomas.
Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]
PATCH v4 1/1 MIPS: 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().
remove_irq() has been replaced by free_irq() as well.
There were build error's during previous version, couple of which was reported by kbuild test robot <[email protected]> of which one was reported by Thomas Bogendoerfer <[email protected]> as well. There were a few more issues including build errors, those also have been fixed.
[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]
v4:
* Fix build errors reported by Thomas & kbuild test robot as well as additional issues including build errors
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/mips/alchemy/common/time.c | 11 +--- arch/mips/ar7/irq.c | 16 ++--- arch/mips/ath25/ar2315.c | 9 +-- arch/mips/ath25/ar5312.c | 9 +-- arch/mips/bcm63xx/irq.c | 41 +++++-------- arch/mips/cobalt/irq.c | 18 +++--- arch/mips/dec/setup.c | 59 ++++++++----------- arch/mips/emma/markeins/irq.c | 21 ++++--- arch/mips/include/asm/sni.h | 4 +- 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 | 11 ++-- 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 | 16 ++--- 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 | 11 +--- arch/mips/pmcs-msp71xx/msp_irq.c | 28 ++++----- arch/mips/pmcs-msp71xx/msp_smp.c | 22 ++----- arch/mips/pmcs-msp71xx/msp_time.c | 8 ++- arch/mips/ralink/cevt-rt3352.c | 18 +++--- arch/mips/sgi-ip22/ip22-eisa.c | 10 +--- 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 | 12 +--- arch/mips/vr41xx/common/irq.c | 9 +-- 42 files changed, 240 insertions(+), 413 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 ("Failed to register timer interrupt\n" );printk (KERN_INFO "Alchemy clocksource installed\n" );
arch/mips/ar7/irq.c +8 -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,14 @@ 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 ("Failed to request irq 2 (AR7 cascade interrupt)\n" ); +if (request_irq (ar7_irq_base, no_action,IRQF_NO_THREAD , +"AR7 cascade interrupt" ,NULL )) { +pr_err ("Failed to request irq %d (AR7 cascade interrupt)\n" , + ar7_irq_base); + }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 ("Failed to register ar2315-ahb-error interrupt\n" );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 ("Failed to register ar5312-ahb-error interrupt\n" );irq_set_chained_handler_and_data (AR5312_IRQ_MISC , ar5312_misc_irq_handler, domain);
arch/mips/bcm63xx/irq.c +16 -25
63 lines not on this page · raw message
arch/mips/cobalt/irq.c +10 -8
@@ -45,18 +45,20 @@ 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 ("Failed to request irq %d (cascade)\n" , +GT641XX_CASCADE_IRQ ); + } +if (request_irq (I8259_CASCADE_IRQ , no_action,IRQF_NO_THREAD , +"cascade" ,NULL )) { +pr_err ("Failed to request irq %d (cascade)\n" , +I8259_CASCADE_IRQ ); + } }
arch/mips/dec/setup.c +24 -35
93 lines not on this page · raw message
arch/mips/emma/markeins/irq.c +10 -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 */
@@ -236,6 +228,7 @@ void emma2rh_irq_dispatch(void)void __init arch_init_irq (void ) {u32 reg; +int irq;/* by default, interrupts are disabled. */ emma2rh_out32 (EMMA2RH_BHIF_INT_EN_0 ,0 );
@@ -272,9 +265,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); + irq =EMMA2RH_IRQ_BASE +EMMA2RH_SW_CASCADE ; +if (request_irq (irq, no_action,IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("Failed to request irq %d (cascade)\n" , irq); + irq =EMMA2RH_IRQ_BASE +EMMA2RH_GPIO_CASCADE ; +if (request_irq (irq, no_action,IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("Failed to request irq %d (cascade)\n" , irq); + irq =MIPS_CPU_IRQ_BASE +2 ; +if (request_irq (irq, no_action,IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("Failed to request irq %d (cascade)\n" , irq); } asmlinkage void plat_irq_dispatch(void)
arch/mips/include/asm/sni.h +3 -1
@@ -11,6 +11,8 @@#ifndef __ASM_SNI_H#define __ASM_SNI_H +#include <linux/irqreturn.h> +extern unsigned int sni_brd_type;#define SNI_BRD_10 2
@@ -239,6 +241,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 ("Failed to register R4030 timer interrupt\n" );/* * Set clock to 100Hz.
arch/mips/kernel/cevt-bcm1480.c +3 -8
@@ -91,16 +91,15 @@ 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); +unsigned long flags =IRQF_PERCPU |IRQF_TIMER ;BUG_ON (cpu >3 );/* Only have 4 general purpose timers */
@@ -133,11 +132,7 @@ 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, flags, name, cd)) +pr_err ("Failed to request irq %d (%s)\n" , irq, name); }
arch/mips/kernel/cevt-ds1287.c +2 -7
@@ -100,14 +100,9 @@ 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) { +unsigned long flags =IRQF_PERCPU |IRQF_TIMER ;struct clock_event_device *cd; cd = &ds1287_clockevent;
@@ -122,5 +117,5 @@ int __init ds1287_clockevent_init(int irq)clockevents_register_device (&ds1287_clockevent); -return setup_irq (irq, &ds1287_irqaction); +return request_irq (irq, ds1287_interrupt, flags,"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
@@ -252,6 +252,7 @@ unsigned int __weak get_c0_compare_int(void)int r4k_clockevent_init (void ) { +unsigned long flags =IRQF_PERCPU |IRQF_TIMER |IRQF_SHARED ;unsigned int cpu =smp_processor_id ();struct clock_event_device *cd;unsigned int irq, min_delta;
@@ -291,7 +292,8 @@ int r4k_clockevent_init(void) cp0_timer_irq_installed =1 ; -setup_irq (irq, &c0_compare_irqaction); +if (request_irq (irq, c0_compare_interrupt, flags,"timer" ,NULL )) +pr_err ("Failed to request irq %d (timer)\n" , irq);return 0 ; }
arch/mips/kernel/cevt-sb1250.c +3 -8
@@ -90,16 +90,15 @@ 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); +unsigned long flags =IRQF_PERCPU |IRQF_TIMER ;/* Only have 4 general purpose timers, and we use last one as hpt */ BUG_ON (cpu >2 );
@@ -133,11 +132,7 @@ 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, flags, name, cd)) +pr_err ("Failed to request irq %d (%s)\n" , irq, 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 ("Failed to request irq %d (txx9tmr)\n" , irq);printk (KERN_INFO "TXx9: clockevent device at 0x%lx, irq %d\n" , baseaddr, irq); }
arch/mips/kernel/i8253.c +4 -7
@@ -18,16 +18,13 @@ 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 ) { +unsigned long flags =IRQF_NOBALANCING |IRQF_TIMER ; +clockevent_i8253_init (true); -setup_irq (0 , &irq0); +if (request_irq (0 , timer_interrupt, flags,"timer" ,NULL )) +pr_err ("Failed to request irq 0 (timer)\n" ); }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,14 +90,9 @@ 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 irq =LASAT_CASCADE_IRQ ;int i;if (IS_LASAT_200 ()) {
@@ -119,5 +114,6 @@ 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 (irq, no_action,IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("Failed to request irq %d (cascade)\n" , irq); }
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); + i =LOONGSON_IRQ_BASE +10 ; +if (request_irq (i, no_action,0 ,"dma_timeout" ,NULL )) +pr_err ("Failed to request irq %d (dma_timeout)\n" , i);#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 ("Failed to register timer interrupt\n" ); }/*
arch/mips/loongson2ef/fuloong-2e/irq.c +8 -8
@@ -35,14 +35,10 @@ 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 ) { +int irq; +/* init all controller * 0-15 ------> i8259 interrupt * 16-23 ------> mips cpu interrupt
@@ -59,7 +55,11 @@ void __init mach_init_irq(void)bonito_irq_init ();/* bonito irq at IP2 */ -setup_irq (MIPS_CPU_IRQ_BASE +2 , &cascade_irqaction); + irq =MIPS_CPU_IRQ_BASE +2 ; +if (request_irq (irq, no_action,IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("Failed to request irq %d (cascade)\n" , irq);/* 8259 irq at IP5 */ -setup_irq (MIPS_CPU_IRQ_BASE +5 , &cascade_irqaction); + irq =MIPS_CPU_IRQ_BASE +5 ; +if (request_irq (irq, no_action,IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("Failed to request irq %d (cascade)\n" , irq); }
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 ("Failed to register north bridge cascade interrupt\n" );/* 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 ("Failed to register south bridge cascade interrupt\n" ); }
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 ("Failed to request irq %d (cascade)\n" ,INT0_IRQ ); +if (request_irq (INT1_IRQ , no_action,IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("Failed to request irq %d (cascade)\n" ,INT1_IRQ ); +if (request_irq (INT2_IRQ , no_action,IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("Failed to request irq %d (cascade)\n" ,INT2_IRQ ); +if (request_irq (INT3_IRQ , no_action,IRQF_NO_THREAD ,"cascade" ,NULL )) +pr_err ("Failed to request irq %d (cascade)\n" ,INT3_IRQ );#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 ("Failed to request irq %d (cascade)\n" ,INT4_IRQ );#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("Failed to register ls1x-pwmtimer interrupt\n"); }#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.
@@ -224,6 +218,7 @@ static void hpet_setup(void)void __init setup_hpet_timer (void ) { +unsigned long flags =IRQF_NOBALANCING |IRQF_TIMER ;unsigned int cpu =smp_processor_id ();struct clock_event_device *cd;
@@ -247,7 +242,8 @@ 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, flags,"hpet" ,NULL )) +pr_err ("Failed to request irq %d (hpet)\n" ,HPET_T0_IRQ );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 ("Failed to request irq %d (CoreHi)\n" , corehi_irq); }
arch/mips/netlogic/xlr/fmn.c +3 -8
@@ -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;
@@ -195,8 +189,9 @@ void nlm_setup_fmn_irq(void) {uint32_t flags; -/* setup irq only once */ -setup_irq (IRQ_FMN , &fmn_irqaction); +/* request irq only once */ +if (request_irq (IRQ_FMN , fmn_message_handler,IRQF_PERCPU ,"fmn" ,NULL )) +pr_err ("Failed to request irq %d (fmn)\n" ,IRQ_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 ("Failed to register MSP CIC cascade interrupt\n" ); +if (request_irq (MSP_INT_PER , no_action,IRQF_NO_THREAD , +"MSP PER cascade" ,NULL )) +pr_err ("Failed to register MSP PER cascade interrupt\n" );#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 ("Failed to register MSP CIC cascade interrupt\n" ); +if (request_irq (MSP_INT_PER , no_action,IRQF_NO_THREAD , +"MSP PER cascade" ,NULL )) +pr_err ("Failed to register MSP PER cascade interrupt\n" );#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 ("Failed to request irq %d (%s)\n" , irq, 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 +5 -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 )
@@ -77,10 +76,13 @@ void __init plat_time_init(void)unsigned int get_c0_compare_int (void ) { +unsigned long flags =IRQF_PERCPU |IRQF_TIMER |IRQF_SHARED ; +/* 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, flags, +"timer" ,NULL )) +pr_err ("Failed to register timer interrupt\n" ); tim_installed++; }
arch/mips/ralink/cevt-rt3352.c +8 -10
@@ -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;
@@ -95,7 +89,7 @@ static int systick_shutdown(struct clock_event_device *evt) sdev = container_of(evt, struct systick_device, dev);if (sdev->irq_requested) -free_irq (systick.dev.irq, &systick_irqaction); +free_irq (systick.dev.irq, &systick.dev); sdev->irq_requested =0 ;iowrite32 (0 , systick.membase +SYSTICK_CONFIG );
@@ -104,12 +98,17 @@ static int systick_shutdown(struct clock_event_device *evt)static int systick_set_oneshot (struct clock_event_device *evt) { +const char *name = systick.dev.name;struct systick_device *sdev; +int irq = systick.dev.irq; 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 (irq, systick_interrupt, +IRQF_PERCPU |IRQF_TIMER , name, &systick.dev)) +pr_err ("Failed to request irq %d (%s)\n" , irq, name); + } sdev->irq_requested =1 ;iowrite32 (CFG_EXT_STK_EN |CFG_CNT_EN , systick.membase +SYSTICK_CONFIG );
@@ -125,7 +124,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 -8
@@ -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;
@@ -136,9 +131,8 @@ int __init ip22_eisa_init(void)init_i8259_irqs (); -/* 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 ("Failed to request irq %d (EISA)\n" ,SGI_EISA_IRQ ); 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 ("Failed to register CRIME memory error interrupt\n" ); +if (request_irq (CRIME_CPUERR_IRQ , crime_cpuerr_intr,0 , +"CRIME CPU error" ,NULL )) +pr_err ("Failed to register CRIME CPU error interrupt\n" );#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 ("Failed to register ISA interrupt\n" ); }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 ("Failed to register ISA interrupt\n" ); }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 ("Failed to register ISA interrupt\n" ); }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 ("Failed to register cascade interrupt\n" ); }
@@ -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 ("Failed to register onboard ISA interrupt\n" ); +if (request_irq (SNI_RM200_INT_START +1 , sni_isa_irq_handler, +IRQF_SHARED ,"ISA" ,NULL )) +pr_err ("Failed to register ISA interrupt\n" ); }void __init sni_rm200_init (void )
arch/mips/sni/time.c +3 -9
@@ -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.
@@ -68,13 +62,13 @@ static struct irqaction a20r_irqaction = {static void __init sni_a20r_timer_setup (void ) {struct clock_event_device *cd = &a20r_clockevent_device; -struct irqaction *action = &a20r_irqaction;unsigned int cpu =smp_processor_id (); 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" , cd)) +pr_err ("Failed to register a20r-timer interrupt\n" ); }#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.25.1
Quoted 10 lines · afzal mohammed
request_irq()is preferred oversetup_irq(). Invocations ofsetup_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()byrequest_irq().
remove_irq()has been replaced byfree_irq()as well.
Quoted 8 lines
There were build error's during previous version, couple of which was reported by kbuild test robot <[email protected]> of which one was reported by Thomas Bogendoerfer <[email protected]> as well. There were a few more issues including build errors, those also have been fixed.
[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
Signed-off-by afzal mohammed <[email protected]>
thank you, applied to mips-next.
Thomas.
Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]
Quoted 10 lines · afzal mohammed
request_irq()is preferred oversetup_irq(). Invocations ofsetup_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()byrequest_irq().
remove_irq()has been replaced byfree_irq()as well.
Quoted 8 lines
There were build error's during previous version, couple of which was reported by kbuild test robot <[email protected]> of which one was reported by Thomas Bogendoerfer <[email protected]> as well. There were a few more issues including build errors, those also have been fixed.
[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
Signed-off-by afzal mohammed <[email protected]>
This patch regresses booting malta_defconfig with both GCC and clang with this rootfs and QEMU 4.2.0:
$ timeout 2m qemu-system-mipsel -machine malta -cpu 24Kf -initrd rootfs.cpio -kernel vmlinux -m 512m -display none -serial mon:stdio
just hangs. I have not done further debugging past the initial bisect.
Cheers,
Nathan
Hi Nathan,
Quoted 8 lines · Nathan Chancellor
This patch regresses booting
malta_defconfigwith both GCC and clang with this rootfs and QEMU 4.2.0:$ timeout 2m qemu-system-mipsel -machine malta -cpu 24Kf -initrd rootfs.cpio -kernel vmlinux -m 512m -display none -serial mon:stdiojust hangs. I have not done further debugging past the initial bisect.
i will look into it.
Regards
afzal
Hi,
Quoted 2 lines · Nathan Chancellor
This patch regresses booting
malta_defconfigwith both GCC and clang with this rootfs and QEMU 4.2.0:
On a quick debug, Diff at the end seems to fix the issue. i realize that all the execution sequences that can alter the earlier statically defined struct irqaction fields needs to be taken care carefully,let me recheck the resolution here as well as other instances where this kind of issue can happen. i will sent a proper patch later.
Quoted 6 lines
$ timeout 2m qemu-system-mipsel -machine malta -cpu 24Kf -initrd rootfs.cpio -kernel vmlinux -m 512m -display none -serial mon:stdiojust hangs. I have not done further debugging past the initial bisect.
Thanks for the reproducer.
Regards
afzal
arch/mips/kernel/cevt-r4k.c +1 -1
@@ -252,7 +252,7 @@ unsigned int __weak get_c0_compare_int(void)int r4k_clockevent_init (void ) { -unsigned long flags =IRQF_PERCPU |IRQF_TIMER |IRQF_SHARED ; +unsigned long flags =IRQF_PERCPU |IRQF_TIMER ;unsigned int cpu =smp_processor_id ();struct clock_event_device *cd;unsigned int irq, min_delta;
Thomas Bogendoerfer
maintainerarch/mips/kernel/cevt-r4k.c unsigned int __weak get_c0_compare_int(void) · line 258
Quoted 13 lines · afzal mohammed
arch/mips/kernel/cevt-r4k.c +1
-1@@ -252,7 +252,7 @@ unsigned int __weak get_c0_compare_int(void)int r4k_clockevent_init (void ) { -unsigned long flags =IRQF_PERCPU |IRQF_TIMER |IRQF_SHARED ; +unsigned long flags =IRQF_PERCPU |IRQF_TIMER ;unsigned int cpu =smp_processor_id ();struct clock_event_device *cd;unsigned int irq, min_delta;
I don't see why this should help. In my tree only sgi-ip30 removes IRQF_SHARED from flags, but then it uses setup_percpu_irq(). What do I miss ?
Thomas.
Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]
Hi Thomas,
Quoted 4 lines · Thomas Bogendoerfer
Quoted 1 line · afzal mohammed
arch/mips/kernel/cevt-r4k.c +0
-0
Quoted 8 lines
arch/mips/kernel/cevt-r4k.c
Quoted 4 lines
int
r4k_clockevent_init(void)
{arch/mips/kernel/cevt-r4k.c +1
-1-unsigned long flags =IRQF_PERCPU |IRQF_TIMER |IRQF_SHARED ; +unsigned long flags =IRQF_PERCPU |IRQF_TIMER ;I don't see why this should help. In my tree only sgi-ip30 removes
IRQF_SHAREDfrom flags, but then it usessetup_percpu_irq(). What do I miss ?
You did not miss anything. Though it works, i took a wrong route following the tags & arrived at that solution in a hurry. (struct irqaction used in sgi-ip30 was used here earlier w/ setup_irq).
The problem is sanity checks in request_irq() [ rather in request_thread_iq() ]
if (((irqflags & IRQF_SHARED) && !dev_id) || (!(irqflags & IRQF_SHARED) && (irqflags & IRQF_COND_SUSPEND)) || ((irqflags & IRQF_NO_SUSPEND) && (irqflags & IRQF_COND_SUSPEND))) return -EINVAL;
If IRQF_SHARED is passed, it exepcts a non-NULL dev_id, here it is NULL, setup_irq() doesn't have any check like that.
So i think proper solution is to add a non NULL dev_id, as removing IRQF_SHARED might affect some platforms that might be using that interrupt line shared.
Patch with non-NULL dev_id below, it works w/ Nathan's test case.
Would you prefer an incremental patch or a fixed up v5 patch ?
i will test build the other cases as well & sent the patch later today, though it is trivial, just being paranoid, since bitten by build error earlier.
Also there was no meaningful pointer to pass as dev_id except in one case, so i have used name itself.
Regards
afzal
--->8---
arch/mips/dec/setup.c +1 -1
@@ -758,7 +758,7 @@ void __init arch_init_irq(void)/* Register the bus error interrupt. */ if (dec_interrupt[DEC_IRQ_BUS ] >=0 && busirq_handler) {if (request_irq (dec_interrupt[DEC_IRQ_BUS ], busirq_handler, - busirq_flags,"bus error" ,NULL )) + busirq_flags,"bus error" ,"bus error" ))pr_err ("Failed to register bus error interrupt\n" ); }/* Register the HALT interrupt. */
arch/mips/kernel/cevt-r4k.c +1 -1
@@ -292,7 +292,7 @@ int r4k_clockevent_init(void) cp0_timer_irq_installed =1 ; -if (request_irq (irq, c0_compare_interrupt, flags,"timer" ,NULL )) +if (request_irq (irq, c0_compare_interrupt, flags,"timer" , cd))pr_err ("Failed to request irq %d (timer)\n" , irq);return 0 ;
arch/mips/loongson2ef/lemote-2f/irq.c +1 -1
@@ -109,7 +109,7 @@ void __init mach_init_irq(void)/* setup north bridge irq (bonito) */ if (request_irq (LOONGSON_NORTH_BRIDGE_IRQ , ip6_action, -IRQF_SHARED |IRQF_NO_THREAD ,"cascade" ,NULL )) +IRQF_SHARED |IRQF_NO_THREAD ,"cascade" ,"cascade" ))pr_err ("Failed to register north bridge cascade interrupt\n" );/* setup source bridge irq (i8259) */ if (request_irq(LOONGSON_SOUTH_BRIDGE_IRQ, no_action,
arch/mips/pmcs-msp71xx/msp_time.c +1 -1
@@ -81,7 +81,7 @@ unsigned int get_c0_compare_int(void)/* MIPS_MT modes may want timer for second VPE */ if ((get_current_vpe ()) && !tim_installed) {if (request_irq (MSP_INT_VPE1_TIMER , c0_compare_interrupt, flags, -"timer" ,NULL )) +"timer" ,"timer" ))pr_err ("Failed to register timer interrupt\n" ); tim_installed++; }
arch/mips/sni/a20r.c +1 -1
@@ -223,7 +223,7 @@ void __init sni_a20r_irq_init(void) sni_hwint = a20r_hwint;change_c0_status (ST0_IM ,IE_IRQ0 );if (request_irq (SNI_A20R_IRQ_BASE +3 , sni_isa_irq_handler, -IRQF_SHARED ,"ISA" ,NULL )) +IRQF_SHARED ,"ISA" ,"ISA" ))pr_err ("Failed to register ISA interrupt\n" ); }
arch/mips/sni/pcit.c +2 -2
@@ -245,7 +245,7 @@ void __init sni_pcit_irq_init(void) sni_hwint = sni_pcit_hwint;change_c0_status (ST0_IM ,IE_IRQ1 );if (request_irq (SNI_PCIT_INT_START +6 , sni_isa_irq_handler, -IRQF_SHARED ,"ISA" ,NULL )) +IRQF_SHARED ,"ISA" ,"ISA" ))pr_err ("Failed to register ISA interrupt\n" ); }
@@ -260,7 +260,7 @@ void __init sni_pcit_cplus_irq_init(void) sni_hwint = sni_pcit_hwint_cplus;change_c0_status (ST0_IM ,IE_IRQ0 );if (request_irq (MIPS_CPU_IRQ_BASE +3 , sni_isa_irq_handler, -IRQF_SHARED ,"ISA" ,NULL )) +IRQF_SHARED ,"ISA" ,"ISA" ))pr_err ("Failed to register ISA interrupt\n" ); }
arch/mips/sni/rm200.c +2 -2
@@ -473,10 +473,10 @@ void __init sni_rm200_irq_init(void) sni_hwint = sni_rm200_hwint;change_c0_status (ST0_IM ,IE_IRQ0 );if (request_irq (SNI_RM200_INT_START +0 , sni_rm200_i8259A_irq_handler, -IRQF_SHARED ,"onboard ISA" ,NULL )) +IRQF_SHARED ,"onboard ISA" ,"onboard ISA" ))pr_err ("Failed to register onboard ISA interrupt\n" );if (request_irq (SNI_RM200_INT_START +1 , sni_isa_irq_handler, -IRQF_SHARED ,"ISA" ,NULL )) +IRQF_SHARED ,"ISA" ,"ISA" ))pr_err ("Failed to register ISA interrupt\n" ); }
Thomas Bogendoerfer
maintainerQuoted 24 lines · afzal mohammed
Hi Thomas,
Quoted 4 lines · Thomas Bogendoerfer
Quoted 1 line · afzal mohammed
arch/mips/kernel/cevt-r4k.c +0
-0Quoted 8 lines
arch/mips/kernel/cevt-r4k.c
Quoted 4 lines
int
r4k_clockevent_init(void)
{arch/mips/kernel/cevt-r4k.c +1
-1-unsigned long flags =IRQF_PERCPU |IRQF_TIMER |IRQF_SHARED ; +unsigned long flags =IRQF_PERCPU |IRQF_TIMER ;I don't see why this should help. In my tree only sgi-ip30 removes
IRQF_SHAREDfrom flags, but then it usessetup_percpu_irq(). What do I miss ?You did not miss anything. Though it works, i took a wrong route following the tags & arrived at that solution in a hurry. (struct irqaction used in sgi-ip30 was used here earlier w/
setup_irq).The problem is sanity checks in
request_irq()[ rather inrequest_thread_iq()]
Quoted 7 lines
if (((irqflags & IRQF_SHARED) && !dev_id) || (!(irqflags & IRQF_SHARED) && (irqflags & IRQF_COND_SUSPEND)) || ((irqflags & IRQF_NO_SUSPEND) && (irqflags & IRQF_COND_SUSPEND))) return -EINVAL;If
IRQF_SHAREDis passed, it exepcts a non-NULLdev_id, here it is NULL,setup_irq()doesn't have any check like that.
so request_irq() is not a 1:1 replacement for our current setup_irq(). Or put it the another way our setup_irq() might be buggy, when used for shared interrupts.
Quoted 5 lines
So i think proper solution is to add a non NULL
dev_id, as removingIRQF_SHAREDmight affect some platforms that might be using that interrupt line shared.Patch with non-NULL
dev_idbelow, it works w/ Nathan's test case.
I'm not sure, I like the adding of string pointers as dev_id arguments in your patch. How can we make sure they are unique enough for the use case ? I guess using handler as dev_id does a better job here.
And before doing that, lets clean up some of the IRQF_SHARED usage first. All sni IRQF_SHARED can go away, the interrupt lines are exclusive there.
loongson2ef/lemote-2f/irq.c: looks like the only user of LOONGSON_NORTH_BRIDGE_IRQ, so IRQF_SHARED could go as well. Could someone confirm that ?
All other need to stay, IMHO.
And v4 is already in mips-next, so I need an incremental patch please.
Thomas.
Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]
Hi,
Quoted 8 lines · Thomas Bogendoerfer
Quoted 2 lines · afzal mohammed
If
IRQF_SHAREDis passed, it exepcts a non-NULLdev_id, here it is NULL,setup_irq()doesn't have any check like that.so
request_irq()is not a 1:1 replacement for our currentsetup_irq(). Or put it the another way oursetup_irq()might be buggy, when used for shared interrupts.
AFAIU, this causes problems only while freeing irq, but not sure. Seems it is not happening with any of the cases in the diff.
Quoted 9 lines
Quoted 5 lines
So i think proper solution is to add a non NULL
dev_id, as removingIRQF_SHAREDmight affect some platforms that might be using that interrupt line shared.Patch with non-NULL
dev_idbelow, it works w/ Nathan's test case.I'm not sure, I like the adding of string pointers as
dev_idarguments in your patch. How can we make sure they are unique enough for the use case ? I guess using handler asdev_iddoes a better job here.
There was one prior similar usage using string pointers, another way i have seen is using irq no. itself, but then it has to be typecasted, in file arch/mips/txx9/generic/pci.c,
request_irq(irq, &i8259_interrupt, IRQF_SHARED,
"cascade(i8259)", (void *)(long)irq);[ but i think that double casting is not required, only (void *) might suffice ]
If you prefer handler function pointer, i will use that.
Quoted 8 lines
And before doing that, lets clean up some of the
IRQF_SHAREDusage first. All sniIRQF_SHAREDcan go away, the interrupt lines are exclusive there.
loongson2ef/lemote-2f/irq.c: looks like the only user ofLOONGSON_NORTH_BRIDGE_IRQ, soIRQF_SHAREDcould go as well. Could someone confirm that ?All other need to stay, IMHO.
Okay, i am venturing into MIPS the first time as part of this patch series, so no MIPS specific knowledge, just let me know loongson2ef/lemote-2f case as well, i will prepare patch accordingly.
Quoted 1 line
And v4 is already in mips-next, so I need an incremental patch please.
Okay, i already sent a patch, it crossed your mail, i will make a new patch based on the outcome of the discusson here.
Since there is some issue w/ lore.kernel.org, i send it again, but both are not seen in archives.
Regards
afzal
Hi Thomas,
Quoted 4 lines · afzal mohammed
Quoted 1 line · Thomas Bogendoerfer
case ? I guess using handler as
dev_iddoes a better job here.
Quoted 8 lines
Quoted 8 lines
And before doing that, lets clean up some of the
IRQF_SHAREDusage first. All sniIRQF_SHAREDcan go away, the interrupt lines are exclusive there.
loongson2ef/lemote-2f/irq.c: looks like the only user ofLOONGSON_NORTH_BRIDGE_IRQ, soIRQF_SHAREDcould go as well. Could someone confirm that ?All other need to stay, IMHO.
i am thinking of sending a new patch, with,
1) IRQF_SHARED removed from sni/{a20r.c,pcit.c,rm200.c}
2) IRQF_SHARED kept in,
kernel/cevt-r4k.c
dec/setup.c
pmcs-msp71xx/msp-time.c loongson2ef/lemote-2f/irq.c
and use handler as dev_id in those
Let me know if you have any other thoughts.
Regards
afzal
PATCH v2 1/1 MIPS: pass non-NULL dev_id on shared request_irq()
Recently all usages of setup_irq() was replaced by request_irq(). request_irq() does a few sanity checks that were not done in setup_irq(), if they fail irq registration will fail. One of the check is to ensure that non-NULL dev_id is passed in the case of shared irq. This caused malta on qemu to hang.
Fix it by passing handler as dev_id to all request_irq()'s that are shared. For sni, instead of passing non-NULL dev_id, remove shared irq flags.
---
v2:
* use handler for dev_id
* remove shared irq flags for sni
arch/mips/dec/setup.c | 2 +- arch/mips/kernel/cevt-r4k.c | 3 ++- arch/mips/loongson2ef/lemote-2f/irq.c | 2 +- arch/mips/pmcs-msp71xx/msp_time.c | 2 +- arch/mips/sni/a20r.c | 4 ++-- arch/mips/sni/pcit.c | 8 ++++---- arch/mips/sni/rm200.c | 6 +++--- 7 files changed, 14 insertions(+), 13 deletions(-)
arch/mips/dec/setup.c +1 -1
@@ -758,7 +758,7 @@ void __init arch_init_irq(void)/* Register the bus error interrupt. */ if (dec_interrupt[DEC_IRQ_BUS ] >=0 && busirq_handler) {if (request_irq (dec_interrupt[DEC_IRQ_BUS ], busirq_handler, - busirq_flags,"bus error" ,NULL )) + busirq_flags,"bus error" , busirq_handler))pr_err ("Failed to register bus error interrupt\n" ); }/* Register the HALT interrupt. */
arch/mips/kernel/cevt-r4k.c +2 -1
@@ -292,7 +292,8 @@ int r4k_clockevent_init(void) cp0_timer_irq_installed =1 ; -if (request_irq (irq, c0_compare_interrupt, flags,"timer" ,NULL )) +if (request_irq (irq, c0_compare_interrupt, flags,"timer" , + c0_compare_interrupt))pr_err ("Failed to request irq %d (timer)\n" , irq);return 0 ;
arch/mips/loongson2ef/lemote-2f/irq.c +1 -1
@@ -109,7 +109,7 @@ void __init mach_init_irq(void)/* setup north bridge irq (bonito) */ if (request_irq (LOONGSON_NORTH_BRIDGE_IRQ , ip6_action, -IRQF_SHARED |IRQF_NO_THREAD ,"cascade" ,NULL )) +IRQF_SHARED |IRQF_NO_THREAD ,"cascade" , ip6_action))pr_err ("Failed to register north bridge cascade interrupt\n" );/* setup source bridge irq (i8259) */ if (request_irq(LOONGSON_SOUTH_BRIDGE_IRQ, no_action,
arch/mips/pmcs-msp71xx/msp_time.c +1 -1
@@ -81,7 +81,7 @@ unsigned int get_c0_compare_int(void)/* MIPS_MT modes may want timer for second VPE */ if ((get_current_vpe ()) && !tim_installed) {if (request_irq (MSP_INT_VPE1_TIMER , c0_compare_interrupt, flags, -"timer" ,NULL )) +"timer" , c0_compare_interrupt))pr_err ("Failed to register timer interrupt\n" ); tim_installed++; }
arch/mips/sni/a20r.c +2 -2
@@ -222,8 +222,8 @@ 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 ); -if (request_irq (SNI_A20R_IRQ_BASE +3 , sni_isa_irq_handler, -IRQF_SHARED ,"ISA" ,NULL )) +if (request_irq (SNI_A20R_IRQ_BASE +3 , sni_isa_irq_handler,0 ,"ISA" , +NULL ))pr_err ("Failed to register ISA interrupt\n" ); }
arch/mips/sni/pcit.c +4 -4
@@ -244,8 +244,8 @@ 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 ); -if (request_irq (SNI_PCIT_INT_START +6 , sni_isa_irq_handler, -IRQF_SHARED ,"ISA" ,NULL )) +if (request_irq (SNI_PCIT_INT_START +6 , sni_isa_irq_handler,0 ,"ISA" , +NULL ))pr_err ("Failed to register ISA interrupt\n" ); }
@@ -259,8 +259,8 @@ 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 ); -if (request_irq (MIPS_CPU_IRQ_BASE +3 , sni_isa_irq_handler, -IRQF_SHARED ,"ISA" ,NULL )) +if (request_irq (MIPS_CPU_IRQ_BASE +3 , sni_isa_irq_handler,0 ,"ISA" , +NULL ))pr_err ("Failed to register ISA interrupt\n" ); }
arch/mips/sni/rm200.c +3 -3
@@ -473,10 +473,10 @@ void __init sni_rm200_irq_init(void) sni_hwint = sni_rm200_hwint;change_c0_status (ST0_IM ,IE_IRQ0 );if (request_irq (SNI_RM200_INT_START +0 , sni_rm200_i8259A_irq_handler, -IRQF_SHARED ,"onboard ISA" ,NULL )) +0 ,"onboard ISA" ,NULL ))pr_err ("Failed to register onboard ISA interrupt\n" ); -if (request_irq (SNI_RM200_INT_START +1 , sni_isa_irq_handler, -IRQF_SHARED ,"ISA" ,NULL )) +if (request_irq (SNI_RM200_INT_START +1 , sni_isa_irq_handler,0 ,"ISA" , +NULL ))pr_err ("Failed to register ISA interrupt\n" ); }
Signature · 7 lines
2.18.0 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH v2] MIPS: pass non-NULL dev_id on shared request_irq()
Quoted 6 lines · afzal mohammed
Recently all usages of
setup_irq()was replaced byrequest_irq().request_irq()does a few sanity checks that were not done insetup_irq(), if they fail irq registration will fail. One of the check is to ensure that non-NULLdev_idis passed in the case of shared irq. This caused malta on qemu to hang.
Quoted 8 lines
Fix it by passing handler as
dev_idto all request_irq()'s that are shared. For sni, instead of passing non-NULLdev_id, remove shared irq flags.Fixes ac8fd122e070 ("MIPS: Replace setup_irq() by request_irq()")Reported-by Nathan Chancellor <[email protected]>Suggested-by Thomas Bogendoerfer <[email protected]>Signed-off-by afzal mohammed <[email protected]>
Quoted 135 lines
---
v2:
* use handler fordev_id
* remove shared irq flags for sniarch/mips/dec/setup.c | 2 +- arch/mips/kernel/cevt-r4k.c | 3 ++- arch/mips/loongson2ef/lemote-2f/irq.c | 2 +- arch/mips/pmcs-msp71xx/msp_time.c | 2 +- arch/mips/sni/a20r.c | 4 ++-- arch/mips/sni/pcit.c | 8 ++++---- arch/mips/sni/rm200.c | 6 +++--- 7 files changed, 14 insertions(+), 13 deletions(-)arch/mips/dec/setup.c +1
-1@@ -758,7 +758,7 @@ void __init arch_init_irq(void)/* Register the bus error interrupt. */ if (dec_interrupt[DEC_IRQ_BUS ] >=0 && busirq_handler) {if (request_irq (dec_interrupt[DEC_IRQ_BUS ], busirq_handler, - busirq_flags,"bus error" ,NULL )) + busirq_flags,"bus error" , busirq_handler))pr_err ("Failed to register bus error interrupt\n" ); }/* Register the HALT interrupt. */ arch/mips/kernel/cevt-r4k.c +2
-1@@ -292,7 +292,8 @@ int r4k_clockevent_init(void) cp0_timer_irq_installed =1 ; -if (request_irq (irq, c0_compare_interrupt, flags,"timer" ,NULL )) +if (request_irq (irq, c0_compare_interrupt, flags,"timer" , + c0_compare_interrupt))pr_err ("Failed to request irq %d (timer)\n" , irq);return 0 ;arch/mips/loongson2ef/lemote-2f/irq.c +1
-1@@ -109,7 +109,7 @@ void __init mach_init_irq(void)/* setup north bridge irq (bonito) */ if (request_irq (LOONGSON_NORTH_BRIDGE_IRQ , ip6_action, -IRQF_SHARED |IRQF_NO_THREAD ,"cascade" ,NULL )) +IRQF_SHARED |IRQF_NO_THREAD ,"cascade" , ip6_action))pr_err ("Failed to register north bridge cascade interrupt\n" );/* setup source bridge irq (i8259) */ if (request_irq(LOONGSON_SOUTH_BRIDGE_IRQ, no_action,arch/mips/pmcs-msp71xx/msp_time.c +1
-1@@ -81,7 +81,7 @@ unsigned int get_c0_compare_int(void)/* MIPS_MT modes may want timer for second VPE */ if ((get_current_vpe ()) && !tim_installed) {if (request_irq (MSP_INT_VPE1_TIMER , c0_compare_interrupt, flags, -"timer" ,NULL )) +"timer" , c0_compare_interrupt))pr_err ("Failed to register timer interrupt\n" ); tim_installed++; }arch/mips/sni/a20r.c +2
-2@@ -222,8 +222,8 @@ 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 ); -if (request_irq (SNI_A20R_IRQ_BASE +3 , sni_isa_irq_handler, -IRQF_SHARED ,"ISA" ,NULL )) +if (request_irq (SNI_A20R_IRQ_BASE +3 , sni_isa_irq_handler,0 ,"ISA" , +NULL ))pr_err ("Failed to register ISA interrupt\n" ); }arch/mips/sni/pcit.c +4
-4@@ -244,8 +244,8 @@ 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 ); -if (request_irq (SNI_PCIT_INT_START +6 , sni_isa_irq_handler, -IRQF_SHARED ,"ISA" ,NULL )) +if (request_irq (SNI_PCIT_INT_START +6 , sni_isa_irq_handler,0 ,"ISA" , +NULL ))pr_err ("Failed to register ISA interrupt\n" ); }@@ -259,8 +259,8 @@ 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 ); -if (request_irq (MIPS_CPU_IRQ_BASE +3 , sni_isa_irq_handler, -IRQF_SHARED ,"ISA" ,NULL )) +if (request_irq (MIPS_CPU_IRQ_BASE +3 , sni_isa_irq_handler,0 ,"ISA" , +NULL ))pr_err ("Failed to register ISA interrupt\n" ); }arch/mips/sni/rm200.c +3
-3@@ -473,10 +473,10 @@ void __init sni_rm200_irq_init(void) sni_hwint = sni_rm200_hwint;change_c0_status (ST0_IM ,IE_IRQ0 );if (request_irq (SNI_RM200_INT_START +0 , sni_rm200_i8259A_irq_handler, -IRQF_SHARED ,"onboard ISA" ,NULL )) +0 ,"onboard ISA" ,NULL ))pr_err ("Failed to register onboard ISA interrupt\n" ); -if (request_irq (SNI_RM200_INT_START +1 , sni_isa_irq_handler, -IRQF_SHARED ,"ISA" ,NULL )) +if (request_irq (SNI_RM200_INT_START +1 , sni_isa_irq_handler,0 ,"ISA" , +NULL ))pr_err ("Failed to register ISA interrupt\n" ); }Signature · 7 lines
2.18.0 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH v2] MIPS: pass non-NULL dev_id on shared request_irq()
In reply to afzal mohammedQuoted 6 lines · afzal mohammed
Recently all usages of
setup_irq()was replaced byrequest_irq().request_irq()does a few sanity checks that were not done insetup_irq(), if they fail irq registration will fail. One of the check is to ensure that non-NULLdev_idis passed in the case of shared irq. This caused malta on qemu to hang.
Quoted 8 lines
Fix it by passing handler as
dev_idto all request_irq()'s that are shared. For sni, instead of passing non-NULLdev_id, remove shared irq flags.Fixes ac8fd122e070 ("MIPS: Replace setup_irq() by request_irq()")Reported-by Nathan Chancellor <[email protected]>Suggested-by Thomas Bogendoerfer <[email protected]>Signed-off-by afzal mohammed <[email protected]>
Re: [PATCH v2] MIPS: pass non-NULL dev_id on shared request_irq()
In reply to afzal mohammedQuoted 6 lines · afzal mohammed
Recently all usages of
setup_irq()was replaced byrequest_irq().request_irq()does a few sanity checks that were not done insetup_irq(), if they fail irq registration will fail. One of the check is to ensure that non-NULLdev_idis passed in the case of shared irq. This caused malta on qemu to hang.
Quoted 8 lines
Fix it by passing handler as
dev_idto all request_irq()'s that are shared. For sni, instead of passing non-NULLdev_id, remove shared irq flags.Fixes ac8fd122e070 ("MIPS: Replace setup_irq() by request_irq()")Reported-by Nathan Chancellor <[email protected]>Suggested-by Thomas Bogendoerfer <[email protected]>Signed-off-by afzal mohammed <[email protected]>
thank you, applied to mips-next.
Thomas.
Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]
Hi,
Quoted 7 lines · afzal mohammed
Quoted 2 lines · Thomas Bogendoerfer
in your patch. How can we make sure they are unique enough for the use case ? I guess using handler as
dev_iddoes a better job here.There was one prior similar usage using string pointers, another way i have seen is using irq no. itself,
Huh, that was a total nonsense statement from me, considering the expectation of a unique dev_id, i don't know what i was thinking at that time, though you mentioned about uniqueness.
Regards
afzal
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 1/1 MIPS: pass non-NULL dev_id on shared request_irq()
In reply to Thomas BogendoerferRecently all usages of setup_irq() was replaced by request_irq(). request_irq() does a few sanity checks that were not done in setup_irq(), if they fail irq registration will fail. One of the check is to ensure that non-NULL dev_id is passed in the case of shared irq. This caused malta on qemu to hang.
Fix it by passing a dev_id to all request_irq()'s that are shared.
---
Hi Thomas,
i am assuming your next tree is immutable, hence referring to the SHA-ID of the original commit in your tree. Else if you prefer a fixup'ed patch, let me know, i will send v5 with this fixup over v4.
REgards
afzal
arch/mips/dec/setup.c | 2 +- arch/mips/kernel/cevt-r4k.c | 2 +- arch/mips/loongson2ef/lemote-2f/irq.c | 2 +- arch/mips/pmcs-msp71xx/msp_time.c | 2 +- arch/mips/sni/a20r.c | 2 +- arch/mips/sni/pcit.c | 4 ++-- arch/mips/sni/rm200.c | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-)
arch/mips/dec/setup.c +1 -1
@@ -758,7 +758,7 @@ void __init arch_init_irq(void)/* Register the bus error interrupt. */ if (dec_interrupt[DEC_IRQ_BUS ] >=0 && busirq_handler) {if (request_irq (dec_interrupt[DEC_IRQ_BUS ], busirq_handler, - busirq_flags,"bus error" ,NULL )) + busirq_flags,"bus error" ,"bus error" ))pr_err ("Failed to register bus error interrupt\n" ); }/* Register the HALT interrupt. */
arch/mips/kernel/cevt-r4k.c +1 -1
@@ -292,7 +292,7 @@ int r4k_clockevent_init(void) cp0_timer_irq_installed =1 ; -if (request_irq (irq, c0_compare_interrupt, flags,"timer" ,NULL )) +if (request_irq (irq, c0_compare_interrupt, flags,"timer" , cd))pr_err ("Failed to request irq %d (timer)\n" , irq);return 0 ;
arch/mips/loongson2ef/lemote-2f/irq.c +1 -1
@@ -109,7 +109,7 @@ void __init mach_init_irq(void)/* setup north bridge irq (bonito) */ if (request_irq (LOONGSON_NORTH_BRIDGE_IRQ , ip6_action, -IRQF_SHARED |IRQF_NO_THREAD ,"cascade" ,NULL )) +IRQF_SHARED |IRQF_NO_THREAD ,"cascade" ,"cascade" ))pr_err ("Failed to register north bridge cascade interrupt\n" );/* setup source bridge irq (i8259) */ if (request_irq(LOONGSON_SOUTH_BRIDGE_IRQ, no_action,
arch/mips/pmcs-msp71xx/msp_time.c +1 -1
@@ -81,7 +81,7 @@ unsigned int get_c0_compare_int(void)/* MIPS_MT modes may want timer for second VPE */ if ((get_current_vpe ()) && !tim_installed) {if (request_irq (MSP_INT_VPE1_TIMER , c0_compare_interrupt, flags, -"timer" ,NULL )) +"timer" ,"timer" ))pr_err ("Failed to register timer interrupt\n" ); tim_installed++; }
arch/mips/sni/a20r.c +1 -1
@@ -223,7 +223,7 @@ void __init sni_a20r_irq_init(void) sni_hwint = a20r_hwint;change_c0_status (ST0_IM ,IE_IRQ0 );if (request_irq (SNI_A20R_IRQ_BASE +3 , sni_isa_irq_handler, -IRQF_SHARED ,"ISA" ,NULL )) +IRQF_SHARED ,"ISA" ,"ISA" ))pr_err ("Failed to register ISA interrupt\n" ); }
arch/mips/sni/pcit.c +2 -2
@@ -245,7 +245,7 @@ void __init sni_pcit_irq_init(void) sni_hwint = sni_pcit_hwint;change_c0_status (ST0_IM ,IE_IRQ1 );if (request_irq (SNI_PCIT_INT_START +6 , sni_isa_irq_handler, -IRQF_SHARED ,"ISA" ,NULL )) +IRQF_SHARED ,"ISA" ,"ISA" ))pr_err ("Failed to register ISA interrupt\n" ); }
@@ -260,7 +260,7 @@ void __init sni_pcit_cplus_irq_init(void) sni_hwint = sni_pcit_hwint_cplus;change_c0_status (ST0_IM ,IE_IRQ0 );if (request_irq (MIPS_CPU_IRQ_BASE +3 , sni_isa_irq_handler, -IRQF_SHARED ,"ISA" ,NULL )) +IRQF_SHARED ,"ISA" ,"ISA" ))pr_err ("Failed to register ISA interrupt\n" ); }
arch/mips/sni/rm200.c +2 -2
@@ -473,10 +473,10 @@ void __init sni_rm200_irq_init(void) sni_hwint = sni_rm200_hwint;change_c0_status (ST0_IM ,IE_IRQ0 );if (request_irq (SNI_RM200_INT_START +0 , sni_rm200_i8259A_irq_handler, -IRQF_SHARED ,"onboard ISA" ,NULL )) +IRQF_SHARED ,"onboard ISA" ,"onboard ISA" ))pr_err ("Failed to register onboard ISA interrupt\n" );if (request_irq (SNI_RM200_INT_START +1 , sni_isa_irq_handler, -IRQF_SHARED ,"ISA" ,NULL )) +IRQF_SHARED ,"ISA" ,"ISA" ))pr_err ("Failed to register ISA interrupt\n" ); }
Signature · 1 line
2.18.0
PATCH 1/1 MIPS: pass non-NULL dev_id on shared request_irq()
In reply to Thomas BogendoerferRecently all usages of setup_irq() was replaced by request_irq(). request_irq() does a few sanity checks that were not done in setup_irq(), if they fail irq registration will fail. One of the check is to ensure that non-NULL dev_id is passed in the case of shared irq. This caused malta on qemu to hang.
Fix it by passing a dev_id to all request_irq()'s that are shared.
---
[ resending since in the archives not seen, apologies if duplicate ]
Hi Thomas,
i am assuming your next tree is immutable, hence referring to the SHA-ID of the original commit in your tree. Else if you prefer a fixup'ed patch, let me know, i will send v5 with this fixup over v4.
REgards
afzal
arch/mips/dec/setup.c | 2 +- arch/mips/kernel/cevt-r4k.c | 2 +- arch/mips/loongson2ef/lemote-2f/irq.c | 2 +- arch/mips/pmcs-msp71xx/msp_time.c | 2 +- arch/mips/sni/a20r.c | 2 +- arch/mips/sni/pcit.c | 4 ++-- arch/mips/sni/rm200.c | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-)
arch/mips/dec/setup.c +1 -1
@@ -758,7 +758,7 @@ void __init arch_init_irq(void)/* Register the bus error interrupt. */ if (dec_interrupt[DEC_IRQ_BUS ] >=0 && busirq_handler) {if (request_irq (dec_interrupt[DEC_IRQ_BUS ], busirq_handler, - busirq_flags,"bus error" ,NULL )) + busirq_flags,"bus error" ,"bus error" ))pr_err ("Failed to register bus error interrupt\n" ); }/* Register the HALT interrupt. */
arch/mips/kernel/cevt-r4k.c +1 -1
@@ -292,7 +292,7 @@ int r4k_clockevent_init(void) cp0_timer_irq_installed =1 ; -if (request_irq (irq, c0_compare_interrupt, flags,"timer" ,NULL )) +if (request_irq (irq, c0_compare_interrupt, flags,"timer" , cd))pr_err ("Failed to request irq %d (timer)\n" , irq);return 0 ;
arch/mips/loongson2ef/lemote-2f/irq.c +1 -1
@@ -109,7 +109,7 @@ void __init mach_init_irq(void)/* setup north bridge irq (bonito) */ if (request_irq (LOONGSON_NORTH_BRIDGE_IRQ , ip6_action, -IRQF_SHARED |IRQF_NO_THREAD ,"cascade" ,NULL )) +IRQF_SHARED |IRQF_NO_THREAD ,"cascade" ,"cascade" ))pr_err ("Failed to register north bridge cascade interrupt\n" );/* setup source bridge irq (i8259) */ if (request_irq(LOONGSON_SOUTH_BRIDGE_IRQ, no_action,
arch/mips/pmcs-msp71xx/msp_time.c +1 -1
@@ -81,7 +81,7 @@ unsigned int get_c0_compare_int(void)/* MIPS_MT modes may want timer for second VPE */ if ((get_current_vpe ()) && !tim_installed) {if (request_irq (MSP_INT_VPE1_TIMER , c0_compare_interrupt, flags, -"timer" ,NULL )) +"timer" ,"timer" ))pr_err ("Failed to register timer interrupt\n" ); tim_installed++; }
arch/mips/sni/a20r.c +1 -1
@@ -223,7 +223,7 @@ void __init sni_a20r_irq_init(void) sni_hwint = a20r_hwint;change_c0_status (ST0_IM ,IE_IRQ0 );if (request_irq (SNI_A20R_IRQ_BASE +3 , sni_isa_irq_handler, -IRQF_SHARED ,"ISA" ,NULL )) +IRQF_SHARED ,"ISA" ,"ISA" ))pr_err ("Failed to register ISA interrupt\n" ); }
arch/mips/sni/pcit.c +2 -2
@@ -245,7 +245,7 @@ void __init sni_pcit_irq_init(void) sni_hwint = sni_pcit_hwint;change_c0_status (ST0_IM ,IE_IRQ1 );if (request_irq (SNI_PCIT_INT_START +6 , sni_isa_irq_handler, -IRQF_SHARED ,"ISA" ,NULL )) +IRQF_SHARED ,"ISA" ,"ISA" ))pr_err ("Failed to register ISA interrupt\n" ); }
@@ -260,7 +260,7 @@ void __init sni_pcit_cplus_irq_init(void) sni_hwint = sni_pcit_hwint_cplus;change_c0_status (ST0_IM ,IE_IRQ0 );if (request_irq (MIPS_CPU_IRQ_BASE +3 , sni_isa_irq_handler, -IRQF_SHARED ,"ISA" ,NULL )) +IRQF_SHARED ,"ISA" ,"ISA" ))pr_err ("Failed to register ISA interrupt\n" ); }
arch/mips/sni/rm200.c +2 -2
@@ -473,10 +473,10 @@ void __init sni_rm200_irq_init(void) sni_hwint = sni_rm200_hwint;change_c0_status (ST0_IM ,IE_IRQ0 );if (request_irq (SNI_RM200_INT_START +0 , sni_rm200_i8259A_irq_handler, -IRQF_SHARED ,"onboard ISA" ,NULL )) +IRQF_SHARED ,"onboard ISA" ,"onboard ISA" ))pr_err ("Failed to register onboard ISA interrupt\n" );if (request_irq (SNI_RM200_INT_START +1 , sni_isa_irq_handler, -IRQF_SHARED ,"ISA" ,NULL )) +IRQF_SHARED ,"ISA" ,"ISA" ))pr_err ("Failed to register ISA interrupt\n" ); }
Signature · 1 line
2.18.0
Quoted 10 lines · afzal mohammed
request_irq()is preferred oversetup_irq(). Invocations ofsetup_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()byrequest_irq().
remove_irq()has been replaced byfree_irq()as well.
Quoted 8 lines
There were build error's during previous version, couple of which was reported by kbuild test robot <[email protected]> of which one was reported by Thomas Bogendoerfer <[email protected]> as well. There were a few more issues including build errors, those also have been fixed.
[1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos
Signed-off-by afzal mohammed <[email protected]>
This patch causes all my mips qemu emulations to hang during boot. This affects all mips, mips64, mipsel, and mipsel64 emulations.
Reverting this patch fixes the problem.
Example log:
...
Failed to request irq 23 (timer)
clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112584971 nssched_clock: 32 bits at 100MHz, resolution 9ns, wraps every 21474814971ns
Console: colour dummy device 80x25
printk: console [tty0] enabled
printk: bootconsole [uart8250] disabled
[ silence ]
Bisect log attached.
Guenter
---
# bad: [2e602db729948ce577bf07e2b113f2aa806b62c7] Add linux-next specific files for 20200313 # good: [2c523b344dfa65a3738e7039832044aa133c75fb] Linux 5.6-rc5
git bisect start 'HEAD' 'v5.6-rc5'
# bad: [acfda12b3a9b7b8d8cb4ff5f6ff0e48f688e254c] Merge remote-tracking branch 'spi-nor/spi-nor/next' git bisect bad acfda12b3a9b7b8d8cb4ff5f6ff0e48f688e254c
# bad: [bfd143114215b2c553277ee8ae4a8b8a6201de2e] Merge remote-tracking branch 'pstore/for-next/pstore' git bisect bad bfd143114215b2c553277ee8ae4a8b8a6201de2e
# good: [9e771e47962b731c28d1b0a12967f711bf5cc281] Merge remote-tracking branch 'scmi/for-linux-next' git bisect good 9e771e47962b731c28d1b0a12967f711bf5cc281
# bad: [cee36340e05bf662d19cb845708fa881369ed583] Merge remote-tracking branch 'xtensa/xtensa-for-next' git bisect bad cee36340e05bf662d19cb845708fa881369ed583
# bad: [95c7851a03071bd2374b84b4f0079b3dcae30614] Merge remote-tracking branch 'nds32/next' git bisect bad 95c7851a03071bd2374b84b4f0079b3dcae30614
# good: [43a3834a7d0fbb9116649185ff0926968cc553d5] Merge remote-tracking branch 'tegra/for-next' git bisect good 43a3834a7d0fbb9116649185ff0926968cc553d5
# good: [8fae22fc750017fdf998ec3aa1315741fd3de857] Merge remote-tracking branch 'h8300/h8300-next' git bisect good 8fae22fc750017fdf998ec3aa1315741fd3de857
# good: [e798861fd7b297370a8dd7b8dad2e139c1d08446] Merge remote-tracking branch 'm68knommu/for-next' git bisect good e798861fd7b297370a8dd7b8dad2e139c1d08446
# bad: [ac8fd122e070ce0e60c608d4f085f7af77290844] MIPS: Replace setup_irq() by request_irq() git bisect bad ac8fd122e070ce0e60c608d4f085f7af77290844
# good: [f6541f347bba6edbcbb1c930f802bb80b0c56468] MIPS: configs: Cleanup old Kconfig options git bisect good f6541f347bba6edbcbb1c930f802bb80b0c56468
# good: [e5096625bc6bd9e3a0d5f7f9d7ecebda0383c7f5] MIPS: pic32mzda: Drop pointless static qualifier git bisect good e5096625bc6bd9e3a0d5f7f9d7ecebda0383c7f5
# good: [172a37e9d011510aee37f62cc5ac4e53e49d17bb] arch/mips: change duplicated word in NUMA help text git bisect good 172a37e9d011510aee37f62cc5ac4e53e49d17bb
# good: [792a402c2840054533ef56279c212ef6da87d811] MIPS: OCTEON: irq: Fix potential NULL pointer dereference git bisect good 792a402c2840054533ef56279c212ef6da87d811
# first bad commit: [ac8fd122e070ce0e60c608d4f085f7af77290844] MIPS: Replace setup_irq() by request_irq()
[ + Nathan ]
Hi Guenter,
Quoted 2 lines · Guenter Roeck
This patch causes all my mips qemu emulations to hang during boot. This affects all mips, mips64, mipsel, and mipsel64 emulations.
Can you please apply,
https://lkml.kernel.org/r/20200311152751.GA5044@afzalpc,
on top of this patch & see if it fixes the issue. Else please let me know the qemu command line you are using.
Nathan reported a similar issue, above fix fixes that issue.
Regards
afzal
yeap, this supplementary patch fixes the issue, and it works for my on my loongson64 RS780 machine.
regards
bibo, mao
Quoted 13 lines · afzal mohammed
[ + Nathan ]
Hi Guenter,
Quoted 2 lines · Guenter Roeck
This patch causes all my mips qemu emulations to hang during boot. This affects all mips, mips64, mipsel, and mipsel64 emulations.
Can you please apply,
Quoted 8 lines
on top of this patch & see if it fixes the issue. Else please let me know the qemu command line you are using.
Nathan reported a similar issue, above fix fixes that issue.
Regards
afzal
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 2 lines · maobibo
yeap, this supplementary patch fixes the issue, and it works for my on my loongson64 RS780 machine.
Thanks, i will be sending a (hopefully) better patch based on the feedback from Thomas.
Regards
afzal
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 9 lines · afzal mohammed
[ + Nathan ]
Hi Guenter,
Quoted 2 lines · Guenter Roeck
This patch causes all my mips qemu emulations to hang during boot. This affects all mips, mips64, mipsel, and mipsel64 emulations.
Quoted 7 lines
Can you please apply,
https://lkml.kernel.org/r/20200311152751.GA5044@afzalpc,
on top of this patch & see if it fixes the issue. Else please let me know the qemu command line you are using.
I have not tested all configurations, but a quick check suggests that it does indeed fix the problem.
Thanks,
Guenter
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 10 lines · Guenter Roeck
Quoted 5 lines · afzal mohammed
Can you please apply,
https://lkml.kernel.org/r/20200311152751.GA5044@afzalpc,
on top of this patch & see if it fixes the issue.
I have not tested all configurations, but a quick check suggests that it does indeed fix the problem.
Thanks Guenter for checking,
i have sent a newer version [1] of that patch based on the feedback from Thomas.
REgards
afzal
[1] https://lkml.kernel.org/r/20200314081312.GA4948@afzalpc
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Hi Thomas,
Quoted 8 lines · Thomas Bogendoerfer
Quoted 4 lines · afzal mohammed
Hi mips maintainers,
if okay w/ this change, please consider taking it thr' your tree, else please let me know.
sorry this doesn't even compile for the first platform I've tested:
i apologize for the mistake.
Of the 15 architectures that were subjected to setup_irq() cleanup, i had done build & boot test only on ARM & x86_64, at the minimum i should have informed you upfront in the previous mail (in v2 & v1 it was mentioned in cover letter). i was trying to rely on kbuild test robot for help in building other arch's. Seems it is randomly selecting patches, since some of the issues were present in v2 & v1 as well and no error report were recieved on v1 & v2 MIPS patch.
kbuild test robot had provided the way to create mips cross compiler as well as the config. The build error has been fixed that were spotted by you as well kbuild test robot, also there were a few more issues including other build error. v4 that resolves all these has been sent.
All the files that has been modified has been verifed to generate object files w/o error or warnings. w/ the test robot provided config, not all changes in my patch were being compiled, so i had to manually select each machines one at a time to verify every change. Also i couldn't build 3 machines (msp71xx, loongson64 & bcm63xx) even w/o my changes. Those i had to find out defconfig's that can make those changes build, then they also could be verified.
Sorry for the trouble, please let me know if further issues.
For your reference, diff between v4 & v3 below,
Regards
afzal
arch/alpha/kernel/irq_alpha.c +1 -1
@@ -214,7 +214,7 @@ process_mcheck_info(unsigned long vector, unsigned long la_ptr,* processed by PALcode, and comes in via entInt vector 1. */ void __init -init_rtc_irq (irqreturn_t handler) +init_rtc_irq (irq_handler_t handler) {irq_set_chip_and_handler_name (RTC_IRQ , &dummy_irq_chip, handle_percpu_irq,"RTC" );
arch/alpha/kernel/irq_impl.h +1 -1
@@ -23,7 +23,7 @@ extern void pyxis_device_interrupt(unsigned long);extern void init_srm_irqs (long ,unsigned long );extern void init_pyxis_irqs (unsigned long ); -extern void init_rtc_irq (irqreturn_t handler); +extern void init_rtc_irq (irq_handler_t handler);extern void common_init_isa_dma (void );
arch/mips/include/asm/sni.h +2 -0
@@ -11,6 +11,8 @@#ifndef __ASM_SNI_H#define __ASM_SNI_H +#include <linux/irqreturn.h> +extern unsigned int sni_brd_type;#define SNI_BRD_10 2
arch/mips/pmcs-msp71xx/msp_time.c +1 -1
@@ -76,7 +76,7 @@ void __init plat_time_init(void)unsigned int get_c0_compare_int (void ) { -unsigned log flags =IRQF_PERCPU |IRQF_TIMER |IRQF_SHARED ; +unsigned long flags =IRQF_PERCPU |IRQF_TIMER |IRQF_SHARED ;/* MIPS_MT modes may want timer for second VPE */ if ((get_current_vpe ()) && !tim_installed) {
arch/mips/ralink/cevt-rt3352.c +1 -1
@@ -89,7 +89,7 @@ static int systick_shutdown(struct clock_event_device *evt) sdev = container_of(evt, struct systick_device, dev);if (sdev->irq_requested) -free_irq (systick.dev.irq, &systick_irqaction); +free_irq (systick.dev.irq, &systick.dev); sdev->irq_requested =0 ;iowrite32 (0 , systick.membase +SYSTICK_CONFIG );
arch/mips/sni/time.c +1 -3
@@ -62,14 +62,12 @@ static irqreturn_t a20r_interrupt(int irq, void *dev_id)static void __init sni_a20r_timer_setup (void ) {struct clock_event_device *cd = &a20r_clockevent_device; -struct irqaction *action = &a20r_irqaction;unsigned int cpu =smp_processor_id (); cd->cpumask =cpumask_of (cpu);clockevents_register_device (cd); - action->dev_id = cd;if (request_irq (SNI_A20R_IRQ_TIMER , a20r_interrupt, -IRQF_PERCPU |IRQF_TIMER ,"a20r-timer" ,NULL )) +IRQF_PERCPU |IRQF_TIMER ,"a20r-timer" , cd))pr_err ("Failed to register a20r-timer interrupt\n" ); }
Hi Thomas,
Quoted 1 line · afzal mohammed
For your reference, diff between v4 & v3 below,
i messed up with the diff b/n v4 & v3, correct one as follows, v4 is a proper one, only diff generation got messed up.
Regards
afzal
arch/mips/include/asm/sni.h +2 -0
@@ -11,6 +11,8 @@#ifndef __ASM_SNI_H#define __ASM_SNI_H +#include <linux/irqreturn.h> +extern unsigned int sni_brd_type;#define SNI_BRD_10 2
arch/mips/pmcs-msp71xx/msp_time.c +1 -1
@@ -76,7 +76,7 @@ void __init plat_time_init(void)unsigned int get_c0_compare_int (void ) { -unsigned log flags =IRQF_PERCPU |IRQF_TIMER |IRQF_SHARED ; +unsigned long flags =IRQF_PERCPU |IRQF_TIMER |IRQF_SHARED ;/* MIPS_MT modes may want timer for second VPE */ if ((get_current_vpe ()) && !tim_installed) {
arch/mips/ralink/cevt-rt3352.c +1 -1
@@ -89,7 +89,7 @@ static int systick_shutdown(struct clock_event_device *evt) sdev = container_of(evt, struct systick_device, dev);if (sdev->irq_requested) -free_irq (systick.dev.irq, &systick_irqaction); +free_irq (systick.dev.irq, &systick.dev); sdev->irq_requested =0 ;iowrite32 (0 , systick.membase +SYSTICK_CONFIG );
arch/mips/sni/time.c +1 -3
@@ -62,14 +62,12 @@ static irqreturn_t a20r_interrupt(int irq, void *dev_id)static void __init sni_a20r_timer_setup (void ) {struct clock_event_device *cd = &a20r_clockevent_device; -struct irqaction *action = &a20r_irqaction;unsigned int cpu =smp_processor_id (); cd->cpumask =cpumask_of (cpu);clockevents_register_device (cd); - action->dev_id = cd;if (request_irq (SNI_A20R_IRQ_TIMER , a20r_interrupt, -IRQF_PERCPU |IRQF_TIMER ,"a20r-timer" ,NULL )) +IRQF_PERCPU |IRQF_TIMER ,"a20r-timer" , cd))pr_err ("Failed to register a20r-timer interrupt\n" ); }