linux/arch
Grant Grundler 3f902886a8 [PARISC] Disable nesting of interrupts
Disable nesting of interrupts - still has holes

The offending sequence starts out like this:
1) take external interrupt
2) set_eiem() to only allow TIMER_IRQ; local interrupts still disabled
3) read the EIRR to get a "list" of pending interrupts
4) clear EIRR of pending interrupts we intend to handle
5) call __do_IRQ() to handle IRQ.
6) handle_IRQ_event() enables local interrupts (I-Bit)
7) take a timer interrupt
8) read EIRR to get a new list of pending interrupts
9) clear EIRR of pending interrupts we just read
10) handle pending interrupts found in (8)
11) set_eiem(cpu_eiem) and return
        [ TROUBLE! all enabled CPU IRQs are unmasked. }
12) handle remaining interrupts pending from (3)
        e.g. call __do_IRQ() -> handle_IRQ_event()..etc
        [ TROUBLE! call to handle_IRQ_event() can now enable *any* IRQ. }
13) set_eiem(cpu_eiem) and return

The problem is we now get into ugly race conditions with Timer and IPI
interrupts at this point.  I'm not exactly sure what happens when
things go wrong (perhaps nest calls to IPI or timer interrupt?).
But I'm certain it's not good.

This sequence will break sooner if (10) would accidentally leave
interrupts enabled.

I'm pretty sure the right answer is now to make cpu_eiem
a per CPU variable since all external interrupts on parisc
are per CPU. This means we will NOT need to send an IPI to
every CPU in the system when enabling or disabling an IRQ
since only one CPU needs to change it's EIEM.

Thanks to James Bottomley for (once again) pointing out the problem.

Signed-off-by: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
2005-11-17 16:26:20 -05:00
..
alpha [PATCH] sched: resched and cpu_idle rework 2005-11-09 07:56:33 -08:00
arm [ARM] sa1111.c needs asm/sizes.h 2005-11-16 18:29:51 +00:00
arm26 [PATCH] sched: disable preempt in idle tasks 2005-11-09 07:56:33 -08:00
cris [PATCH] sched: disable preempt in idle tasks 2005-11-09 07:56:33 -08:00
frv [PATCH] move pm_register/etc. to CONFIG_PM_LEGACY, pm_legacy.h 2005-11-13 18:14:10 -08:00
h8300 [PATCH] sched: disable preempt in idle tasks 2005-11-09 07:56:33 -08:00
i386 [PATCH] drop "[PATCH] i386 kexec-on-panic: Don't shutdown the apics" 2005-11-15 08:59:18 -08:00
ia64 [PATCH] ia64: cpu_idle performance bug fix 2005-11-15 15:50:51 -08:00
m32r [PATCH] sched: disable preempt in idle tasks 2005-11-09 07:56:33 -08:00
m68k [PATCH] m68k: convert thread flags to use bit fields 2005-11-13 18:14:14 -08:00
m68knommu [PATCH] m68knommu: move some platform irq support out of irq.h 2005-11-07 08:00:47 -08:00
mips [MIPS] Update defconfigs 2005-11-17 16:23:58 +00:00
parisc [PARISC] Disable nesting of interrupts 2005-11-17 16:26:20 -05:00
powerpc Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc-merge 2005-11-16 07:58:48 -08:00
ppc [PATCH] ppc: Fix build with CONFIG_CHRP not set 2005-11-16 14:05:07 +11:00
ppc64 powerpc: Move ppc64 boot wrapper code over to arch/powerpc 2005-11-16 13:52:21 +11:00
s390 [PATCH] sched: resched and cpu_idle rework 2005-11-09 07:56:33 -08:00
sh [PATCH] sched: resched and cpu_idle rework 2005-11-09 07:56:33 -08:00
sh64 [PATCH] sched: resched and cpu_idle rework 2005-11-09 07:56:33 -08:00
sparc [PATCH] atomic: inc_not_zero 2005-11-13 18:14:16 -08:00
sparc64 [SBUSFB]: implement ->compat_ioctl 2005-11-12 12:11:12 -08:00
um [PATCH] uml: fix daemon transport exit path bug 2005-11-13 18:14:15 -08:00
v850 [PATCH] v850: use generic hardirq code 2005-11-15 08:59:20 -08:00
x86_64 Merge x86-64 update from Andi 2005-11-14 19:56:02 -08:00
xtensa Merge master.kernel.org:/home/rmk/linux-2.6-drvmodel 2005-11-11 09:24:26 -08:00