diff options
author | Michael D Labriola <michael.d.labriola@gmail.com> | 2012-01-29 14:17:22 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2012-01-30 04:52:32 -0500 |
commit | 5955633e91bfc5cd0a41d8d82259e1d8b32980ef (patch) | |
tree | 741b2b1a361c443273d7abda20b33ee57f3b94df /arch/x86 | |
parent | fc395b9291925b1880e0afc61274fe2f6ddc1269 (diff) |
x86/reboot: Skip DMI checks if reboot set by user
Skip DMI checks for vendor specific reboot quirks if the user
passed in a reboot= arg on the command line - we should never
override user choices.
Signed-off-by: Michael D Labriola <michael.d.labriola@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Michael D Labriola <mlabriol@gdeb.com>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/87wr8ab9od.fsf@gmail.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/reboot.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index 37a458b521a6..b257f0e28824 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c | |||
@@ -39,6 +39,14 @@ static int reboot_mode; | |||
39 | enum reboot_type reboot_type = BOOT_ACPI; | 39 | enum reboot_type reboot_type = BOOT_ACPI; |
40 | int reboot_force; | 40 | int reboot_force; |
41 | 41 | ||
42 | /* This variable is used privately to keep track of whether or not | ||
43 | * reboot_type is still set to its default value (i.e., reboot= hasn't | ||
44 | * been set on the command line). This is needed so that we can | ||
45 | * suppress DMI scanning for reboot quirks. Without it, it's | ||
46 | * impossible to override a faulty reboot quirk without recompiling. | ||
47 | */ | ||
48 | static int reboot_default = 1; | ||
49 | |||
42 | #if defined(CONFIG_X86_32) && defined(CONFIG_SMP) | 50 | #if defined(CONFIG_X86_32) && defined(CONFIG_SMP) |
43 | static int reboot_cpu = -1; | 51 | static int reboot_cpu = -1; |
44 | #endif | 52 | #endif |
@@ -67,6 +75,12 @@ bool port_cf9_safe = false; | |||
67 | static int __init reboot_setup(char *str) | 75 | static int __init reboot_setup(char *str) |
68 | { | 76 | { |
69 | for (;;) { | 77 | for (;;) { |
78 | /* Having anything passed on the command line via | ||
79 | * reboot= will cause us to disable DMI checking | ||
80 | * below. | ||
81 | */ | ||
82 | reboot_default = 0; | ||
83 | |||
70 | switch (*str) { | 84 | switch (*str) { |
71 | case 'w': | 85 | case 'w': |
72 | reboot_mode = 0x1234; | 86 | reboot_mode = 0x1234; |
@@ -316,7 +330,12 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = { | |||
316 | 330 | ||
317 | static int __init reboot_init(void) | 331 | static int __init reboot_init(void) |
318 | { | 332 | { |
319 | dmi_check_system(reboot_dmi_table); | 333 | /* Only do the DMI check if reboot_type hasn't been overridden |
334 | * on the command line | ||
335 | */ | ||
336 | if (reboot_default) { | ||
337 | dmi_check_system(reboot_dmi_table); | ||
338 | } | ||
320 | return 0; | 339 | return 0; |
321 | } | 340 | } |
322 | core_initcall(reboot_init); | 341 | core_initcall(reboot_init); |
@@ -465,7 +484,12 @@ static struct dmi_system_id __initdata pci_reboot_dmi_table[] = { | |||
465 | 484 | ||
466 | static int __init pci_reboot_init(void) | 485 | static int __init pci_reboot_init(void) |
467 | { | 486 | { |
468 | dmi_check_system(pci_reboot_dmi_table); | 487 | /* Only do the DMI check if reboot_type hasn't been overridden |
488 | * on the command line | ||
489 | */ | ||
490 | if (reboot_default) { | ||
491 | dmi_check_system(pci_reboot_dmi_table); | ||
492 | } | ||
469 | return 0; | 493 | return 0; |
470 | } | 494 | } |
471 | core_initcall(pci_reboot_init); | 495 | core_initcall(pci_reboot_init); |