summaryrefslogtreecommitdiff
path: root/lib/psci/psci_suspend.c
diff options
context:
space:
mode:
authordanh-arm <dan.handley@arm.com>2016-07-26 14:35:07 +0100
committerGitHub <noreply@github.com>2016-07-26 14:35:07 +0100
commit422a40d9c6be03ed3508f0dd17a04227abcb70ce (patch)
tree6e745772276ccde6000ab1058e6abde6304b3e1a /lib/psci/psci_suspend.c
parentfabd0a864a09ab6024db2cac0a4929b443a72640 (diff)
parent61eae524b6e452fd1be931c6e1ff8f7cf3ae969c (diff)
Merge pull request #670 from achingupta/ag/psci_retention_fix
Fix use of stale power states in PSCI standby finisher
Diffstat (limited to 'lib/psci/psci_suspend.c')
-rw-r--r--lib/psci/psci_suspend.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/psci/psci_suspend.c b/lib/psci/psci_suspend.c
index 904a4e75..0887e3b2 100644
--- a/lib/psci/psci_suspend.c
+++ b/lib/psci/psci_suspend.c
@@ -45,17 +45,25 @@
* from standby/retention states at multiple power levels.
******************************************************************************/
static void psci_suspend_to_standby_finisher(unsigned int cpu_idx,
- psci_power_state_t *state_info,
unsigned int end_pwrlvl)
{
+ psci_power_state_t state_info;
+
psci_acquire_pwr_domain_locks(end_pwrlvl,
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
* 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
@@ -222,7 +230,7 @@ exit:
* After we wake up from context retaining suspend, call the
* context retaining suspend finisher.
*/
- psci_suspend_to_standby_finisher(idx, state_info, end_pwrlvl);
+ psci_suspend_to_standby_finisher(idx, end_pwrlvl);
}
/*******************************************************************************