summaryrefslogtreecommitdiffstats
path: root/arch/xtensa/kernel/vectors.S
diff options
context:
space:
mode:
authorMax Filippov2013-03-25 23:51:43 +0100
committerChris Zankel2013-05-09 10:07:11 +0200
commit895666a9920f19bc256340aaf58d01da6e677a16 (patch)
treeff0b0fc50790d6ae5a37c5317e67523985f87bbd /arch/xtensa/kernel/vectors.S
parentxtensa: enable lockdep support (diff)
downloadkernel-qcow2-linux-895666a9920f19bc256340aaf58d01da6e677a16.tar.gz
kernel-qcow2-linux-895666a9920f19bc256340aaf58d01da6e677a16.tar.xz
kernel-qcow2-linux-895666a9920f19bc256340aaf58d01da6e677a16.zip
xtensa: disable IRQs while IRQ handler is running
IRQ handlers are expected to run with IRQs disabled. See e.g. http://lwn.net/Articles/380931/ for a longer story. This was overlooked in the commit 2d1c645 xtensa: dispatch medium-priority interrupts Revert to old behavior and simplify interrupt entry and exit code. Interrupt handler still honours IRQ priority. do_notify_resume/schedule must be called with interrupts enabled, enable interrupts if we return from user exception. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Chris Zankel <chris@zankel.net>
Diffstat (limited to 'arch/xtensa/kernel/vectors.S')
-rw-r--r--arch/xtensa/kernel/vectors.S13
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/xtensa/kernel/vectors.S b/arch/xtensa/kernel/vectors.S
index a7e1d0834c68..f9e175382aa9 100644
--- a/arch/xtensa/kernel/vectors.S
+++ b/arch/xtensa/kernel/vectors.S
@@ -386,9 +386,12 @@ ENDPROC(_DebugInterruptVector)
.if XCHAL_EXCM_LEVEL >= \level
.section .Level\level\()InterruptVector.text, "ax"
ENTRY(_Level\level\()InterruptVector)
- wsr a0, epc1
+ wsr a0, excsave2
rsr a0, epc\level
- xsr a0, epc1
+ wsr a0, epc1
+ movi a0, EXCCAUSE_LEVEL1_INTERRUPT
+ wsr a0, exccause
+ rsr a0, eps\level
# branch to user or kernel vector
j _SimulateUserKernelVectorException
.endif
@@ -440,10 +443,8 @@ ENDPROC(_WindowOverflow4)
*/
.align 4
_SimulateUserKernelVectorException:
- wsr a0, excsave2
- movi a0, 4 # LEVEL1_INTERRUPT cause
- wsr a0, exccause
- rsr a0, ps
+ addi a0, a0, (1 << PS_EXCM_BIT)
+ wsr a0, ps
bbsi.l a0, PS_UM_BIT, 1f # branch if user mode
rsr a0, excsave2 # restore a0
j _KernelExceptionVector # simulate kernel vector exception