Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
[firefly-linux-kernel-4.4.55.git] / arch / powerpc / kernel / process.c
index d7d7602e348f13939d88d0667278480143590350..6e2f03566b0dd8973f15bc4fac732ce4ff654692 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
-#include <linux/smp_lock.h>
 #include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
@@ -305,9 +304,7 @@ struct task_struct *__switch_to(struct task_struct *prev,
                set_dabr(new->thread.dabr);
                __get_cpu_var(current_dabr) = new->thread.dabr;
        }
-
-       flush_tlb_pending();
-#endif
+#endif /* CONFIG_PPC64 */
 
        new_thread = &new->thread;
        old_thread = &current->thread;
@@ -465,8 +462,13 @@ void flush_thread(void)
 #ifdef CONFIG_PPC64
        struct thread_info *t = current_thread_info();
 
-       if (t->flags & _TIF_ABI_PENDING)
-               t->flags ^= (_TIF_ABI_PENDING | _TIF_32BIT);
+       if (test_ti_thread_flag(t, TIF_ABI_PENDING)) {
+               clear_ti_thread_flag(t, TIF_ABI_PENDING);
+               if (test_ti_thread_flag(t, TIF_32BIT))
+                       clear_ti_thread_flag(t, TIF_32BIT);
+               else
+                       set_ti_thread_flag(t, TIF_32BIT);
+       }
 #endif
 
        discard_lazy_cpu_state();