Skip to contentSkip to conversation

Setup panic params early

PATCH In review Felipe Contreras 2 participants 5 messages Nov 27, 2013

lore
Share & tools
lore
#0 lore raw

v4 cover Setup panic params early

Exactly the same as v3, but with an unlrelated patch on top as well.

Felipe Contreras (2):
panic: setup panic_timeout early
panic: setup panic_on_oops early

 kernel/panic.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
Signature · 1 line
1.8.4.2+fc1
#1 lore raw

PATCH v4 1/2 panic: setup panic_timeout early

Otherwise we might not reboot when the user needs it the most (early on).

---
 kernel/panic.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
kernel/panic.c +6 -1
index b6c482c..3456652 100644
@@ -468,9 +468,14 @@ EXPORT_SYMBOL(__stack_chk_fail);
 
 #endif
 
-core_param(panic, panic_timeout, int, 0644);
 core_param(pause_on_oops, pause_on_oops, int, 0644);
 
+static int __init set_panic_timeout(char *val)
+{
+	return kstrtoint(val, 0, &panic_timeout);
+}
+early_param("panic_timeout", set_panic_timeout);
+
 static int __init oops_setup(char *s)
 {
 	if (!s)
Signature · 1 line
1.8.4.2+fc1
#2 lore raw

Re: [PATCH v4 1/2] panic: setup panic_timeout early

Quoted 18 lines · Felipe Contreras

Otherwise we might not reboot when the user needs it the most (early on).

---
 kernel/panic.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
kernel/panic.c +0 -1
index b6c482c..3456652 100644
@@ -468,9 +468,14 @@ EXPORT_SYMBOL(__stack_chk_fail);
 
 #endif
 
-core_param(panic, panic_timeout, int, 0644);
 core_param(pause_on_oops, pause_on_oops, int, 0644);

kernel/panic.c EXPORT_SYMBOL(__stack_chk_fail); · line 481

Quoted 10 lines
kernel/panic.c +6 -0
 
+static int __init set_panic_timeout(char *val)
+{
+	return kstrtoint(val, 0, &panic_timeout);
+}
+early_param("panic_timeout", set_panic_timeout);
+
 static int __init oops_setup(char *s)
 {
 	if (!s)

hmm....so this changes the comand-line parameter panic=x to:
panic_timeout=x. The naming might not be the best, but we are really stuck with it at this point.

Thanks,

-Jason

#3 lore raw

Re: [PATCH v4 1/2] panic: setup panic_timeout early

Quoted 20 lines · Jason Baron
Quoted 19 lines · Felipe Contreras

Otherwise we might not reboot when the user needs it the most (early on).

---
 kernel/panic.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
kernel/panic.c +0 -1
index b6c482c..3456652 100644
@@ -468,9 +468,14 @@ EXPORT_SYMBOL(__stack_chk_fail);
 
 #endif
 
-core_param(panic, panic_timeout, int, 0644);
 core_param(pause_on_oops, pause_on_oops, int, 0644);
 
Quoted 13 lines

kernel/panic.c EXPORT_SYMBOL(__stack_chk_fail); · line 481

Quoted 9 lines
kernel/panic.c +6 -0
+static int __init set_panic_timeout(char *val)
+{
+     return kstrtoint(val, 0, &panic_timeout);
+}
+early_param("panic_timeout", set_panic_timeout);
+
 static int __init oops_setup(char *s)
 {
      if (!s)

hmm....so this changes the comand-line parameter panic=x to:
panic_timeout=x. The naming might not be the best, but we are really stuck with it at this point.

Hmm, right, it should be "panic".

Signature · 1 line
Felipe Contreras
#4 lore raw

PATCH v4 2/2 panic: setup panic_on_oops early

In reply to Felipe Contreras

For consistency.

---
 kernel/panic.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
kernel/panic.c +5 -1
index 3456652..2256838 100644
@@ -468,7 +468,11 @@ EXPORT_SYMBOL(__stack_chk_fail);
 
 #endif
 
-core_param(pause_on_oops, pause_on_oops, int, 0644);
+static int __init set_panic_on_oops(char *val)
+{
+	return kstrtoint(val, 0, &panic_on_oops);
+}
+early_param("panic_on_oops", set_panic_on_oops);
 
 static int __init set_panic_timeout(char *val)
 {
Signature · 1 line
1.8.4.2+fc1