]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Revert "arm: pull all work_pending logics into C function"
authorStephen Rothwell <sfr@canb.auug.org.au>
Fri, 6 Jul 2012 00:35:33 +0000 (10:35 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 6 Jul 2012 00:35:33 +0000 (10:35 +1000)
This reverts commit c1eafa6fc84aaf725e02c7b50ee8a8a748f45b63.

Requested by Russell King.

arch/arm/kernel/entry-common.S
arch/arm/kernel/signal.c

index fbee93f536e987b116ab26432dcca3fa40801bd8..4afed88d250a6f6127a8a42a7a3462394b078bfc 100644 (file)
@@ -51,10 +51,23 @@ ret_fast_syscall:
 fast_work_pending:
        str     r0, [sp, #S_R0+S_OFF]!          @ returned r0
 work_pending:
+       tst     r1, #_TIF_NEED_RESCHED
+       bne     work_resched
+       /*
+        * TIF_SIGPENDING or TIF_NOTIFY_RESUME must've been set if we got here
+        */
+       ldr     r2, [sp, #S_PSR]
        mov     r0, sp                          @ 'regs'
+       tst     r2, #15                         @ are we returning to user mode?
+       bne     no_work_pending                 @ no?  just leave, then...
        mov     r2, why                         @ 'syscall'
-       bl      do_work_pending
-       b       no_work_pending
+       tst     r1, #_TIF_SIGPENDING            @ delivering a signal?
+       movne   why, #0                         @ prevent further restarts
+       bl      do_notify_resume
+       b       ret_slow_syscall                @ Check work again
+
+work_resched:
+       bl      schedule
 /*
  * "slow" syscall return path.  "why" tells us if this was a real syscall.
  */
index c0adc5e123bed1c32be58fb5aa951b3aeae23056..cd191711af9e6192046f080f0e04d900ed90e2c0 100644 (file)
@@ -639,24 +639,13 @@ static void do_signal(struct pt_regs *regs, int syscall)
 }
 
 asmlinkage void
-do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall)
+do_notify_resume(struct pt_regs *regs, unsigned int thread_flags, int syscall)
 {
-       do {
-               if (likely(thread_flags & _TIF_NEED_RESCHED)) {
-                       schedule();
-               } else {
-                       if (unlikely(!user_mode(regs)))
-                               return;
-                       local_irq_enable();
-                       if (thread_flags & _TIF_SIGPENDING) {
-                               do_signal(regs, syscall);
-                               syscall = 0;
-                       } else {
-                               clear_thread_flag(TIF_NOTIFY_RESUME);
-                               tracehook_notify_resume(regs);
-                       }
-               }
-               local_irq_disable();
-               thread_flags = current_thread_info()->flags;
-       } while (thread_flags & _TIF_WORK_MASK);
+       if (thread_flags & _TIF_SIGPENDING)
+               do_signal(regs, syscall);
+
+       if (thread_flags & _TIF_NOTIFY_RESUME) {
+               clear_thread_flag(TIF_NOTIFY_RESUME);
+               tracehook_notify_resume(regs);
+       }
 }