firmware: zynqmp: Handle errors from ipi_req properly

There are multiple errors what can happen in ipi_req but they are not
propagated properly. That's why propage all error properly.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Adrian Fiergolski <Adrian.Fiergolski@fastree3d.com>
Link: https://lore.kernel.org/r/7ac4f3b2104f04c72d287c46d1ccbce20f138fd4.1634309856.git.michal.simek@xilinx.com
This commit is contained in:
Michal Simek 2021-10-15 16:57:38 +02:00
parent eafdcda4a8
commit b05cc389ba

View file

@ -164,6 +164,7 @@ int __maybe_unused xilinx_pm_request(u32 api_id, u32 arg0, u32 arg1, u32 arg2,
* firmware API is limited by the SMC call size
*/
u32 regs[] = {api_id, arg0, arg1, arg2, arg3};
int ret;
if (api_id == PM_FPGA_LOAD) {
/* Swap addr_hi/low because of incompatibility */
@ -173,7 +174,10 @@ int __maybe_unused xilinx_pm_request(u32 api_id, u32 arg0, u32 arg1, u32 arg2,
regs[2] = temp;
}
ipi_req(regs, PAYLOAD_ARG_CNT, ret_payload, PAYLOAD_ARG_CNT);
ret = ipi_req(regs, PAYLOAD_ARG_CNT, ret_payload,
PAYLOAD_ARG_CNT);
if (ret)
return ret;
#else
return -EPERM;
#endif