aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/firmware
diff options
context:
space:
mode:
authorAlexey Romanov <avromanov@salutedevices.com>2023-08-30 17:08:50 +0300
committerNeil Armstrong <neil.armstrong@linaro.org>2023-09-11 11:45:26 +0200
commit0d423c4a78984dd02f6596d6fd9dd40446eec517 (patch)
tree31c09dc2b3b7c4936fb9a65425ce831b3b79e79c /include/linux/firmware
parentLinux 6.6-rc1 (diff)
downloadwireguard-linux-0d423c4a78984dd02f6596d6fd9dd40446eec517.tar.xz
wireguard-linux-0d423c4a78984dd02f6596d6fd9dd40446eec517.zip
drivers: meson: sm: correct meson_sm_* API retval handling
1. Following the ARM SMC32 calling convention, the return value from secure monitor is a 32-bit signed integer. This patch changes the type of the return value of the function meson_sm_call(). 2. Now, when meson_sm_call() returns a 32-bit signed integer, we need to ensure that this value is not negative. It is important to check that the return value is not negative in both the meson_sm_call_read() and meson_sm_call_write() functions. 3. Add a comment explaining why it is necessary to check if the SMC return value is equal to 0 in the function meson_sm_call_read(). It is not obvious when reading this code. Signed-off-by: Alexey Romanov <avromanov@salutedevices.com> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://lore.kernel.org/r/20230830140850.17130-1-avromanov@salutedevices.com Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Diffstat (limited to 'include/linux/firmware')
-rw-r--r--include/linux/firmware/meson/meson_sm.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/firmware/meson/meson_sm.h b/include/linux/firmware/meson/meson_sm.h
index 95b0da2326a9..8eaf8922ab02 100644
--- a/include/linux/firmware/meson/meson_sm.h
+++ b/include/linux/firmware/meson/meson_sm.h
@@ -19,7 +19,7 @@ enum {
struct meson_sm_firmware;
int meson_sm_call(struct meson_sm_firmware *fw, unsigned int cmd_index,
- u32 *ret, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 arg4);
+ s32 *ret, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 arg4);
int meson_sm_call_write(struct meson_sm_firmware *fw, void *buffer,
unsigned int b_size, unsigned int cmd_index, u32 arg0,
u32 arg1, u32 arg2, u32 arg3, u32 arg4);