Эх сурвалжийг харах

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>
Lorenzo Pieralisi 10 жил өмнө
parent
commit
2217d7c68e

+ 1 - 0
drivers/firmware/psci.c

@@ -78,6 +78,7 @@ static int psci_to_linux_errno(int errno)
 	case PSCI_RET_NOT_SUPPORTED:
 	case PSCI_RET_NOT_SUPPORTED:
 		return -EOPNOTSUPP;
 		return -EOPNOTSUPP;
 	case PSCI_RET_INVALID_PARAMS:
 	case PSCI_RET_INVALID_PARAMS:
+	case PSCI_RET_INVALID_ADDRESS:
 		return -EINVAL;
 		return -EINVAL;
 	case PSCI_RET_DENIED:
 	case PSCI_RET_DENIED:
 		return -EPERM;
 		return -EPERM;

+ 1 - 0
include/uapi/linux/psci.h

@@ -86,5 +86,6 @@
 #define PSCI_RET_INTERNAL_FAILURE		-6
 #define PSCI_RET_INTERNAL_FAILURE		-6
 #define PSCI_RET_NOT_PRESENT			-7
 #define PSCI_RET_NOT_PRESENT			-7
 #define PSCI_RET_DISABLED			-8
 #define PSCI_RET_DISABLED			-8
+#define PSCI_RET_INVALID_ADDRESS		-9
 
 
 #endif /* _UAPI_LINUX_PSCI_H */
 #endif /* _UAPI_LINUX_PSCI_H */