mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 0/2] resurrect CONFIG_PANIC_HANG option
@ 2013-08-04  8:46 Antony Pavlov
  2013-08-04  8:46 ` [PATCH 1/2] " Antony Pavlov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Antony Pavlov @ 2013-08-04  8:46 UTC (permalink / raw)
  To: barebox

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

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] resurrect CONFIG_PANIC_HANG option
  2013-08-04  8:46 [PATCH 0/2] resurrect CONFIG_PANIC_HANG option Antony Pavlov
@ 2013-08-04  8:46 ` Antony Pavlov
  2013-08-04  8:46 ` [PATCH 2/2] CONFIG_PANIC_HANG: replace #ifdef with IS_ENABLED() Antony Pavlov
  2013-08-05 10:14 ` [PATCH 0/2] resurrect CONFIG_PANIC_HANG option Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: Antony Pavlov @ 2013-08-04  8:46 UTC (permalink / raw)
  To: barebox

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.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 common/Kconfig | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/common/Kconfig b/common/Kconfig
index 88bc677..6322d9d 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -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"
-- 
1.8.3.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] CONFIG_PANIC_HANG: replace #ifdef with IS_ENABLED()
  2013-08-04  8:46 [PATCH 0/2] resurrect CONFIG_PANIC_HANG option Antony Pavlov
  2013-08-04  8:46 ` [PATCH 1/2] " Antony Pavlov
@ 2013-08-04  8:46 ` Antony Pavlov
  2013-08-05 10:14 ` [PATCH 0/2] resurrect CONFIG_PANIC_HANG option Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: Antony Pavlov @ 2013-08-04  8:46 UTC (permalink / raw)
  To: barebox

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 lib/vsprintf.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index d931340..c73db73 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -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);
-- 
1.8.3.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] resurrect CONFIG_PANIC_HANG option
  2013-08-04  8:46 [PATCH 0/2] resurrect CONFIG_PANIC_HANG option Antony Pavlov
  2013-08-04  8:46 ` [PATCH 1/2] " Antony Pavlov
  2013-08-04  8:46 ` [PATCH 2/2] CONFIG_PANIC_HANG: replace #ifdef with IS_ENABLED() Antony Pavlov
@ 2013-08-05 10:14 ` Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2013-08-05 10:14 UTC (permalink / raw)
  To: Antony Pavlov; +Cc: barebox

On Sun, Aug 04, 2013 at 12:46:00PM +0400, Antony Pavlov wrote:
> [PATCH 1/2] resurrect CONFIG_PANIC_HANG option
> [PATCH 2/2] CONFIG_PANIC_HANG: replace #ifdef with IS_ENABLED()

Applied, thanks

Sascha


-- 
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-08-05 10:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-04  8:46 [PATCH 0/2] resurrect CONFIG_PANIC_HANG option Antony Pavlov
2013-08-04  8:46 ` [PATCH 1/2] " Antony Pavlov
2013-08-04  8:46 ` [PATCH 2/2] CONFIG_PANIC_HANG: replace #ifdef with IS_ENABLED() Antony Pavlov
2013-08-05 10:14 ` [PATCH 0/2] resurrect CONFIG_PANIC_HANG option Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox