Commit 3da06ed7 authored by Akira Takeuchi's avatar Akira Takeuchi Committed by Linus Torvalds

mn10300: Fix crash just after starting userspace on !CONFIG_PREEMPT

The mn10300 kernel crashes just after starting userspace programs, if
CONFIG_PREEMPT is disabled:

  Freeing unused kernel memory: 96K (90286000 - 9029e000)
  MISALIGN: 97c33ff9: unsupported instruction f
  MISALIGN: 97c33ff9: unsupported instruction f
  MISALIGN: 97c33ff9: unsupported instruction f
  :

This fixes the problem that was introduced by commit d17fc238
("MN10300: Enable IRQs more in system call exit work path").
Signed-off-by: default avatarAkira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: default avatarKiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 31f7c3a6
......@@ -171,10 +171,10 @@ ret_from_intr:
mov (REG_EPSW,fp),d0 # need to deliver signals before
# returning to userspace
and EPSW_nSL,d0
beq resume_kernel # returning to supervisor mode
bne resume_userspace # returning to userspace
#ifdef CONFIG_PREEMPT
ENTRY(resume_kernel)
resume_kernel:
LOCAL_IRQ_DISABLE
mov (TI_preempt_count,a2),d0 # non-zero preempt_count ?
cmp 0,d0
......@@ -189,6 +189,8 @@ need_resched:
bne restore_all
call preempt_schedule_irq[],0
jmp need_resched
#else
jmp resume_kernel
#endif
......
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