summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2019-10-10 11:09:15 +0200
committerMichal Simek <michal.simek@xilinx.com>2019-10-24 13:37:01 +0200
commit9bed8a63f762d91bd4392f93ea90a702e9653c70 (patch)
tree3937ca8b086325aacc060772b74d7bcbd1126a6d /drivers
parent403619515e81bde2d0f1a76ca472fbf8b88572e8 (diff)
firmware: zynqmp: Report error when xilinx_pm_request called from EL3
Function should report error when called in EL3 context. Also report it as error instead 0 (success). Reported-by: Luca Ceresoli <luca@lucaceresoli.net> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/firmware/firmware-zynqmp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/firmware/firmware-zynqmp.c b/drivers/firmware/firmware-zynqmp.c
index adcef15e22..4911734f6c 100644
--- a/drivers/firmware/firmware-zynqmp.c
+++ b/drivers/firmware/firmware-zynqmp.c
@@ -156,8 +156,10 @@ int __maybe_unused xilinx_pm_request(u32 api_id, u32 arg0, u32 arg1, u32 arg2,
*/
struct pt_regs regs;
- if (current_el() == 3)
- return 0;
+ if (current_el() == 3) {
+ printf("%s: Can't call SMC from EL3 context\n", __func__);
+ return -EPERM;
+ }
regs.regs[0] = PM_SIP_SVC | api_id;
regs.regs[1] = ((u64)arg1 << 32) | arg0;