[PATCH 1/2] firmware: zynqmp: Handle errors from ipi_req properly

Michal Simek monstr at monstr.eu
Thu Oct 21 08:55:04 CEST 2021



On 10/15/21 16:57, Michal Simek wrote:
> 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 at xilinx.com>
> ---
> 
>   drivers/firmware/firmware-zynqmp.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/firmware/firmware-zynqmp.c b/drivers/firmware/firmware-zynqmp.c
> index c22bdca282fc..1391aab0a160 100644
> --- a/drivers/firmware/firmware-zynqmp.c
> +++ b/drivers/firmware/firmware-zynqmp.c
> @@ -165,6 +165,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 */
> @@ -174,7 +175,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
> 

Applied.
M

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs



More information about the U-Boot mailing list