panic: add support to update panic_timeout via DT
PATCH v2 1/1 panic: add support to update panic_timeout via DT
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.
--- kernel/panic.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
kernel/panic.c +9 -2
@@ -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 ;
Signature · 1 line
2.1.4
Cc-ing Andrew on this
v1: lkml.kernel.org/r/[email protected]
lkml.kernel.org/r/[email protected]
v2: lkml.kernel.org/r/[email protected]
-ss
Quoted 46 lines · 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 <[email protected]>--- kernel/panic.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)kernel/panic.c +9
-2@@ -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 ;Signature · 1 line
2.1.4
[+devicetree, Rob, Frank]
Quoted 18 lines · Sergey Senozhatsky
Cc-ing Andrew on this
v1: lkml.kernel.org/r/1509076662-22253-1-git-send-email-jburman-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org
lkml.kernel.org/r/20171027080006.GA609-doRD9GlggSwB9AHHLWeGtNQXobZC6xk2@public.gmane.orgv2: lkml.kernel.org/r/1509097165-15695-1-git-send-email-jburman-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org
-ssQuoted 7 lines · 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.
I will let Rob and Frank chime in - as far as I am concerned you are (ab)using DT to configure a Linux kernel specific internal variable and that's certainly not what DT is there for.
Lorenzo
Quoted 34 lines
Quoted 34 lines
Signed-off-by Jeetesh Burman <[email protected]>--- kernel/panic.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)kernel/panic.c +9
-2@@ -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++;
Quoted 4 lines
Quoted 4 lines
kernel/panic.c +0
-0return 0 ;Signature · 1 line
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 22 lines · Lorenzo Pieralisi
[+devicetree, Rob, Frank]
Quoted 18 lines · Sergey Senozhatsky
Cc-ing Andrew on this
v1: lkml.kernel.org/r/1509076662-22253-1-git-send-email-jburman-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org
lkml.kernel.org/r/20171027080006.GA609-doRD9GlggSwB9AHHLWeGtNQXobZC6xk2@public.gmane.orgv2: lkml.kernel.org/r/1509097165-15695-1-git-send-email-jburman-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org
-ssQuoted 7 lines · 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.
Quoted 3 lines
I will let Rob and Frank chime in - as far as I am concerned you are (ab)using DT to configure a Linux kernel specific internal variable and that's certainly not what DT is there for.
Indeed. NAK to this patch.
Regardless, this can easily be configured in /chosen/bootargs (i.e. the kernel command line) today.
Thanks,
Mark.
Quoted 37 lines
Lorenzo
Quoted 34 lines
Quoted 34 lines
Signed-off-by Jeetesh Burman <[email protected]>--- kernel/panic.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)kernel/panic.c +9
-2@@ -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++;
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
kernel/panic.c +0
-0return 0 ;Signature · 1 line
2.1.4--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html