lkml.org 
[lkml]   [2017]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] panic: add support to update panic_timeout via DT
Date
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 | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/kernel/panic.c b/kernel/panic.c
index bdd18af..2541b96 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,6 +483,12 @@ static u64 oops_id;

static int init_oops_id(void)
{
+ struct device_node *np;
+
+ np = of_find_node_by_name(NULL, "panic_timeout");
+ if (np)
+ of_property_read_u32(np, "panic-timeout-value", &panic_timeout);
+
if (!oops_id)
get_random_bytes(&oops_id, sizeof(oops_id));
else
--
2.1.4
\
 
 \ /
  Last update: 2017-10-28 20:15    [W:0.036 / U:22.540 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site