Browse Source

fix(fvp): update system suspend in OS-initiated mode

This patch fixes system suspend in OS-initiated mode by setting the
value of `last_at_pwrlvl` in the `psci_power_state_t` object to
`PLAT_MAX_PWR_LVL`, which otherwise would result in undefined behavior.

This is conditionally compiled into the build depending on the value of
the `PSCI_OS_INIT_MODE` build option.

Change-Id: Ia0fb1e68af9320370325642b17c4569e9580aa3a
Signed-off-by: Wing Li <wingers@google.com>
pull/1999/head
Wing Li 1 year ago
parent
commit
e0ef05bb2c
  1. 4
      plat/arm/board/fvp/fvp_pm.c

4
plat/arm/board/fvp/fvp_pm.c

@ -393,6 +393,10 @@ static void fvp_get_sys_suspend_power_state(psci_power_state_t *req_state)
for (i = ARM_PWR_LVL0; i <= PLAT_MAX_PWR_LVL; i++) for (i = ARM_PWR_LVL0; i <= PLAT_MAX_PWR_LVL; i++)
req_state->pwr_domain_state[i] = ARM_LOCAL_STATE_OFF; req_state->pwr_domain_state[i] = ARM_LOCAL_STATE_OFF;
#if PSCI_OS_INIT_MODE
req_state->last_at_pwrlvl = PLAT_MAX_PWR_LVL;
#endif
} }
#endif #endif

Loading…
Cancel
Save