Skip to content

Commit 307094c

Browse files
committed
LoongArch: Adjust SETUP_SLEEP and SETUP_WAKEUP
SETUP_SLEEP should only save the GPR context, which is symmetric to SETUP_WAKEUP, so move the acpi_saved_sp handling out of SETUP_SLEEP. Move "addi.d sp, sp, PT_SIZE" into SETUP_WAKEUP for the same reason. No functional changes. Signed-off-by: Huacai Chen <[email protected]>
1 parent 5d0cc7e commit 307094c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

arch/loongarch/power/suspend_asm.S

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@
3030
st.d $r29, sp, PT_R29
3131
st.d $r30, sp, PT_R30
3232
st.d $r31, sp, PT_R31
33-
34-
la.pcrel t0, acpi_saved_sp
35-
st.d sp, t0, 0
3633
.endm
3734

3835
.macro SETUP_WAKEUP
@@ -51,6 +48,7 @@
5148
ld.d $r29, sp, PT_R29
5249
ld.d $r30, sp, PT_R30
5350
ld.d $r31, sp, PT_R31
51+
addi.d sp, sp, PT_SIZE
5452
.endm
5553

5654
.text
@@ -59,6 +57,10 @@
5957
/* Sleep/wakeup code for Loongson-3 */
6058
SYM_FUNC_START(loongarch_suspend_enter)
6159
SETUP_SLEEP
60+
61+
la.pcrel t0, acpi_saved_sp
62+
st.d sp, t0, 0
63+
6264
bl __flush_cache_all
6365

6466
/* Pass RA and SP to BIOS */
@@ -82,7 +84,7 @@ SYM_INNER_LABEL(loongarch_wakeup_start, SYM_L_GLOBAL)
8284

8385
la.pcrel t0, acpi_saved_sp
8486
ld.d sp, t0, 0
87+
8588
SETUP_WAKEUP
86-
addi.d sp, sp, PT_SIZE
8789
jr ra
8890
SYM_FUNC_END(loongarch_suspend_enter)

0 commit comments

Comments
 (0)