Skip to content

Commit 49e6e07

Browse files
afzalmamtsbogend
authored andcommitted
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. Fixes: ac8fd12 ("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]> Tested-by: Guenter Roeck <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent ac8fd12 commit 49e6e07

File tree

7 files changed

+14
-13
lines changed

7 files changed

+14
-13
lines changed

arch/mips/dec/setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ void __init arch_init_irq(void)
758758
/* Register the bus error interrupt. */
759759
if (dec_interrupt[DEC_IRQ_BUS] >= 0 && busirq_handler) {
760760
if (request_irq(dec_interrupt[DEC_IRQ_BUS], busirq_handler,
761-
busirq_flags, "bus error", NULL))
761+
busirq_flags, "bus error", busirq_handler))
762762
pr_err("Failed to register bus error interrupt\n");
763763
}
764764
/* Register the HALT interrupt. */

arch/mips/kernel/cevt-r4k.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,8 @@ int r4k_clockevent_init(void)
292292

293293
cp0_timer_irq_installed = 1;
294294

295-
if (request_irq(irq, c0_compare_interrupt, flags, "timer", NULL))
295+
if (request_irq(irq, c0_compare_interrupt, flags, "timer",
296+
c0_compare_interrupt))
296297
pr_err("Failed to request irq %d (timer)\n", irq);
297298

298299
return 0;

arch/mips/loongson2ef/lemote-2f/irq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ void __init mach_init_irq(void)
109109

110110
/* setup north bridge irq (bonito) */
111111
if (request_irq(LOONGSON_NORTH_BRIDGE_IRQ, ip6_action,
112-
IRQF_SHARED | IRQF_NO_THREAD, "cascade", NULL))
112+
IRQF_SHARED | IRQF_NO_THREAD, "cascade", ip6_action))
113113
pr_err("Failed to register north bridge cascade interrupt\n");
114114
/* setup source bridge irq (i8259) */
115115
if (request_irq(LOONGSON_SOUTH_BRIDGE_IRQ, no_action,

arch/mips/pmcs-msp71xx/msp_time.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ unsigned int get_c0_compare_int(void)
8181
/* MIPS_MT modes may want timer for second VPE */
8282
if ((get_current_vpe()) && !tim_installed) {
8383
if (request_irq(MSP_INT_VPE1_TIMER, c0_compare_interrupt, flags,
84-
"timer", NULL))
84+
"timer", c0_compare_interrupt))
8585
pr_err("Failed to register timer interrupt\n");
8686
tim_installed++;
8787
}

arch/mips/sni/a20r.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ void __init sni_a20r_irq_init(void)
222222
irq_set_chip_and_handler(i, &a20r_irq_type, handle_level_irq);
223223
sni_hwint = a20r_hwint;
224224
change_c0_status(ST0_IM, IE_IRQ0);
225-
if (request_irq(SNI_A20R_IRQ_BASE + 3, sni_isa_irq_handler,
226-
IRQF_SHARED, "ISA", NULL))
225+
if (request_irq(SNI_A20R_IRQ_BASE + 3, sni_isa_irq_handler, 0, "ISA",
226+
NULL))
227227
pr_err("Failed to register ISA interrupt\n");
228228
}
229229

arch/mips/sni/pcit.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ void __init sni_pcit_irq_init(void)
244244
*(volatile u32 *)SNI_PCIT_INT_REG = 0;
245245
sni_hwint = sni_pcit_hwint;
246246
change_c0_status(ST0_IM, IE_IRQ1);
247-
if (request_irq(SNI_PCIT_INT_START + 6, sni_isa_irq_handler,
248-
IRQF_SHARED, "ISA", NULL))
247+
if (request_irq(SNI_PCIT_INT_START + 6, sni_isa_irq_handler, 0, "ISA",
248+
NULL))
249249
pr_err("Failed to register ISA interrupt\n");
250250
}
251251

@@ -259,8 +259,8 @@ void __init sni_pcit_cplus_irq_init(void)
259259
*(volatile u32 *)SNI_PCIT_INT_REG = 0x40000000;
260260
sni_hwint = sni_pcit_hwint_cplus;
261261
change_c0_status(ST0_IM, IE_IRQ0);
262-
if (request_irq(MIPS_CPU_IRQ_BASE + 3, sni_isa_irq_handler,
263-
IRQF_SHARED, "ISA", NULL))
262+
if (request_irq(MIPS_CPU_IRQ_BASE + 3, sni_isa_irq_handler, 0, "ISA",
263+
NULL))
264264
pr_err("Failed to register ISA interrupt\n");
265265
}
266266

arch/mips/sni/rm200.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -473,10 +473,10 @@ void __init sni_rm200_irq_init(void)
473473
sni_hwint = sni_rm200_hwint;
474474
change_c0_status(ST0_IM, IE_IRQ0);
475475
if (request_irq(SNI_RM200_INT_START + 0, sni_rm200_i8259A_irq_handler,
476-
IRQF_SHARED, "onboard ISA", NULL))
476+
0, "onboard ISA", NULL))
477477
pr_err("Failed to register onboard ISA interrupt\n");
478-
if (request_irq(SNI_RM200_INT_START + 1, sni_isa_irq_handler,
479-
IRQF_SHARED, "ISA", NULL))
478+
if (request_irq(SNI_RM200_INT_START + 1, sni_isa_irq_handler, 0, "ISA",
479+
NULL))
480480
pr_err("Failed to register ISA interrupt\n");
481481
}
482482

0 commit comments

Comments
 (0)