arch/tile: fix up some issues in calling do_work_pending()
[linux-flexiantxendom0-3.2.10.git] / arch / tile / kernel / process.c
index 2d5ef61..54e6c64 100644 (file)
@@ -567,6 +567,10 @@ struct task_struct *__sched _switch_to(struct task_struct *prev,
  */
 int do_work_pending(struct pt_regs *regs, u32 thread_info_flags)
 {
+       /* If we enter in kernel mode, do nothing and exit the caller loop. */
+       if (!user_mode(regs))
+               return 0;
+
        if (thread_info_flags & _TIF_NEED_RESCHED) {
                schedule();
                return 1;
@@ -589,8 +593,7 @@ int do_work_pending(struct pt_regs *regs, u32 thread_info_flags)
                return 1;
        }
        if (thread_info_flags & _TIF_SINGLESTEP) {
-               if ((regs->ex1 & SPR_EX_CONTEXT_1_1__PL_MASK) == 0)
-                       single_step_once(regs);
+               single_step_once(regs);
                return 0;
        }
        panic("work_pending: bad flags %#x\n", thread_info_flags);