Skip to contentSkip to conversation

resurrect CONFIG_PANIC_HANG option

PATCH Applied Antony Pavlov 2 participants 4 messages Aug 4, 2013 – Aug 5, 2013

Subsystems (2)
lore
Share & tools
lore
#1 lore raw

PATCH 1/2 resurrect CONFIG_PANIC_HANG option

The CONFIG_PANIC_HANG a part of the U-Boot heritage. It is used in the barebox code, but there is no mention of this option in Kconfig files.

Sometimes this option is very helpful, so
let's resurrect it.

---
 common/Kconfig | 11 +++++++++++
 1 file changed, 11 insertions(+)
common/Kconfig +11 -0
index 88bc677..6322d9d 100644
@@ -256,6 +256,17 @@ config RELOCATABLE
 	  allowing it to relocate to the end of the available RAM. This
 	  way you have the whole memory in a single piece.
 
+config PANIC_HANG
+	bool "hang the system in case of a fatal error"
+	help
+	  This option enables stop of the system in case of a
+	  fatal error, so that you have to reset it manually.
+	  This is probably NOT a good idea for an embedded
+	  system where you want the system to reboot
+	  automatically as fast as possible, but it may be
+	  useful during development since you can try to debug
+	  the conditions that lead to the situation.
+
 config PROMPT
 	string
 	prompt "barebox command prompt"
Signature · 7 lines
1.8.3.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

PATCH 2/2 CONFIG_PANIC_HANG: replace #ifdef with IS_ENABLED()

In reply to Antony Pavlov
---
 lib/vsprintf.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
lib/vsprintf.c +6 -6
index d931340..c73db73 100644
@@ -630,11 +630,11 @@ void __noreturn panic(const char *fmt, ...)
 
 	led_trigger(LED_TRIGGER_PANIC, TRIGGER_ENABLE);
 
-#if defined (CONFIG_PANIC_HANG)
-	hang();
-#else
-	udelay(100000);	/* allow messages to go out */
-	reset_cpu(0);
-#endif
+	if (IS_ENABLED(CONFIG_PANIC_HANG)) {
+		hang();
+	} else {
+		udelay(100000);	/* allow messages to go out */
+		reset_cpu(0);
+	}
 }
 EXPORT_SYMBOL(panic);
Signature · 7 lines
1.8.3.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#3 lore raw
In reply to Antony Pavlov
Quoted 2 lines · Antony Pavlov

[PATCH 1/2] resurrect CONFIG_PANIC_HANG option
[PATCH 2/2] CONFIG_PANIC_HANG: replace #ifdef with IS_ENABLED()

Applied, thanks

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox