Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfashe...
[firefly-linux-kernel-4.4.55.git] / include / asm-sparc64 / mmu_context.h
index 2337eb48771908ca86f94a1a5d4cba3d42c0e43d..9fc225ed5500d20c5372653389d8783ffc49ef4b 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/spinlock.h>
 #include <asm/system.h>
 #include <asm/spitfire.h>
+#include <asm-generic/mm_hooks.h>
 
 static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
 {
@@ -75,6 +76,9 @@ static inline void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, str
        unsigned long ctx_valid, flags;
        int cpu;
 
+       if (unlikely(mm == &init_mm))
+               return;
+
        spin_lock_irqsave(&mm->context.lock, flags);
        ctx_valid = CTX_VALID(mm->context);
        if (!ctx_valid)