mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: "Li, Aubrey" <aubrey.li@linux.intel.com>,
	Matthew Garrett <mjg59@srcf.ucam.org>
Cc: "H. Peter Anvin" <hpa@linux.intel.com>,
	"alan@linux.intel.com" <alan@linux.intel.com>,
	linux-kernel@vger.kernel.org, Len.Brown@intel.com,
	Adam Williamson <awilliam@redhat.com>
Subject: Re: [patch] x86: Introduce BOOT_EFI and BOOT_CF9 into the reboot sequence loop
Date: Sun, 02 Mar 2014 08:52:17 -0800	[thread overview]
Message-ID: <cfbdc582-9fc0-4335-9974-d508c2da1c71@email.android.com> (raw)
In-Reply-To: <53130A46.1010801@linux.intel.com>

We are unambiguously dead after BIOS.  There is no retry possible...

On March 2, 2014 2:39:02 AM PST, "Li, Aubrey" <aubrey.li@linux.intel.com> wrote:
>Patch refined as below, welcome any comments.
>
>Thanks,
>-Aubrey
>
>[PATCH] x86/reboot: Introduce all of the known reboot methods into the
>default list
>
>Reboot is the last service linux OS provides to the end user. We are
>supposed to make this function more robust than today. This patch adds
>all of the known reboot methods into the default attempt list. The
>machines requiring reboot=efi or reboot=p or reboot=bios get a chance
>to reboot automatically now.
>
>If there is a new reboot method emerged, we are supposed to add it to
>the default list as well, instead of adding the endless dmidecode
>entry.
>
>If one method required is in the default list in this patch but the
>machine reboot still hangs, that means some methods ahead of the
>required method cause the system hangs, then reboot the machine by
>passing reboot= arguments and submit the reboot dmidecode table quirk.
>
>We are supposed to remove the reboot dmidecode table from the kernel,
>but to be safe, we keep it. This patch prevents us from adding more.
>If you happened to have a machine listed in the reboot dmidecode
>table and this patch makes reboot work on your machine, please submit
>a patch to remove the quirk.
>
>Signed-off-by: Aubrey Li <aubrey.li@intel.com>
>---
> arch/x86/kernel/reboot.c |   13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
>diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
>index c752cb4..807007f 100644
>--- a/arch/x86/kernel/reboot.c
>+++ b/arch/x86/kernel/reboot.c
>@@ -464,9 +464,12 @@ void __attribute__((weak))
>mach_reboot_fixups(void)
>  * 2) If still alive, write to the keyboard controller
>  * 3) If still alive, write to the ACPI reboot register again
>  * 4) If still alive, write to the keyboard controller again
>+ * 5) If still alive, call the EFI runtime service to reboot
>+ * 6) If still alive, write to the PCI IO port 0xCF9 to reboot
>+ * 7) If still alive, inform BIOS to do a proper reboot
>  *
>* If the machine is still alive at this stage, it gives up. We default
>to
>- * following the same pattern, except that if we're still alive after
>(4) we'll
>+ * following the same pattern, except that if we're still alive after
>(7) we'll
>* try to force a triple fault and then cycle between hitting the
>keyboard
>  * controller and doing that
>  */
>@@ -502,7 +505,7 @@ static void native_machine_emergency_restart(void)
> 				attempt = 1;
> 				reboot_type = BOOT_ACPI;
> 			} else {
>-				reboot_type = BOOT_TRIPLE;
>+				reboot_type = BOOT_EFI;
> 			}
> 			break;
>
>@@ -516,7 +519,7 @@ static void native_machine_emergency_restart(void)
> 		case BOOT_BIOS:
> 			machine_real_restart(MRR_BIOS);
>
>-			reboot_type = BOOT_KBD;
>+			reboot_type = BOOT_TRIPLE;
> 			break;
>
> 		case BOOT_ACPI:
>@@ -530,7 +533,7 @@ static void native_machine_emergency_restart(void)
> 						 EFI_RESET_WARM :
> 						 EFI_RESET_COLD,
> 						 EFI_SUCCESS, 0, NULL);
>-			reboot_type = BOOT_KBD;
>+			reboot_type = BOOT_CF9;
> 			break;
>
> 		case BOOT_CF9:
>@@ -548,7 +551,7 @@ static void native_machine_emergency_restart(void)
> 				outb(cf9|reboot_code, 0xcf9);
> 				udelay(50);
> 			}
>-			reboot_type = BOOT_KBD;
>+			reboot_type = BOOT_BIOS;
> 			break;
> 		}
> 	}

-- 
Sent from my mobile phone.  Please pardon brevity and lack of formatting.

  reply	other threads:[~2014-03-02 16:52 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-28  4:11 Li, Aubrey
2014-02-28  4:56 ` Matthew Garrett
2014-02-28  5:22   ` Li, Aubrey
2014-02-28  5:56     ` Matthew Garrett
2014-02-28  6:07       ` Li, Aubrey
2014-02-28  6:12         ` Matthew Garrett
2014-02-28  6:20           ` Li, Aubrey
2014-02-28  6:23             ` Matthew Garrett
2014-02-28  6:39               ` Li, Aubrey
2014-02-28  6:44                 ` Matthew Garrett
2014-02-28  6:54                   ` Li, Aubrey
2014-02-28 17:47                     ` H. Peter Anvin
2014-02-28 22:11                       ` Li, Aubrey
2014-02-28 22:16                         ` Adam Williamson
2014-03-01 17:10                         ` Li, Aubrey
2014-03-01 17:22                           ` Matthew Garrett
2014-03-01 17:31                             ` Li, Aubrey
2014-03-01 18:19                               ` Matthew Garrett
2014-03-01 19:01                                 ` Matthew Garrett
2014-03-02  0:15                                   ` Li, Aubrey
2014-03-01 20:06                             ` H. Peter Anvin
2014-03-01 20:21                               ` Matthew Garrett
2014-03-01 20:26                                 ` H. Peter Anvin
2014-03-02  0:26                                   ` Li, Aubrey
2014-03-02  0:33                                     ` H. Peter Anvin
2014-03-02  1:47                                       ` Li, Aubrey
2014-03-02  2:07                                         ` H. Peter Anvin
2014-03-02  2:20                                           ` Li, Aubrey
2014-03-02  2:23                                           ` Matthew Garrett
2014-03-02  2:35                                             ` H. Peter Anvin
2014-03-02 10:39                                               ` Li, Aubrey
2014-03-02 16:52                                                 ` H. Peter Anvin [this message]
2014-03-02 22:13                                                   ` Li, Aubrey
2014-03-02 22:26                                                     ` Matthew Garrett
2014-03-02 22:45                                                       ` Li, Aubrey
2014-03-02 23:11                                                         ` Matthew Garrett
2014-03-02 23:23                                                           ` Li, Aubrey
2014-03-03  0:07                                                             ` Matthew Garrett
2014-03-03  0:18                                                               ` H. Peter Anvin
2014-03-03  1:36                                                                 ` Li, Aubrey
2014-03-03  1:47                                                                   ` H. Peter Anvin
2014-03-03  1:49                                                                     ` Li, Aubrey
2014-03-03 22:11                                                                       ` Li, Aubrey
2014-03-02 23:57                                                     ` H. Peter Anvin
2014-03-05 23:39                                                 ` [tip:x86/reboot] x86, reboot: Add EFI and CF9 reboot methods into the default list tip-bot for Li, Aubrey
2014-03-05 23:45                                                 ` [tip:x86/reboot] x86, reboot: Only use CF9_COND automatically, not CF9 tip-bot for H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cfbdc582-9fc0-4335-9974-d508c2da1c71@email.android.com \
    --to=hpa@zytor.com \
    --cc=Len.Brown@intel.com \
    --cc=alan@linux.intel.com \
    --cc=aubrey.li@linux.intel.com \
    --cc=awilliam@redhat.com \
    --cc=hpa@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome