MIPS: Hibernate: flush TLB entries earlier
PATCH 1/1 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().
--- arch/mips/power/hibernate.S | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
arch/mips/power/hibernate.S +2 -1
@@ -30,6 +30,8 @@ LEAF(swsusp_arch_suspend) END(swsusp_arch_suspend) LEAF(swsusp_arch_resume) + /* Avoid TLB mismatch during and after kernel resume */ + jal local_flush_tlb_all PTR_L t0, restore_pblist 0: PTR_L t1, PBE_ADDRESS(t0) /* source */
@@ -43,7 +45,6 @@ LEAF(swsusp_arch_resume) bne t1, t3, 1b PTR_L t0, PBE_NEXT(t0) bnez t0, 0b - jal local_flush_tlb_all /* Avoid TLB mismatch after kernel resume */ PTR_LA t0, saved_regs PTR_L ra, PT_R31(t0) PTR_L sp, PT_R29(t0)
Signature · 1 line
1.7.7.3
Quoted 15 lines · Huacai Chen
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().Cc <[email protected]>Signed-off-by Huacai Chen <[email protected]>--- arch/mips/power/hibernate.S | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)arch/mips/power/hibernate.S +0
-0
arch/mips/power/hibernate.S LEAF(swsusp_arch_suspend) · line 34
Quoted 5 lines
arch/mips/power/hibernate.S +2
-0@@ -30,6 +30,8 @@ LEAF(swsusp_arch_suspend) END(swsusp_arch_suspend) LEAF(swsusp_arch_resume) + /* Avoid TLB mismatch during and after kernel resume */ + jal local_flush_tlb_all
I'd like to keep the assembler code to a minimum. Can you rename swsusp_arch_resume and create a new wrapper function in C named swsusp_arch_resume() which calls the old swsusp_arch_resume() after calling local_flush_tlb_all(), something like that?
Thanks,
Ralf
Hi, Ralf,
Maybe it is better to have two patches: the first fix the bug, and the second restructure files and functions?
Huacai
Quoted 32 lines · Ralf Baechle
Quoted 15 lines · Huacai Chen
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().Cc <[email protected]>Signed-off-by Huacai Chen <[email protected]>--- arch/mips/power/hibernate.S | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)arch/mips/power/hibernate.S +0
-0arch/mips/power/hibernate.S LEAF(swsusp_arch_suspend) · line 34
Quoted 5 lines
arch/mips/power/hibernate.S +2
-0@@ -30,6 +30,8 @@ LEAF(swsusp_arch_suspend) END(swsusp_arch_suspend) LEAF(swsusp_arch_resume) + /* Avoid TLB mismatch during and after kernel resume */ + jal local_flush_tlb_allI'd like to keep the assembler code to a minimum. Can you rename
swsusp_arch_resumeand create a new wrapper function in C namedswsusp_arch_resume()which calls the oldswsusp_arch_resume()after callinglocal_flush_tlb_all(), something like that?Thanks,
Ralf