aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenzo Pieralisi <lorenzo.pieralisi@arm.com>2015-10-23 15:46:50 +0100
committerAlex Shi <alex.shi@linaro.org>2016-01-20 19:27:37 +0800
commiteb7d99ea962fa62f487246462a2777ac918c8895 (patch)
tree9957f9cb64e2ae6f21a167b27bc60494fdad1d81
parent1cf8ca19047f52e142e4eb356d2bca6947d66a83 (diff)
drivers: psci: make PSCI 1.0 functions initialization version dependentv4.1/topic/PSCI
The PSCI specifications [1] and the SMC calling convention mandate that unimplemented functions ids must return NOT_SUPPORTED (0xffffffff) if a function id is called but it is not implemented. Consequently, PSCI 1.0 function ids that require the 1.0 PSCI_FEATURES call to be initialized: CPU_SUSPEND (psci_init_cpu_suspend()) SYSTEM_SUSPEND (psci_init_system_suspend()) call the PSCI_FEATURES function id independently of the detected PSCI firmware version, since, if the PSCI_FEATURES function id is not implemented, it must return NOT_SUPPORTED according to the PSCI specifications, causing the initialization functions to fail as expected. Some existing PSCI implementations (ie Qemu PSCI emulation), do not comply with the SMC calling convention and fail if function ids that are not implemented are called from the OS, causing boot failures. To solve this issue, this patch adds code that checks the PSCI firmware version before calling PSCI 1.0 initialization functions so that the OS makes sure that it is calling 1.0 functions only if the firmware version detected is 1.0 or greater, therefore avoiding PSCI calls that are bound to fail and might cause system boot failures owing to non-compliant PSCI firmware implementations. [1] http://infocenter.arm.com/help/topic/com.arm.doc.den0022c/DEN0022C_Power_State_Coordination_Interface.pdf Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Mark Rutland <mark.rutland@arm.com> Tested-by: Kevin Hilman <khilman@kernel.org> Acked-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Olof Johansson <olof@lixom.net> (cherry picked from commit 79b04beb1e0ac7754e667f0aa47b57a197dc343a) Signed-off-by: Alex Shi <alex.shi@linaro.org>
-rw-r--r--drivers/firmware/psci.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/firmware/psci.c b/drivers/firmware/psci.c
index 2b46b00e002e..ae70d2485ca1 100644
--- a/drivers/firmware/psci.c
+++ b/drivers/firmware/psci.c
@@ -347,9 +347,10 @@ static int __init psci_probe(void)
psci_init_migrate();
- psci_init_cpu_suspend();
-
- psci_init_system_suspend();
+ if (PSCI_VERSION_MAJOR(ver) >= 1) {
+ psci_init_cpu_suspend();
+ psci_init_system_suspend();
+ }
return 0;
}