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

Adrian Fiergolski adrian.fiergolski at fastree3d.com
Mon Oct 18 11:33:41 CEST 2021


On 15.10.2021 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>

Reviewed-by: Adrian Fiergolski <Adrian.Fiergolski at fastree3d.com>

Thanks,

Adrian

> ---
>
>  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


More information about the U-Boot mailing list