Skip to contentSkip to conversation

alpha: irq: run all handlers with interrupts disabled

PATCH New Will Deacon 1 participant 2 messages Mar 17, 2013 Alpha port

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 alpha: irq: run all handlers with interrupts disabled

Linux has expected that interrupt handlers are executed with local interrupts disabled for a while now, so ensure that this is the case on Alpha even for non-device interrupts such as IPIs.

Without this patch, secondary boot results in the following backtrace:

------------[ cut here ]------------
warning: at kernel/softirq.c:139 __local_bh_enable+0xb8/0xd0()
modules linked in:
fffffc0000867c70 fffffc0000876618 fffffc0000330628 0000000000000200
       fffffc000088e1b0 fffffc0000868000 0000000000000000 0000000000000000
       fffffc0000331594 fffffc00008c79a0 fffffc000085fac0 0000000000000001
       fffffc00003597e0 0000000000000008 fffffc000031b3b4 0000000000000001
       0000000000000001 0000000000000000 fffffc0000315c4c fffffc00008b88f8
       fffffc0000856e20 fffffc0000856b00 fffffc0001a060c0 0000000000000007
trace:
[<fffffc0000330628>] __local_bh_enable+0xb8/0xd0
[<fffffc0000331594>] irq_enter+0x74/0xa0
[<fffffc00003597e0>] scheduler_ipi+0x50/0x100
[<fffffc000031b3b4>] handle_ipi+0x84/0x260
[<fffffc0000315c4c>] do_entint+0x1ac/0x2e0
[<fffffc0000331620>] irq_exit+0x60/0xa0
[<fffffc00003159e8>] handle_irq+0x98/0x100
[<fffffc0000315d68>] do_entint+0x2c8/0x2e0
[<fffffc0000310d80>] ret_from_sys_call+0x0/0x10
[<fffffc0000365124>] load_balance+0x3e4/0x870
[<fffffc0000312bd4>] cpu_idle+0x24/0x80
[<fffffc0000391bd0>] rcu_eqs_enter_common.isra.38+0x0/0x120
[<fffffc0000312bf0>] cpu_idle+0x40/0x80
[<fffffc0000715030>] rest_init+0xc0/0xe0
[<fffffc000031001c>] _stext+0x1c/0x20

---[ end trace 5bbac1dc3a0ec32e ]---

A similar dump occurs if you try to reboot using magic-sysrq.

Cc Richard Henderson <[email protected]>
Cc Ivan Kokshaysky <[email protected]>
Cc Matt Turner <[email protected]>
---
 arch/alpha/kernel/irq.c       | 7 -------
 arch/alpha/kernel/irq_alpha.c | 9 ++++++++-
 2 files changed, 8 insertions(+), 8 deletions(-)
arch/alpha/kernel/irq.c +0 -7
index 2872acc..7b2be25 100644
@@ -117,13 +117,6 @@ handle_irq(int irq)
 		return;
 	}
 
-	/*
-	 * From here we must proceed with IPL_MAX. Note that we do not
-	 * explicitly enable interrupts afterwards - some MILO PALcode
-	 * (namely LX164 one) seems to have severe problems with RTI
-	 * at IPL 0.
-	 */
-	local_irq_disable();
 	irq_enter();
 	generic_handle_irq_desc(irq, desc);
 	irq_exit();
arch/alpha/kernel/irq_alpha.c +8 -1
index 772ddfdb..1216dfb 100644
@@ -45,6 +45,14 @@ do_entInt(unsigned long type, unsigned long vector,
 	  unsigned long la_ptr, struct pt_regs *regs)
 {
 	struct pt_regs *old_regs;
+
+	/*
+	 * Disable interrupts during IRQ handling.
+	 * Note that there is no matching local_irq_enable() due to
+	 * severe problems with RTI at IPL0 and some MILO PALcode
+	 * (namely LX164).
+	 */
+	local_irq_disable();
 	switch (type) {
 	case 0:
 #ifdef CONFIG_SMP
@@ -62,7 +70,6 @@ do_entInt(unsigned long type, unsigned long vector,
 	  {
 		long cpu;
 
-		local_irq_disable();
 		smp_percpu_timer_interrupt(regs);
 		cpu = smp_processor_id();
 		if (cpu != boot_cpuid) {
Signature · 1 line
1.8.0
#1 lore raw

PATCH 2/2 alpha: irq: remove deprecated use of IRQF_DISABLED

Interrupt handlers are always invoked with interrupts disabled, so remove all uses of the deprecated IRQF_DISABLED flag.

Cc Richard Henderson <[email protected]>
Cc Ivan Kokshaysky <[email protected]>
Cc Matt Turner <[email protected]>
---
 arch/alpha/include/asm/floppy.h |  2 +-
 arch/alpha/kernel/irq_alpha.c   |  1 -
 arch/alpha/kernel/sys_titan.c   | 14 +++++++-------
 3 files changed, 8 insertions(+), 9 deletions(-)
arch/alpha/include/asm/floppy.h +1 -1
index 46cefbd..bae97eb 100644
@@ -26,7 +26,7 @@
 #define fd_disable_irq()        disable_irq(FLOPPY_IRQ)
 #define fd_cacheflush(addr,size) /* nothing */
 #define fd_request_irq()        request_irq(FLOPPY_IRQ, floppy_interrupt,\
-					    IRQF_DISABLED, "floppy", NULL)
+					    0, "floppy", NULL)
 #define fd_free_irq()           free_irq(FLOPPY_IRQ, NULL)
 
 #ifdef CONFIG_PCI
arch/alpha/kernel/irq_alpha.c +0 -1
index 1216dfb..f433fc1 100644
@@ -229,7 +229,6 @@ process_mcheck_info(unsigned long vector, unsigned long la_ptr,
 
 struct irqaction timer_irqaction = {
 	.handler	= timer_interrupt,
-	.flags		= IRQF_DISABLED,
 	.name		= "timer",
 };
 
arch/alpha/kernel/sys_titan.c +7 -7
index 5cf4a48..a53cf03 100644
@@ -280,15 +280,15 @@ titan_late_init(void)
 	 * all reported to the kernel as machine checks, so the handler
 	 * is a nop so it can be called to count the individual events.
 	 */
-	titan_request_irq(63+16, titan_intr_nop, IRQF_DISABLED,
+	titan_request_irq(63+16, titan_intr_nop, 0,
 		    "CChip Error", NULL);
-	titan_request_irq(62+16, titan_intr_nop, IRQF_DISABLED,
+	titan_request_irq(62+16, titan_intr_nop, 0,
 		    "PChip 0 H_Error", NULL);
-	titan_request_irq(61+16, titan_intr_nop, IRQF_DISABLED,
+	titan_request_irq(61+16, titan_intr_nop, 0,
 		    "PChip 1 H_Error", NULL);
-	titan_request_irq(60+16, titan_intr_nop, IRQF_DISABLED,
+	titan_request_irq(60+16, titan_intr_nop, 0,
 		    "PChip 0 C_Error", NULL);
-	titan_request_irq(59+16, titan_intr_nop, IRQF_DISABLED,
+	titan_request_irq(59+16, titan_intr_nop, 0,
 		    "PChip 1 C_Error", NULL);
 
 	/* 
@@ -348,9 +348,9 @@ privateer_init_pci(void)
 	 * Hook a couple of extra err interrupts that the
 	 * common titan code won't.
 	 */
-	titan_request_irq(53+16, titan_intr_nop, IRQF_DISABLED,
+	titan_request_irq(53+16, titan_intr_nop, 0,
 		    "NMI", NULL);
-	titan_request_irq(50+16, titan_intr_nop, IRQF_DISABLED,
+	titan_request_irq(50+16, titan_intr_nop, 0,
 		    "Temperature Warning", NULL);
 
 	/*
Signature · 1 line
1.8.0