aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2013-05-28 15:21:10 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-30 00:38:48 -0400
commitd17fc238ac1486906ff724b4a5fe4ec169f554c5 (patch)
treebf8e855854a26a3c93670d8365ccb6fd2448ec2f
parent1e00227d4e8017ac9c3f73bf949a06c6e27f5122 (diff)
MN10300: Enable IRQs more in system call exit work path
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>
-rw-r--r--arch/mn10300/kernel/entry.S18
1 files changed, 5 insertions, 13 deletions
diff --git a/arch/mn10300/kernel/entry.S b/arch/mn10300/kernel/entry.S
index 942005753720..222152a3f751 100644
--- a/arch/mn10300/kernel/entry.S
+++ b/arch/mn10300/kernel/entry.S
@@ -108,10 +108,10 @@ syscall_exit_work:
108 and EPSW_nSL,d0 108 and EPSW_nSL,d0
109 beq resume_kernel # returning to supervisor mode 109 beq resume_kernel # returning to supervisor mode
110 110
111 btst _TIF_SYSCALL_TRACE,d2
112 beq work_pending
113 LOCAL_IRQ_ENABLE # could let syscall_trace_exit() call 111 LOCAL_IRQ_ENABLE # could let syscall_trace_exit() call
114 # schedule() instead 112 # schedule() instead
113 btst _TIF_SYSCALL_TRACE,d2
114 beq work_pending
115 mov fp,d0 115 mov fp,d0
116 call syscall_trace_exit[],0 # do_syscall_trace(regs) 116 call syscall_trace_exit[],0 # do_syscall_trace(regs)
117 jmp resume_userspace 117 jmp resume_userspace
@@ -124,6 +124,7 @@ work_pending:
124work_resched: 124work_resched:
125 call schedule[],0 125 call schedule[],0
126 126
127resume_userspace:
127 # make sure we don't miss an interrupt setting need_resched or 128 # make sure we don't miss an interrupt setting need_resched or
128 # sigpending between sampling and the rti 129 # sigpending between sampling and the rti
129 LOCAL_IRQ_DISABLE 130 LOCAL_IRQ_DISABLE
@@ -132,6 +133,8 @@ work_resched:
132 mov (TI_flags,a2),d2 133 mov (TI_flags,a2),d2
133 btst _TIF_WORK_MASK,d2 134 btst _TIF_WORK_MASK,d2
134 beq restore_all 135 beq restore_all
136
137 LOCAL_IRQ_ENABLE
135 btst _TIF_NEED_RESCHED,d2 138 btst _TIF_NEED_RESCHED,d2
136 bne work_resched 139 bne work_resched
137 140
@@ -170,17 +173,6 @@ ret_from_intr:
170 and EPSW_nSL,d0 173 and EPSW_nSL,d0
171 beq resume_kernel # returning to supervisor mode 174 beq resume_kernel # returning to supervisor mode
172 175
173ENTRY(resume_userspace)
174 # make sure we don't miss an interrupt setting need_resched or
175 # sigpending between sampling and the rti
176 LOCAL_IRQ_DISABLE
177
178 # is there any work to be done on int/exception return?
179 mov (TI_flags,a2),d2
180 btst _TIF_WORK_MASK,d2
181 bne work_pending
182 jmp restore_all
183
184#ifdef CONFIG_PREEMPT 176#ifdef CONFIG_PREEMPT
185ENTRY(resume_kernel) 177ENTRY(resume_kernel)
186 LOCAL_IRQ_DISABLE 178 LOCAL_IRQ_DISABLE