mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: "Liu, Chuansheng" <chuansheng.liu@intel.com>,
	"Li, Fei" <fei.li@intel.com>
Cc: Ingo Molnar <mingo@kernel.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"x86@kernel.org" <x86@kernel.org>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"holt@sgi.com" <holt@sgi.com>,
	"rmk+kernel@arm.linux.org.uk" <rmk+kernel@arm.linux.org.uk>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] reboot: perform warm/cold reset correctly for CF9 type
Date: Sun, 08 Sep 2013 19:56:19 -0700	[thread overview]
Message-ID: <8c7f3058-672f-4f64-964d-238b48cd4445@email.android.com> (raw)
In-Reply-To: <27240C0AC20F114CBF8149A2696CBE4A01B19084@SHSMSX101.ccr.corp.intel.com>

Please answer the questions that I asked, not something else entirely.

"Liu, Chuansheng" <chuansheng.liu@intel.com> wrote:
>Hello hpa,
>
>> I could be wrong and the cold/warm reset values in CF9 end up having
>> exactly the same function as the magic BIOS signature does; if so,
>then
>> I would like to be told so explicitly, ideally with an explanation
>about
>> how it works on the hw level (or a pointer to relevant documentation,
>> Intel internal docs are fine.)
>The Intel link is here for SandyBridge platform:
>https://houston.fm.intel.com/wiki/doku.php?id=svwiki:projects:sandybridge:testplans:reset:start
>And we have one internal baytrail platform doc refered it also.
>
>> 
>> Finally, again, does this solve a real problem?
>Yes, we already have the 0xCF9 rebooting function, why not support the
>COLD/WARM reset both?
>Thanks.
>
>
>For safety and compatibility, we prepared the below patch, do you think
>is it making sense?
>
>
>
>From: liu chuansheng <chuansheng.liu@intel.com>
>Subject: [PATCH] X86, reboot: supporting COLD reset thru 0xcf9 port
>
>Current X86 rebooting function supports the platform reset thru
>port 0xcf9, but currently it hardcoded only for WARM reset that
>writing 0x6 into port 0xcf9.
>
>Here we added the support the COLD reset that writing 0xe thru
>port 0xcf9, and the actual reset type is determined by reboot_mode
>variable.
>
>Also for safety and compatibility, we will set the default reboot
>mode as WARM reset for several Apple MacBooks.
>
>Signed-off-by: Li Fei <fei.li@intel.com>
>Signed-off-by: liu chuansheng <chuansheng.liu@intel.com>
>---
> arch/x86/kernel/reboot.c |   20 ++++++++++++++++++--
> 1 files changed, 18 insertions(+), 2 deletions(-)
>
>diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
>index 563ed91..b4a1cb4 100644
>--- a/arch/x86/kernel/reboot.c
>+++ b/arch/x86/kernel/reboot.c
>@@ -116,6 +116,12 @@ static int __init set_pci_reboot(const struct
>dmi_system_id *d)
> {
>        if (reboot_type != BOOT_CF9) {
>                reboot_type = BOOT_CF9;
>+
>+               /* The default reboot_mode value is COLD reset(0) for
>X86 platform,
>+                * here for safety and compatibility, we set the
>default reboot
>+                * mode as WARM reset for several Apple MacBooks.
>+               */
>+               reboot_mode = REBOOT_WARM;
>pr_info("%s series board detected. Selecting %s-method for reboots.\n",
>                        "PCI", d->ident);
>        }
>@@ -511,10 +517,20 @@ static void
>native_machine_emergency_restart(void)
> 
>                case BOOT_CF9_COND:
>                        if (port_cf9_safe) {
>-                               u8 cf9 = inb(0xcf9) & ~6;
>+                               u8 reboot_val;
>+                               u8 cf9;
>+
>+                               if (reboot_mode == REBOOT_WARM)
>+                                       reboot_val = 0x6;
>+                               else
>+                                       reboot_val = 0xe;
>+
>+                               cf9 = inb(0xcf9) & ~reboot_val;
>                           outb(cf9|2, 0xcf9); /* Request hard reset */
>                                udelay(50);
>-                               outb(cf9|6, 0xcf9); /* Actually do the
>reset */
>+
>+                               /* Actually do the reset */
>+                               outb(cf9|reboot_val, 0xcf9);
>                                udelay(50);
>                        }
>                        reboot_type = BOOT_KBD;

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

  reply	other threads:[~2013-09-09  2:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-21  1:52 Li Fei
2013-08-21  7:29 ` Ingo Molnar
2013-08-21  7:33   ` H. Peter Anvin
2013-08-21  8:08     ` Li, Fei
2013-08-21  9:07       ` H. Peter Anvin
2013-08-22  3:32         ` Li, Fei
2013-09-03 17:35           ` H. Peter Anvin
2013-09-09  1:53             ` Liu, Chuansheng
2013-09-09  2:56               ` H. Peter Anvin [this message]
2013-08-21  8:13 ` [PATCH V2] " Li Fei
2013-09-10 19:51   ` [tip:x86/reboot] reboot: Allow specifying warm/ cold reset for CF9 boot type tip-bot for Li Fei
2013-09-25 17:36   ` tip-bot for Li Fei

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=8c7f3058-672f-4f64-964d-238b48cd4445@email.android.com \
    --to=hpa@zytor.com \
    --cc=akpm@linux-foundation.org \
    --cc=chuansheng.liu@intel.com \
    --cc=fei.li@intel.com \
    --cc=holt@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=rmk+kernel@arm.linux.org.uk \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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

all inboxes | Powered by JetHome®