Skip to content

Commit

Permalink
MN10300: Enable IRQs more in system call exit work path
Browse files Browse the repository at this point in the history
Enable IRQs when calling schedule() for TIF_NEED_RESCHED and
do_notify_resume().  If interrupts are enabled during do_notify_resume(), a
warning can be seen (see lower down).

Whilst we're at it, resume_userspace can be made local to entry.S as it is not
called outside of there and it can be merged with the part of work_resched that
occurs after schedule() is called.

  WARNING: at kernel/softirq.c:160 local_bh_enable+0x42/0xa0()
  Call Trace:
    local_bh_enable+0x42/0xa0
    unix_release_sock+0x86/0x23c
    unix_release+0x20/0x28
    sock_release+0x17/0x88
    sock_close+0x20/0x28
    __fput+0xc9/0x1fc
    ____fput+0xb/0x10
    task_work_run+0x64/0x78
    do_notify_resume+0x53d/0x544
    work_notifysig+0xa/0xc

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
dhowells authored and torvalds committed May 30, 2013
1 parent 1e00227 commit d17fc23
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions arch/mn10300/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ syscall_exit_work:
and EPSW_nSL,d0
beq resume_kernel # returning to supervisor mode

btst _TIF_SYSCALL_TRACE,d2
beq work_pending
LOCAL_IRQ_ENABLE # could let syscall_trace_exit() call
# schedule() instead
btst _TIF_SYSCALL_TRACE,d2
beq work_pending
mov fp,d0
call syscall_trace_exit[],0 # do_syscall_trace(regs)
jmp resume_userspace
Expand All @@ -124,6 +124,7 @@ work_pending:
work_resched:
call schedule[],0

resume_userspace:
# make sure we don't miss an interrupt setting need_resched or
# sigpending between sampling and the rti
LOCAL_IRQ_DISABLE
Expand All @@ -132,6 +133,8 @@ work_resched:
mov (TI_flags,a2),d2
btst _TIF_WORK_MASK,d2
beq restore_all

LOCAL_IRQ_ENABLE
btst _TIF_NEED_RESCHED,d2
bne work_resched

Expand Down Expand Up @@ -170,17 +173,6 @@ ret_from_intr:
and EPSW_nSL,d0
beq resume_kernel # returning to supervisor mode

ENTRY(resume_userspace)
# make sure we don't miss an interrupt setting need_resched or
# sigpending between sampling and the rti
LOCAL_IRQ_DISABLE

# is there any work to be done on int/exception return?
mov (TI_flags,a2),d2
btst _TIF_WORK_MASK,d2
bne work_pending
jmp restore_all

#ifdef CONFIG_PREEMPT
ENTRY(resume_kernel)
LOCAL_IRQ_DISABLE
Expand Down

0 comments on commit d17fc23

Please sign in to comment.