[PATCH] x86, reboot: skip DMI checks if reboot set by user

Michael D Labriola
2012-01-17T15:16:14Z

This commit causes DMI checks for vendor specific reboot
quirks to be skipped if the user passed in a reboot= arg
on the command line.

Signed-off-by: Michael D Labriola <mlabriol@gdeb.com>
---
arch/x86/kernel/reboot.c | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index 37a458b..4240d58 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -38,6 +38,7 @@ static const struct desc_ptr no_idt = {};
static int reboot_mode;
enum reboot_type reboot_type = BOOT_ACPI;
int reboot_force;
+int reboot_user;

#if defined(CONFIG_X86_32) && defined(CONFIG_SMP)
static int reboot_cpu = -1;
@@ -70,10 +71,12 @@ static int __init reboot_setup(char *str)
switch (*str) {
case 'w':
reboot_mode = 0x1234;
+ reboot_user = 1;
break;

case 'c':
reboot_mode = 0;
+ reboot_user = 1;
break;

#ifdef CONFIG_X86_32
@@ -87,6 +90,7 @@ static int __init reboot_setup(char *str)
/* we will leave sorting out the final
value
when we are ready to reboot, since we
might not
have detected BSP APIC ID or
smp_num_cpu */
+ reboot_user = 1;
break;
#endif /* CONFIG_SMP */

@@ -98,10 +102,12 @@ static int __init reboot_setup(char *str)
case 'e':
case 'p':
reboot_type = *str;
+ reboot_user = 1;
break;

case 'f':
reboot_force = 1;
+ reboot_user = 1;
break;
}

@@ -316,7 +322,10 @@ static struct dmi_system_id __initdata
reboot_dmi_table[] = {

static int __init reboot_init(void)
{
- dmi_check_system(reboot_dmi_table);
+ /* Skip the DMI check if user set reboot= on the command line */
+ if (!reboot_user) {
+ dmi_check_system(reboot_dmi_table);
+ }
return 0;
}
core_initcall(reboot_init);
@@ -465,7 +474,10 @@ static struct dmi_system_id __initdata
pci_reboot_dmi_table[] = {

static int __init pci_reboot_init(void)
{
- dmi_check_system(pci_reboot_dmi_table);
+ /* Skip the DMI check if user set reboot= on the command line */
+ if (!reboot_user) {
+ dmi_check_system(pci_reboot_dmi_table);
+ }
return 0;
}
core_initcall(pci_reboot_init);
--
1.6.0.3