Skip to content

Commit

Permalink
MN10300: Fix the preemption resume_kernel() routine
Browse files Browse the repository at this point in the history
Fix the preemption resume_kernel() routine by inverting the test to see
whether interrupts are off (IM7 is all enabled, not all disabled).

Furthermore, interrupts should be disabled on entry to resume_kernel() so that
they're correctly set for jumping to restore_all() and doing the need
reschedule test.

Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Akira Takeuchi authored and torvalds committed Dec 10, 2008
1 parent a8893fb commit 24646bd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/mn10300/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ ENTRY(resume_userspace)

#ifdef CONFIG_PREEMPT
ENTRY(resume_kernel)
__cli
mov (TI_preempt_count,a2),d0 # non-zero preempt_count ?
cmp 0,d0
bne restore_all
Expand All @@ -190,7 +191,7 @@ need_resched:
mov (REG_EPSW,fp),d0
and EPSW_IM,d0
cmp EPSW_IM_7,d0 # interrupts off (exception path) ?
beq restore_all
bne restore_all
call preempt_schedule_irq[],0
jmp need_resched
#endif
Expand Down

0 comments on commit 24646bd

Please sign in to comment.