Commit 422a40d9 authored by danh-arm's avatar danh-arm Committed by GitHub
Browse files

Merge pull request #670 from achingupta/ag/psci_retention_fix

Fix use of stale power states in PSCI standby finisher
parents fabd0a86 61eae524
...@@ -252,7 +252,7 @@ static plat_local_state_t *psci_get_req_local_pwr_states(unsigned int pwrlvl, ...@@ -252,7 +252,7 @@ static plat_local_state_t *psci_get_req_local_pwr_states(unsigned int pwrlvl,
* function will be called after a cpu is powered on to find the local state * function will be called after a cpu is powered on to find the local state
* each power domain has emerged from. * each power domain has emerged from.
*****************************************************************************/ *****************************************************************************/
static void psci_get_target_local_pwr_states(unsigned int end_pwrlvl, void psci_get_target_local_pwr_states(unsigned int end_pwrlvl,
psci_power_state_t *target_state) psci_power_state_t *target_state)
{ {
unsigned int parent_idx, lvl; unsigned int parent_idx, lvl;
......
...@@ -192,6 +192,8 @@ int psci_validate_power_state(unsigned int power_state, ...@@ -192,6 +192,8 @@ int psci_validate_power_state(unsigned int power_state,
void psci_query_sys_suspend_pwrstate(psci_power_state_t *state_info); void psci_query_sys_suspend_pwrstate(psci_power_state_t *state_info);
int psci_validate_mpidr(u_register_t mpidr); int psci_validate_mpidr(u_register_t mpidr);
void psci_init_req_local_pwr_states(void); void psci_init_req_local_pwr_states(void);
void psci_get_target_local_pwr_states(unsigned int end_pwrlvl,
psci_power_state_t *target_state);
int psci_validate_entry_point(entry_point_info_t *ep, int psci_validate_entry_point(entry_point_info_t *ep,
uintptr_t entrypoint, u_register_t context_id); uintptr_t entrypoint, u_register_t context_id);
void psci_get_parent_pwr_domain_nodes(unsigned int cpu_idx, void psci_get_parent_pwr_domain_nodes(unsigned int cpu_idx,
......
...@@ -45,17 +45,25 @@ ...@@ -45,17 +45,25 @@
* from standby/retention states at multiple power levels. * from standby/retention states at multiple power levels.
******************************************************************************/ ******************************************************************************/
static void psci_suspend_to_standby_finisher(unsigned int cpu_idx, static void psci_suspend_to_standby_finisher(unsigned int cpu_idx,
psci_power_state_t *state_info,
unsigned int end_pwrlvl) unsigned int end_pwrlvl)
{ {
psci_power_state_t state_info;
psci_acquire_pwr_domain_locks(end_pwrlvl, psci_acquire_pwr_domain_locks(end_pwrlvl,
cpu_idx); cpu_idx);
/*
* Find out which retention states this CPU has exited from until the
* 'end_pwrlvl'. The exit retention state could be deeper than the entry
* state as a result of state coordination amongst other CPUs post wfi.
*/
psci_get_target_local_pwr_states(end_pwrlvl, &state_info);
/* /*
* Plat. management: Allow the platform to do operations * Plat. management: Allow the platform to do operations
* on waking up from retention. * on waking up from retention.
*/ */
psci_plat_pm_ops->pwr_domain_suspend_finish(state_info); psci_plat_pm_ops->pwr_domain_suspend_finish(&state_info);
/* /*
* Set the requested and target state of this CPU and all the higher * Set the requested and target state of this CPU and all the higher
...@@ -222,7 +230,7 @@ exit: ...@@ -222,7 +230,7 @@ exit:
* After we wake up from context retaining suspend, call the * After we wake up from context retaining suspend, call the
* context retaining suspend finisher. * context retaining suspend finisher.
*/ */
psci_suspend_to_standby_finisher(idx, state_info, end_pwrlvl); psci_suspend_to_standby_finisher(idx, end_pwrlvl);
} }
/******************************************************************************* /*******************************************************************************
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment