From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Huacai Chen <chenhc@lemote.com>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Subject: [ 05/11] PM / reboot: call syscore_shutdown() after disable_nonboot_cpus()
Date: Sun, 14 Apr 2013 19:17:37 -0700 [thread overview]
Message-ID: <20130415020614.480658197@linuxfoundation.org> (raw)
In-Reply-To: <20130415020614.067692418@linuxfoundation.org>
3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Huacai Chen <chenhc@lemote.com>
commit 6f389a8f1dd22a24f3d9afc2812b30d639e94625 upstream.
As commit 40dc166c (PM / Core: Introduce struct syscore_ops for core
subsystems PM) say, syscore_ops operations should be carried with one
CPU on-line and interrupts disabled. However, after commit f96972f2d
(kernel/sys.c: call disable_nonboot_cpus() in kernel_restart()),
syscore_shutdown() is called before disable_nonboot_cpus(), so break
the rules. We have a MIPS machine with a 8259A PIC, and there is an
external timer (HPET) linked at 8259A. Since 8259A has been shutdown
too early (by syscore_shutdown()), disable_nonboot_cpus() runs without
timer interrupt, so it hangs and reboot fails. This patch call
syscore_shutdown() a little later (after disable_nonboot_cpus()) to
avoid reboot failure, this is the same way as poweroff does.
For consistency, add disable_nonboot_cpus() to kernel_halt().
Signed-off-by: Huacai Chen <chenhc@lemote.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/sys.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -320,7 +320,6 @@ void kernel_restart_prepare(char *cmd)
system_state = SYSTEM_RESTART;
usermodehelper_disable();
device_shutdown();
- syscore_shutdown();
}
/**
@@ -335,6 +334,7 @@ void kernel_restart(char *cmd)
{
kernel_restart_prepare(cmd);
disable_nonboot_cpus();
+ syscore_shutdown();
if (!cmd)
printk(KERN_EMERG "Restarting system.\n");
else
@@ -360,6 +360,7 @@ static void kernel_shutdown_prepare(enum
void kernel_halt(void)
{
kernel_shutdown_prepare(SYSTEM_HALT);
+ disable_nonboot_cpus();
syscore_shutdown();
printk(KERN_EMERG "System halted.\n");
kmsg_dump(KMSG_DUMP_HALT);
next prev parent reply other threads:[~2013-04-15 2:18 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-15 2:17 [ 00/11] 3.0.74-stable review Greg Kroah-Hartman
2013-04-15 2:17 ` [ 01/11] ALSA: usb-audio: fix endianness bug in snd_nativeinstruments_* Greg Kroah-Hartman
2013-04-15 2:17 ` [ 02/11] x86-32, mm: Rip out x86_32 NUMA remapping code Greg Kroah-Hartman
2013-04-15 2:17 ` [ 03/11] ASoC: wm8903: Fix the bypass to HP/LINEOUT when no DAC or ADC is running Greg Kroah-Hartman
2013-04-15 2:17 ` [ 04/11] tracing: Fix double free when function profile init failed Greg Kroah-Hartman
2013-04-15 2:17 ` Greg Kroah-Hartman [this message]
2013-04-15 2:17 ` [ 06/11] target: Fix incorrect fallthrough of ALUA Standby/Offline/Transition CDBs Greg Kroah-Hartman
2013-04-15 2:17 ` [ 07/11] sched_clock: Prevent 64bit inatomicity on 32bit systems Greg Kroah-Hartman
2013-04-15 2:17 ` [ 08/11] x86, mm, paravirt: Fix vmalloc_fault oops during lazy MMU updates Greg Kroah-Hartman
2013-04-15 2:17 ` [ 09/11] x86, mm: Patch out arch_flush_lazy_mmu_mode() when running on bare metal Greg Kroah-Hartman
2013-04-15 2:17 ` [ 10/11] mtdchar: fix offset overflow detection Greg Kroah-Hartman
2013-04-15 20:55 ` David Woodhouse
2013-04-15 20:55 ` David Woodhouse
2013-04-15 22:35 ` Greg Kroah-Hartman
2013-04-15 22:35 ` Greg Kroah-Hartman
2013-04-16 8:41 ` David Woodhouse
2013-04-16 8:41 ` David Woodhouse
2013-04-22 1:22 ` Ben Hutchings
2013-04-22 1:22 ` Ben Hutchings
2013-04-15 2:17 ` [ 11/11] r8169: fix auto speed down issue Greg Kroah-Hartman
2013-04-15 14:03 ` [ 00/11] 3.0.74-stable review Shuah Khan
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=20130415020614.480658197@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=chenhc@lemote.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=stable@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.