Skip to content

Commit

Permalink
m68knommu: fix compare race in sched related code
Browse files Browse the repository at this point in the history
The interrupts must be disabled before considering the need resched
bit of the task struct and they have to be disabled before calling
schedule()

Signed-off-by: Sebastian Siewior <bigeasy@linutronix.de>
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Sebastian Siewior authored and torvalds committed May 1, 2008
1 parent 0042a1f commit 6c5a7d5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/m68knommu/platform/coldfire/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ ret_from_signal:
addql #4,%sp

ret_from_exception:
move #0x2700,%sr /* disable intrs */
btst #5,%sp@(PT_SR) /* check if returning to kernel */
jeq Luser_return /* if so, skip resched, signals */

Expand Down Expand Up @@ -156,6 +157,7 @@ Lreturn:

Lwork_to_do:
movel %a0@(TI_FLAGS),%d1 /* get thread_info->flags */
move #0x2000,%sr /* enable intrs again */
btst #TIF_NEED_RESCHED,%d1
jne reschedule

Expand Down

0 comments on commit 6c5a7d5

Please sign in to comment.