* [PATCH] spl: spl_nor: use panic instead of hang if booting fails
@ 2023-01-30 10:03 Mario Kicherer
2023-06-20 15:17 ` Tom Rini
0 siblings, 1 reply; 2+ messages in thread
From: Mario Kicherer @ 2023-01-30 10:03 UTC (permalink / raw)
To: u-boot; +Cc: Mario Kicherer
On systems without a watchdog, using hang() prevents a system to
recover from an error. For example, a board could implement a boot
counter to switch to an alternative load address after some failed
tries.
Signed-off-by: Mario Kicherer <dev@kicherer.org>
---
common/spl/spl.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/common/spl/spl.c b/common/spl/spl.c
index 2855cdd117..d1aa2fb8a9 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -822,11 +822,10 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
if (ret) {
if (CONFIG_IS_ENABLED(SHOW_ERRORS) &&
CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT))
- printf(SPL_TPL_PROMPT "failed to boot from all boot devices (err=%d)\n",
- ret);
+ panic(SPL_TPL_PROMPT "failed to boot from all boot devices (err=%d)\n",
+ ret);
else
- puts(SPL_TPL_PROMPT "failed to boot from all boot devices\n");
- hang();
+ panic_str(SPL_TPL_PROMPT "failed to boot from all boot devices\n");
}
spl_perform_fixups(&spl_image);
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] spl: spl_nor: use panic instead of hang if booting fails
2023-01-30 10:03 [PATCH] spl: spl_nor: use panic instead of hang if booting fails Mario Kicherer
@ 2023-06-20 15:17 ` Tom Rini
0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2023-06-20 15:17 UTC (permalink / raw)
To: Mario Kicherer; +Cc: u-boot
[-- Attachment #1: Type: text/plain, Size: 1325 bytes --]
On Mon, Jan 30, 2023 at 11:03:03AM +0100, Mario Kicherer wrote:
> On systems without a watchdog, using hang() prevents a system to
> recover from an error. For example, a board could implement a boot
> counter to switch to an alternative load address after some failed
> tries.
>
> Signed-off-by: Mario Kicherer <dev@kicherer.org>
> ---
> common/spl/spl.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/common/spl/spl.c b/common/spl/spl.c
> index 2855cdd117..d1aa2fb8a9 100644
> --- a/common/spl/spl.c
> +++ b/common/spl/spl.c
> @@ -822,11 +822,10 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
> if (ret) {
> if (CONFIG_IS_ENABLED(SHOW_ERRORS) &&
> CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT))
> - printf(SPL_TPL_PROMPT "failed to boot from all boot devices (err=%d)\n",
> - ret);
> + panic(SPL_TPL_PROMPT "failed to boot from all boot devices (err=%d)\n",
> + ret);
> else
> - puts(SPL_TPL_PROMPT "failed to boot from all boot devices\n");
> - hang();
> + panic_str(SPL_TPL_PROMPT "failed to boot from all boot devices\n");
> }
>
> spl_perform_fixups(&spl_image);
Not all platforms that use SPI in SPL have panic() (and related
functions) available, so this introduces a number of fail to builds.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-06-20 15:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-30 10:03 [PATCH] spl: spl_nor: use panic instead of hang if booting fails Mario Kicherer
2023-06-20 15:17 ` Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox