summaryrefslogtreecommitdiffstats
path: root/drivers/firmware
diff options
context:
space:
mode:
authorSudeep Holla <sudeep.holla@arm.com>2020-04-17 12:32:32 +0200
committerSudeep Holla <sudeep.holla@arm.com>2020-04-20 18:57:34 +0200
commitf7199cf489027ae38a9a82312d13025f7aefa0b8 (patch)
tree339c0562d1254506b687b1899686bc43e9372668 /drivers/firmware
parentfirmware: arm_scmi: Fix handling of unexpected delayed responses (diff)
downloadlinux-f7199cf489027ae38a9a82312d13025f7aefa0b8.tar.xz
linux-f7199cf489027ae38a9a82312d13025f7aefa0b8.zip
firmware: arm_scmi: Fix return error code in smc_send_message
SMCCC can return NOT_SUPPORTED(-1). Map it to appropriate Linux error codes namely -EOPNOTSUPP. Link: https://lore.kernel.org/r/20200417103232.6896-1-sudeep.holla@arm.com Reported-and-Tested-by:: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/arm_scmi/smc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/firmware/arm_scmi/smc.c b/drivers/firmware/arm_scmi/smc.c
index 833e793b5391..49bc4b0e8428 100644
--- a/drivers/firmware/arm_scmi/smc.c
+++ b/drivers/firmware/arm_scmi/smc.c
@@ -114,7 +114,10 @@ static int smc_send_message(struct scmi_chan_info *cinfo,
mutex_unlock(&scmi_info->shmem_lock);
- return res.a0;
+ /* Only SMCCC_RET_NOT_SUPPORTED is valid error code */
+ if (res.a0)
+ return -EOPNOTSUPP;
+ return 0;
}
static void smc_fetch_response(struct scmi_chan_info *cinfo,