Skip to content

Commit b82d6cd

Browse files
ti-scariaDhruvaG2000
authored andcommitted
PENDING: fix(psci): prepare SCR state and barriers around WFI
Executing WFI at EL3 without explicitly configuring scr_el3 leads to unstable behaviour and systems hangs on entering the low power mode. Save and update scr_el3 with required bits for routing of interrupts and restoring original scr_el3 value on resume to ensure correct entry and exit from WFI. Signed-off-by: Scaria Kochidanadu <s-kochidanadu@ti.com>
1 parent 043c8c1 commit b82d6cd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/psci/psci_suspend.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,14 @@ int psci_cpu_suspend_start(unsigned int idx,
255255
* requested at multiple power levels. This means that the cpu
256256
* context will be preserved.
257257
*/
258+
259+
u_register_t scr;
260+
scr = read_scr_el3();
261+
write_scr_el3(scr | SCR_IRQ_BIT | SCR_FIQ_BIT);
262+
isb();
263+
dsb();
258264
wfi();
265+
write_scr_el3(scr);
259266

260267
#if ENABLE_RUNTIME_INSTRUMENTATION
261268
PMF_CAPTURE_TIMESTAMP(rt_instr_svc,

0 commit comments

Comments
 (0)