[U-Boot] [PATCH] bootm: fdt: Use panic() instead of hang() when presented with a bad image

Stephen Warren swarren at wwwdotorg.org
Tue Sep 18 17:11:04 UTC 2018


On 09/18/2018 02:10 AM, Alex Kiernan wrote:
> When the image which bootm is given can't be booted, call panic with
> the error message rather than printf/hang so that we can recover from
> broken images via a bootcount mechanism. If hang on failure is still
> required then CONFIG_PANIC_HANG can still be enabled.

This sounds plausible to me, but I think you'll want to send this patch 
To/Cc someone who owns that file. At least Tom Rini (now CC'd hence 
quoting the entire patch for context).

> Signed-off-by: Alex Kiernan <alex.kiernan at gmail.com>
> ---
> 
>   arch/arm/lib/bootm.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
> index c3c1d2fdfa..a5ed12df74 100644
> --- a/arch/arm/lib/bootm.c
> +++ b/arch/arm/lib/bootm.c
> @@ -230,8 +230,7 @@ static void boot_prep_linux(bootm_headers_t *images)
>   #ifdef CONFIG_OF_LIBFDT
>   		debug("using: FDT\n");
>   		if (image_setup_linux(images)) {
> -			printf("FDT creation failed! hanging...");
> -			hang();
> +			panic("FDT creation failed!\n");
>   		}
>   #endif
>   	} else if (BOOTM_ENABLE_TAGS) {
> @@ -264,8 +263,7 @@ static void boot_prep_linux(bootm_headers_t *images)
>   		setup_board_tags(&params);
>   		setup_end_tag(gd->bd);
>   	} else {
> -		printf("FDT and ATAGS support not compiled in - hanging\n");
> -		hang();
> +		panic("FDT and ATAGS support not compiled in\n");
>   	}
>   }


More information about the U-Boot mailing list