From 5049ddba25d13161f14d409dd9829e1accf55d15 Mon Sep 17 00:00:00 2001 From: Shubham Gaur Date: Fri, 30 Aug 2024 11:27:39 +0530 Subject: [PATCH 1/2] reboot.c : changed reboot_default Made two changes: 1. ARM64 now defaults to hard reboot on kernel panic. 2. reboot_default` flag is now a boolean for better clarity. --- kernel/reboot.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kernel/reboot.c b/kernel/reboot.c index f05dbde2c93f..e5c1bdd33e03 100644 --- a/kernel/reboot.c +++ b/kernel/reboot.c @@ -34,7 +34,11 @@ EXPORT_SYMBOL(cad_pid); #endif enum reboot_mode reboot_mode DEFAULT_REBOOT_MODE; EXPORT_SYMBOL_GPL(reboot_mode); +#if defined(CONFIG_ARM64) +enum reboot_mode panic_reboot_mode = REBOOT_HARD; +#else enum reboot_mode panic_reboot_mode = REBOOT_UNDEFINED; +#endif /* * This variable is used privately to keep track of whether or not @@ -43,7 +47,7 @@ enum reboot_mode panic_reboot_mode = REBOOT_UNDEFINED; * suppress DMI scanning for reboot quirks. Without it, it's * impossible to override a faulty reboot quirk without recompiling. */ -int reboot_default = 1; +bool reboot_default = true; int reboot_cpu; enum reboot_type reboot_type = BOOT_ACPI; int reboot_force; @@ -1016,7 +1020,7 @@ static int __init reboot_setup(char *str) /* * Having anything passed on the command line via - * reboot= will cause us to disable DMI checking + * reboot= will cause us to skip DMI checking * below. */ reboot_default = 0; From f1bc834141bb04830f2870aefc6e582357930ef7 Mon Sep 17 00:00:00 2001 From: Shubham Gaur Date: Wed, 18 Sep 2024 16:48:43 +0530 Subject: [PATCH 2/2] Update reboot.c --- kernel/reboot.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel/reboot.c b/kernel/reboot.c index e5c1bdd33e03..39a14847a49e 100644 --- a/kernel/reboot.c +++ b/kernel/reboot.c @@ -1023,7 +1023,7 @@ static int __init reboot_setup(char *str) * reboot= will cause us to skip DMI checking * below. */ - reboot_default = 0; + reboot_default = false; if (!strncmp(str, "panic_", 6)) { mode = &panic_reboot_mode; @@ -1155,7 +1155,7 @@ static ssize_t mode_store(struct kobject *kobj, struct kobj_attribute *attr, else return -EINVAL; - reboot_default = 0; + reboot_default = false; return count; } @@ -1177,7 +1177,7 @@ static ssize_t force_store(struct kobject *kobj, struct kobj_attribute *attr, if (kstrtobool(buf, &res)) return -EINVAL; - reboot_default = 0; + reboot_default = false; reboot_force = res; return count; @@ -1234,7 +1234,7 @@ static ssize_t type_store(struct kobject *kobj, struct kobj_attribute *attr, else return -EINVAL; - reboot_default = 0; + reboot_default = false; return count; } @@ -1263,7 +1263,7 @@ static ssize_t cpu_store(struct kobject *kobj, struct kobj_attribute *attr, if (cpunum >= num_possible_cpus()) return -ERANGE; - reboot_default = 0; + reboot_default = false; reboot_cpu = cpunum; return count;