From: "Fenghua Yu" <fenghua.yu@intel.com>
To: "Ingo Molnar" <mingo@elte.hu>,
"H. Peter Anvin" <hpa@linux.intel.com>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Bernd Kuhls" <berndkuhls@hotmail.com>,
"Len Brown" <lenb@kernel.org>, "Rui Zhang" <rui.zhang@intel.com>,
"Glenn Williamson" <glenn.p.williamson@intel.com>
Cc: "linux-kernel" <linux-kernel@vger.kernel.org>,
"x86" <x86@kernel.org>, "Fenghua Yu" <fenghua.yu@intel.com>
Subject: [PATCH][BUGFIX] x86/reboot: Disable scheduler before disabling IO APIC
Date: Fri, 20 Jun 2014 21:57:36 -0700 [thread overview]
Message-ID: <1403326656-48521-1-git-send-email-fenghua.yu@intel.com> (raw)
From: Fenghua Yu <fenghua.yu@intel.com>
During reboot, in the middle of disabling IO APIC, the scheduler may be
triggered by per cpu timer to do load blance. But since the kernel is
already in the process of shutting down and can not execute scheduler's
load balance at this point, it triggers invalid TSS exception and hangs
during reboot.
This happens on some boards (e.g. AsRock ZT87 Extreme4 BIOS 2.70) in 32-bit
kernel reported in Bugzilla 76661 at
https://bugzilla.kernel.org/show_bug.cgi?id=76661
To fix the issue, we disable local irq including per cpu timer before
disabling IO APIC. By doing this, the scheduler will not disturb
disable_IO_APIC().
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Tested-by: berndkuhls@hotmail.com
---
arch/x86/kernel/reboot.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index 52b1157..16111c6 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -574,6 +574,15 @@ static void native_machine_emergency_restart(void)
void native_machine_shutdown(void)
{
/* Stop the cpus and apics */
+
+#ifdef CONFIG_SMP
+ /*
+ * Disable the local irq to not receive the per-cpu timer interrupt
+ * which may trigger scheduler's load balance.
+ */
+ local_irq_disable();
+#endif
+
#ifdef CONFIG_X86_IO_APIC
/*
* Disabling IO APIC before local APIC is a workaround for
@@ -591,11 +600,8 @@ void native_machine_shutdown(void)
#ifdef CONFIG_SMP
/*
- * Stop all of the others. Also disable the local irq to
- * not receive the per-cpu timer interrupt which may trigger
- * scheduler's load balance.
+ * Stop all of the others.
*/
- local_irq_disable();
stop_other_cpus();
#endif
--
1.8.1.2
reply other threads:[~2014-06-21 4:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1403326656-48521-1-git-send-email-fenghua.yu@intel.com \
--to=fenghua.yu@intel.com \
--cc=berndkuhls@hotmail.com \
--cc=glenn.p.williamson@intel.com \
--cc=hpa@linux.intel.com \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rui.zhang@intel.com \
--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®