Skip to content

Commit 36da5ff

Browse files
chleroympe
authored andcommitted
powerpc/83xx: Also save/restore SPRG4-7 during suspend
The 83xx has 8 SPRG registers and uses at least SPRG4 for DTLB handling LRU. Fixes: 2319f12 ("powerpc/mm: e300c2/c3/c4 TLB errata workaround") Cc: stable@vger.kernel.org Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 0bbea75 commit 36da5ff

File tree

1 file changed

+27
-7
lines changed

1 file changed

+27
-7
lines changed

arch/powerpc/platforms/83xx/suspend-asm.S

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626
#define SS_MSR 0x74
2727
#define SS_SDR1 0x78
2828
#define SS_LR 0x7c
29-
#define SS_SPRG 0x80 /* 4 SPRGs */
30-
#define SS_DBAT 0x90 /* 8 DBATs */
31-
#define SS_IBAT 0xd0 /* 8 IBATs */
32-
#define SS_TB 0x110
33-
#define SS_CR 0x118
34-
#define SS_GPREG 0x11c /* r12-r31 */
35-
#define STATE_SAVE_SIZE 0x16c
29+
#define SS_SPRG 0x80 /* 8 SPRGs */
30+
#define SS_DBAT 0xa0 /* 8 DBATs */
31+
#define SS_IBAT 0xe0 /* 8 IBATs */
32+
#define SS_TB 0x120
33+
#define SS_CR 0x128
34+
#define SS_GPREG 0x12c /* r12-r31 */
35+
#define STATE_SAVE_SIZE 0x17c
3636

3737
.section .data
3838
.align 5
@@ -103,6 +103,16 @@ _GLOBAL(mpc83xx_enter_deep_sleep)
103103
stw r7, SS_SPRG+12(r3)
104104
stw r8, SS_SDR1(r3)
105105

106+
mfspr r4, SPRN_SPRG4
107+
mfspr r5, SPRN_SPRG5
108+
mfspr r6, SPRN_SPRG6
109+
mfspr r7, SPRN_SPRG7
110+
111+
stw r4, SS_SPRG+16(r3)
112+
stw r5, SS_SPRG+20(r3)
113+
stw r6, SS_SPRG+24(r3)
114+
stw r7, SS_SPRG+28(r3)
115+
106116
mfspr r4, SPRN_DBAT0U
107117
mfspr r5, SPRN_DBAT0L
108118
mfspr r6, SPRN_DBAT1U
@@ -493,6 +503,16 @@ mpc83xx_deep_resume:
493503
mtspr SPRN_IBAT7U, r6
494504
mtspr SPRN_IBAT7L, r7
495505

506+
lwz r4, SS_SPRG+16(r3)
507+
lwz r5, SS_SPRG+20(r3)
508+
lwz r6, SS_SPRG+24(r3)
509+
lwz r7, SS_SPRG+28(r3)
510+
511+
mtspr SPRN_SPRG4, r4
512+
mtspr SPRN_SPRG5, r5
513+
mtspr SPRN_SPRG6, r6
514+
mtspr SPRN_SPRG7, r7
515+
496516
lwz r4, SS_SPRG+0(r3)
497517
lwz r5, SS_SPRG+4(r3)
498518
lwz r6, SS_SPRG+8(r3)

0 commit comments

Comments
 (0)