Commit a350bc24 authored by Russell King's avatar Russell King

[ARM] Restore preempt count before reporting unbalanced preempt count

On ARM, we oops when we detect that an interrupt handler has unbalanced
the preempt count.  We should restore the preempt count when we started
to handle the interrupt and then cause the oops.
parent d8376671
......@@ -772,8 +772,8 @@ __irq_svc: sub sp, sp, #S_FRAME_SIZE
preempt_return:
ldr r0, [r8, #TI_PREEMPT] @ read preempt value
teq r0, r7
strne r0, [r0, -r0] @ bug()
str r9, [r8, #TI_PREEMPT] @ restore preempt count
strne r0, [r0, -r0] @ bug()
#endif
ldr r0, [sp, #S_PSR] @ irqs are already disabled
msr spsr, r0
......@@ -908,8 +908,8 @@ __irq_usr: sub sp, sp, #S_FRAME_SIZE
#ifdef CONFIG_PREEMPT
ldr r0, [r8, #TI_PREEMPT]
teq r0, r7
strne r0, [r0, -r0]
str r9, [r8, #TI_PREEMPT]
strne r0, [r0, -r0]
mov tsk, r8
#else
get_thread_info tsk
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment