summaryrefslogtreecommitdiff
path: root/kernel/reboot.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/reboot.c')
-rw-r--r--kernel/reboot.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/kernel/reboot.c b/kernel/reboot.c
index d177d89fcc33..a93c23b9e194 100644
--- a/kernel/reboot.c
+++ b/kernel/reboot.c
@@ -8,10 +8,10 @@
#define pr_fmt(fmt) "reboot: " fmt
#include <linux/atomic.h>
+#include <linux/console.h>
#include <linux/ctype.h>
#include <linux/export.h>
#include <linux/kexec.h>
-#include <linux/kmod.h>
#include <linux/kmsg_dump.h>
#include <linux/rcupdate.h>
#include <linux/reboot.h>
@@ -20,6 +20,7 @@
#include <linux/syscalls.h>
#include <linux/syscore_ops.h>
#include <linux/uaccess.h>
+#include <linux/umh.h>
/*
* this indicates whether you can reboot with ctrl-alt-del: the default is yes
@@ -94,6 +95,14 @@ void emergency_restart(void)
{
kmsg_dump(KMSG_DUMP_EMERG);
system_state = SYSTEM_RESTART;
+
+ /*
+ * NBCON kthreads won't be flushed and stopped properly in
+ * the emergency restart. Move them to the atomic mode.
+ */
+ nbcon_cpu_emergency_enter();
+ printk_trigger_flush();
+
machine_emergency_restart();
}
EXPORT_SYMBOL_GPL(emergency_restart);