All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2] panic: add support to update panic_timeout via DT
@ 2017-10-27  9:39 Jeetesh Burman
  2017-10-27  9:53 ` Sergey Senozhatsky
  0 siblings, 1 reply; 6+ messages in thread
From: Jeetesh Burman @ 2017-10-27  9:39 UTC (permalink / raw)
  To: sergey.senozhatsky, keescook; +Cc: linux-kernel, bbasu, Jeetesh Burman

Add support to set 'panic_timeout' value via dtb to have
control from device tree. This makes sense when you have
multiple platforms support from same defconfig and
differentiated only through device tree blob.
The patch will check for panic time out value coming
from dtb if it exists, otherwise continues with
defconfig provided option.

Signed-off-by: Jeetesh Burman <jburman@nvidia.com>
---
 kernel/panic.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/kernel/panic.c b/kernel/panic.c
index bdd18af..b487331 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -27,6 +27,7 @@
 #include <linux/console.h>
 #include <linux/bug.h>
 #include <linux/ratelimit.h>
+#include <linux/of.h>
 
 #define PANIC_TIMER_STEP 100
 #define PANIC_BLINK_SPD 18
@@ -482,9 +483,15 @@ static u64 oops_id;
 
 static int init_oops_id(void)
 {
-	if (!oops_id)
+	struct device_node *np;
+
+	if (!oops_id) {
+		np = of_find_node_by_name(NULL, "panic_timeout");
+		if (np)
+			of_property_read_u32(np, "panic-timeout-value",
+							&panic_timeout);
 		get_random_bytes(&oops_id, sizeof(oops_id));
-	else
+	} else
 		oops_id++;
 
 	return 0;
-- 
2.1.4

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

end of thread, other threads:[~2017-10-27 12:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-27  9:39 [PATCH V2] panic: add support to update panic_timeout via DT Jeetesh Burman
2017-10-27  9:53 ` Sergey Senozhatsky
     [not found]   ` <20171027095314.GA724-doRD9GlggSwB9AHHLWeGtNQXobZC6xk2@public.gmane.org>
2017-10-27 12:00     ` Lorenzo Pieralisi
2017-10-27 12:00       ` Lorenzo Pieralisi
2017-10-27 10:37       ` Mark Rutland
2017-10-27 10:37         ` Mark Rutland

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.