aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLorenzo Pieralisi <lorenzo.pieralisi@arm.com>2015-05-22 09:31:37 -0400
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>2015-10-02 09:35:16 -0400
commit2217d7c68e5caf50ec86b8c75c76bf06eb4b2c45 (patch)
tree1d703d51aa48d6e1057ff52d84c2500ef7639987
parent9ffecb10283508260936b96022d4ee43a7798b4c (diff)
drivers: firmware: psci: add INVALID_ADDRESS return value
PSCI 1.0 introduces the INVALID_ADDRESS return value for functions that take an address as input parameter (eg CPU_SUSPEND). This patch adds INVALID_ADDRESS return value to kernel code and updates the PSCI to linux error conversion to take it into account. The kernel error value associated to INVALID_ADDRESS is set to the error returned when the PSCI error code is INVALID_PARAMETERS to comply with current call sites expected return value, given that the kernel at present has no use for the additional error information reported. Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Acked-by: Sudeep Holla <sudeep.holla@arm.com> Acked-by: Mark Rutland <mark.rutland@arm.com> Tested-by: Jisheng Zhang <jszhang@marvell.com>
-rw-r--r--drivers/firmware/psci.c1
-rw-r--r--include/uapi/linux/psci.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/drivers/firmware/psci.c b/drivers/firmware/psci.c
index 42700f09a8c5..0821e332c85a 100644
--- a/drivers/firmware/psci.c
+++ b/drivers/firmware/psci.c
@@ -78,6 +78,7 @@ static int psci_to_linux_errno(int errno)
78 case PSCI_RET_NOT_SUPPORTED: 78 case PSCI_RET_NOT_SUPPORTED:
79 return -EOPNOTSUPP; 79 return -EOPNOTSUPP;
80 case PSCI_RET_INVALID_PARAMS: 80 case PSCI_RET_INVALID_PARAMS:
81 case PSCI_RET_INVALID_ADDRESS:
81 return -EINVAL; 82 return -EINVAL;
82 case PSCI_RET_DENIED: 83 case PSCI_RET_DENIED:
83 return -EPERM; 84 return -EPERM;
diff --git a/include/uapi/linux/psci.h b/include/uapi/linux/psci.h
index 310d83e0a91b..64469e64688f 100644
--- a/include/uapi/linux/psci.h
+++ b/include/uapi/linux/psci.h
@@ -86,5 +86,6 @@
86#define PSCI_RET_INTERNAL_FAILURE -6 86#define PSCI_RET_INTERNAL_FAILURE -6
87#define PSCI_RET_NOT_PRESENT -7 87#define PSCI_RET_NOT_PRESENT -7
88#define PSCI_RET_DISABLED -8 88#define PSCI_RET_DISABLED -8
89#define PSCI_RET_INVALID_ADDRESS -9
89 90
90#endif /* _UAPI_LINUX_PSCI_H */ 91#endif /* _UAPI_LINUX_PSCI_H */