[U-Boot] fpga: zynqmp: show an error message when FPGA programming fails

Message ID 20190111160945.10336-1-luca@lucaceresoli.net
State New
Headers show
Series
  • [U-Boot] fpga: zynqmp: show an error message when FPGA programming fails
Related show

Commit Message

Luca Ceresoli Jan. 11, 2019, 4:09 p.m.
When FPGA programming fails, it does so silently, unless debugging
code is enabled. This makes it hard to detect problems in production
environments.

Print the error message unconditionally so the error doesn't go
unnoticed.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
 drivers/fpga/zynqmppl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michal Simek Jan. 14, 2019, 6:44 a.m. | #1
On 11. 01. 19 17:09, Luca Ceresoli wrote:
> When FPGA programming fails, it does so silently, unless debugging
> code is enabled. This makes it hard to detect problems in production
> environments.
> 
> Print the error message unconditionally so the error doesn't go
> unnoticed.
> 
> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
> ---
>  drivers/fpga/zynqmppl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/fpga/zynqmppl.c b/drivers/fpga/zynqmppl.c
> index c095d5ecaa85..22bfdd8dce61 100644
> --- a/drivers/fpga/zynqmppl.c
> +++ b/drivers/fpga/zynqmppl.c
> @@ -233,7 +233,7 @@ static int zynqmp_load(xilinx_desc *desc, const void *buf, size_t bsize,
>  				 (u32)bsize, 0, ret_payload);
>  
>  	if (ret)
> -		debug("PL FPGA LOAD fail\n");
> +		puts("PL FPGA LOAD fail\n");
>  
>  	return ret;
>  }
> 

Note: Not a problem with this path. It shouldn't be hard to detect it in
production system if your scripts are checking return values.

Applied.

Thanks,
Michal

Patch

diff --git a/drivers/fpga/zynqmppl.c b/drivers/fpga/zynqmppl.c
index c095d5ecaa85..22bfdd8dce61 100644
--- a/drivers/fpga/zynqmppl.c
+++ b/drivers/fpga/zynqmppl.c
@@ -233,7 +233,7 @@  static int zynqmp_load(xilinx_desc *desc, const void *buf, size_t bsize,
 				 (u32)bsize, 0, ret_payload);
 
 	if (ret)
-		debug("PL FPGA LOAD fail\n");
+		puts("PL FPGA LOAD fail\n");
 
 	return ret;
 }