From 31244d74b350d49cfba6ad46d90dad2d5f2f364c Mon Sep 17 00:00:00 2001 From: Soby Mathew Date: Tue, 30 Sep 2014 11:19:51 +0100 Subject: Save 'power_state' early in PSCI CPU_SUSPEND call This patch adds support to save the "power state" parameter before the affinity level specific handlers are called in a CPU_SUSPEND call. This avoids the need to pass the power_state as a parameter to the handlers and Secure Payload Dispatcher (SPD) suspend spd_pm_ops. The power_state arguments in the spd_pm_ops operations are now reserved and must not be used. The SPD can query the relevant power_state fields by using the psci_get_suspend_afflvl() & psci_get_suspend_stateid() APIs. NOTE: THIS PATCH WILL BREAK THE SPD_PM_OPS INTERFACE. HENCE THE SECURE PAYLOAD DISPATCHERS WILL NEED TO BE REWORKED TO USE THE NEW INTERFACE. Change-Id: I1293d7dc8cf29cfa6a086a009eee41bcbf2f238e --- services/std_svc/psci/psci_main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'services/std_svc/psci/psci_main.c') diff --git a/services/std_svc/psci/psci_main.c b/services/std_svc/psci/psci_main.c index 7fce5faf..506f5920 100644 --- a/services/std_svc/psci/psci_main.c +++ b/services/std_svc/psci/psci_main.c @@ -125,18 +125,23 @@ int psci_cpu_suspend(unsigned int power_state, if (rc != PSCI_E_SUCCESS) return rc; + /* Save PSCI power state parameter for the core in suspend context */ + psci_set_suspend_power_state(power_state); + /* * Do what is needed to enter the power down state. Upon success, * enter the final wfi which will power down this cpu else return * an error. */ rc = psci_afflvl_suspend(&ep, - power_state, MPIDR_AFFLVL0, target_afflvl); if (rc == PSCI_E_SUCCESS) psci_power_down_wfi(); assert(rc == PSCI_E_INVALID_PARAMS); + + /* Reset PSCI power state parameter for the core. */ + psci_set_suspend_power_state(PSCI_INVALID_DATA); return rc; } -- cgit