Merge branch 'linux-linaro-lsk-v4.4-android' of git://git.linaro.org/kernel/linux...
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / include / asm / mmu_context.h
index 4a32fd5f101dd5ec14f1fcc7d3e922c0cdd25c5f..e53d30c6f7794dfb2372717a1ceab1260784b610 100644 (file)
@@ -218,9 +218,11 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next,
         * Update the saved TTBR0_EL1 of the scheduled-in task as the previous
         * value may have not been initialised yet (activate_mm caller) or the
         * ASID has changed since the last run (following the context switch
-        * of another thread of the same process).
+        * of another thread of the same process). Avoid setting the reserved
+        * TTBR0_EL1 to swapper_pg_dir (init_mm; e.g. via idle_task_exit).
         */
-       update_saved_ttbr0(tsk, next);
+       if (next != &init_mm)
+               update_saved_ttbr0(tsk, next);
 }
 
 #define deactivate_mm(tsk,mm)  do { } while (0)