Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Hibernate: flush TLB entries earlier

We found that TLB mismatch not only happens after kernel resume, but
also happens during snapshot restore. So move it to the beginning of
swsusp_arch_suspend().

Signed-off-by: Huacai Chen <chenhc@lemote.com>
Cc: <stable@vger.kernel.org>
Cc: Steven J. Hill <Steven.Hill@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: Fuxin Zhang <zhangfx@lemote.com>
Cc: Zhangjin Wu <wuzhangjin@gmail.com>
Cc: stable@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/9621/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Huacai Chen and committed by
Ralf Baechle
2a21dc7c 4c9164b9

+2 -1
+2 -1
arch/mips/power/hibernate.S
··· 30 30 END(swsusp_arch_suspend) 31 31 32 32 LEAF(swsusp_arch_resume) 33 + /* Avoid TLB mismatch during and after kernel resume */ 34 + jal local_flush_tlb_all 33 35 PTR_L t0, restore_pblist 34 36 0: 35 37 PTR_L t1, PBE_ADDRESS(t0) /* source */ ··· 45 43 bne t1, t3, 1b 46 44 PTR_L t0, PBE_NEXT(t0) 47 45 bnez t0, 0b 48 - jal local_flush_tlb_all /* Avoid TLB mismatch after kernel resume */ 49 46 PTR_LA t0, saved_regs 50 47 PTR_L ra, PT_R31(t0) 51 48 PTR_L sp, PT_R29(t0)