Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5955633e authored by Michael D Labriola's avatar Michael D Labriola Committed by Ingo Molnar
Browse files

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: default avatarMichael 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: default avatarIngo Molnar <mingo@elte.hu>
parent fc395b92
Loading
Loading
Loading
Loading
+26 −2
Original line number Original line Diff line number Diff line
@@ -39,6 +39,14 @@ static int reboot_mode;
enum reboot_type reboot_type = BOOT_ACPI;
enum reboot_type reboot_type = BOOT_ACPI;
int reboot_force;
int reboot_force;


/* This variable is used privately to keep track of whether or not
 * reboot_type is still set to its default value (i.e., reboot= hasn't
 * been set on the command line).  This is needed so that we can
 * suppress DMI scanning for reboot quirks.  Without it, it's
 * impossible to override a faulty reboot quirk without recompiling.
 */
static int reboot_default = 1;

#if defined(CONFIG_X86_32) && defined(CONFIG_SMP)
#if defined(CONFIG_X86_32) && defined(CONFIG_SMP)
static int reboot_cpu = -1;
static int reboot_cpu = -1;
#endif
#endif
@@ -67,6 +75,12 @@ bool port_cf9_safe = false;
static int __init reboot_setup(char *str)
static int __init reboot_setup(char *str)
{
{
	for (;;) {
	for (;;) {
		/* Having anything passed on the command line via
		 * reboot= will cause us to disable DMI checking
		 * below.
		 */
		reboot_default = 0;

		switch (*str) {
		switch (*str) {
		case 'w':
		case 'w':
			reboot_mode = 0x1234;
			reboot_mode = 0x1234;
@@ -316,7 +330,12 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = {


static int __init reboot_init(void)
static int __init reboot_init(void)
{
{
	/* Only do the DMI check if reboot_type hasn't been overridden
	 * on the command line
	 */
	if (reboot_default) {
		dmi_check_system(reboot_dmi_table);
		dmi_check_system(reboot_dmi_table);
	}
	return 0;
	return 0;
}
}
core_initcall(reboot_init);
core_initcall(reboot_init);
@@ -465,7 +484,12 @@ static struct dmi_system_id __initdata pci_reboot_dmi_table[] = {


static int __init pci_reboot_init(void)
static int __init pci_reboot_init(void)
{
{
	/* Only do the DMI check if reboot_type hasn't been overridden
	 * on the command line
	 */
	if (reboot_default) {
		dmi_check_system(pci_reboot_dmi_table);
		dmi_check_system(pci_reboot_dmi_table);
	}
	return 0;
	return 0;
}
}
core_initcall(pci_reboot_init);
core_initcall(pci_reboot_init);