diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-01 13:10:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-01 13:10:59 -0400 |
commit | 4b2ce8f15f8fdcd8a73dd31664b252e2b4ed174a (patch) | |
tree | a583c70fa8913aa434f112ca9a25fffebd7ab524 | |
parent | 1694f0bb8f04837f5232f35051f40eefc4ad5402 (diff) | |
parent | fb3bd7b19b2b6ef779d18573c10c00c53cd8add6 (diff) |
Merge branch 'x86-reboot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 reboot changes from Ingo Molnar:
"Refine the reboot logic around the CF9 and EFI reboot methods, to make
it more robust. The expectation is for no working system to break,
and for a couple of reboot-force systems to start rebooting
automatically again"
* 'x86-reboot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86, reboot: Only use CF9_COND automatically, not CF9
x86, reboot: Add EFI and CF9 reboot methods into the default list
-rw-r--r-- | arch/x86/kernel/reboot.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index c752cb43e52f..654b46574b91 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c | |||
@@ -464,9 +464,12 @@ void __attribute__((weak)) mach_reboot_fixups(void) | |||
464 | * 2) If still alive, write to the keyboard controller | 464 | * 2) If still alive, write to the keyboard controller |
465 | * 3) If still alive, write to the ACPI reboot register again | 465 | * 3) If still alive, write to the ACPI reboot register again |
466 | * 4) If still alive, write to the keyboard controller again | 466 | * 4) If still alive, write to the keyboard controller again |
467 | * 5) If still alive, call the EFI runtime service to reboot | ||
468 | * 6) If still alive, write to the PCI IO port 0xCF9 to reboot | ||
469 | * 7) If still alive, inform BIOS to do a proper reboot | ||
467 | * | 470 | * |
468 | * If the machine is still alive at this stage, it gives up. We default to | 471 | * If the machine is still alive at this stage, it gives up. We default to |
469 | * following the same pattern, except that if we're still alive after (4) we'll | 472 | * following the same pattern, except that if we're still alive after (7) we'll |
470 | * try to force a triple fault and then cycle between hitting the keyboard | 473 | * try to force a triple fault and then cycle between hitting the keyboard |
471 | * controller and doing that | 474 | * controller and doing that |
472 | */ | 475 | */ |
@@ -502,7 +505,7 @@ static void native_machine_emergency_restart(void) | |||
502 | attempt = 1; | 505 | attempt = 1; |
503 | reboot_type = BOOT_ACPI; | 506 | reboot_type = BOOT_ACPI; |
504 | } else { | 507 | } else { |
505 | reboot_type = BOOT_TRIPLE; | 508 | reboot_type = BOOT_EFI; |
506 | } | 509 | } |
507 | break; | 510 | break; |
508 | 511 | ||
@@ -510,13 +513,15 @@ static void native_machine_emergency_restart(void) | |||
510 | load_idt(&no_idt); | 513 | load_idt(&no_idt); |
511 | __asm__ __volatile__("int3"); | 514 | __asm__ __volatile__("int3"); |
512 | 515 | ||
516 | /* We're probably dead after this, but... */ | ||
513 | reboot_type = BOOT_KBD; | 517 | reboot_type = BOOT_KBD; |
514 | break; | 518 | break; |
515 | 519 | ||
516 | case BOOT_BIOS: | 520 | case BOOT_BIOS: |
517 | machine_real_restart(MRR_BIOS); | 521 | machine_real_restart(MRR_BIOS); |
518 | 522 | ||
519 | reboot_type = BOOT_KBD; | 523 | /* We're probably dead after this, but... */ |
524 | reboot_type = BOOT_TRIPLE; | ||
520 | break; | 525 | break; |
521 | 526 | ||
522 | case BOOT_ACPI: | 527 | case BOOT_ACPI: |
@@ -530,7 +535,7 @@ static void native_machine_emergency_restart(void) | |||
530 | EFI_RESET_WARM : | 535 | EFI_RESET_WARM : |
531 | EFI_RESET_COLD, | 536 | EFI_RESET_COLD, |
532 | EFI_SUCCESS, 0, NULL); | 537 | EFI_SUCCESS, 0, NULL); |
533 | reboot_type = BOOT_KBD; | 538 | reboot_type = BOOT_CF9_COND; |
534 | break; | 539 | break; |
535 | 540 | ||
536 | case BOOT_CF9: | 541 | case BOOT_CF9: |
@@ -548,7 +553,7 @@ static void native_machine_emergency_restart(void) | |||
548 | outb(cf9|reboot_code, 0xcf9); | 553 | outb(cf9|reboot_code, 0xcf9); |
549 | udelay(50); | 554 | udelay(50); |
550 | } | 555 | } |
551 | reboot_type = BOOT_KBD; | 556 | reboot_type = BOOT_BIOS; |
552 | break; | 557 | break; |
553 | } | 558 | } |
554 | } | 559 | } |