1 From 36da5ff0bea2dc67298150ead8d8471575c54c7d Mon Sep 17 00:00:00 2001
2 From: Christophe Leroy <christophe.leroy@c-s.fr>
3 Date: Fri, 25 Jan 2019 12:03:55 +0000
4 Subject: powerpc/83xx: Also save/restore SPRG4-7 during suspend
6 From: Christophe Leroy <christophe.leroy@c-s.fr>
8 commit 36da5ff0bea2dc67298150ead8d8471575c54c7d upstream.
10 The 83xx has 8 SPRG registers and uses at least SPRG4
11 for DTLB handling LRU.
13 Fixes: 2319f1239592 ("powerpc/mm: e300c2/c3/c4 TLB errata workaround")
14 Cc: stable@vger.kernel.org
15 Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
16 Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
17 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 arch/powerpc/platforms/83xx/suspend-asm.S | 34 +++++++++++++++++++++++-------
21 1 file changed, 27 insertions(+), 7 deletions(-)
23 --- a/arch/powerpc/platforms/83xx/suspend-asm.S
24 +++ b/arch/powerpc/platforms/83xx/suspend-asm.S
29 -#define SS_SPRG 0x80 /* 4 SPRGs */
30 -#define SS_DBAT 0x90 /* 8 DBATs */
31 -#define SS_IBAT 0xd0 /* 8 IBATs */
34 -#define SS_GPREG 0x11c /* r12-r31 */
35 -#define STATE_SAVE_SIZE 0x16c
36 +#define SS_SPRG 0x80 /* 8 SPRGs */
37 +#define SS_DBAT 0xa0 /* 8 DBATs */
38 +#define SS_IBAT 0xe0 /* 8 IBATs */
41 +#define SS_GPREG 0x12c /* r12-r31 */
42 +#define STATE_SAVE_SIZE 0x17c
46 @@ -103,6 +103,16 @@ _GLOBAL(mpc83xx_enter_deep_sleep)
47 stw r7, SS_SPRG+12(r3)
50 + mfspr r4, SPRN_SPRG4
51 + mfspr r5, SPRN_SPRG5
52 + mfspr r6, SPRN_SPRG6
53 + mfspr r7, SPRN_SPRG7
55 + stw r4, SS_SPRG+16(r3)
56 + stw r5, SS_SPRG+20(r3)
57 + stw r6, SS_SPRG+24(r3)
58 + stw r7, SS_SPRG+28(r3)
63 @@ -493,6 +503,16 @@ mpc83xx_deep_resume:
67 + lwz r4, SS_SPRG+16(r3)
68 + lwz r5, SS_SPRG+20(r3)
69 + lwz r6, SS_SPRG+24(r3)
70 + lwz r7, SS_SPRG+28(r3)
72 + mtspr SPRN_SPRG4, r4
73 + mtspr SPRN_SPRG5, r5
74 + mtspr SPRN_SPRG6, r6
75 + mtspr SPRN_SPRG7, r7