Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [mips-next PATCH] MIPS: kdump: Mark cpu back online before rebooting
@ 2018-09-26 19:49 Dengcheng Zhu
  2018-09-28 17:10 ` Paul Burton
  0 siblings, 1 reply; 2+ messages in thread
From: Dengcheng Zhu @ 2018-09-26 19:49 UTC (permalink / raw)
  To: Paul Burton, ralf@linux-mips.org
  Cc: linux-mips@linux-mips.org, rachel.mozes@intel.com, Dengcheng Zhu

The crash utility initializes cpu state by reading the system kernel
memory, which is copied into vmcore.

It is also natural to preserve the online state for CPUs at crash.

Failing to do so could make the analysis tool present info for only 1 CPU
by default, and unable to find panic task.

Signed-off-by: Dengcheng Zhu <dzhu@wavecomp.com>
---
 arch/mips/kernel/machine_kexec.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/mips/kernel/machine_kexec.c b/arch/mips/kernel/machine_kexec.c
index 93b8353eece4..5c5b4351893e 100644
--- a/arch/mips/kernel/machine_kexec.c
+++ b/arch/mips/kernel/machine_kexec.c
@@ -171,6 +171,16 @@ void kexec_reboot(void)
 {
 	void (*do_kexec)(void) __noreturn;
 
+	/*
+	 * We know we were online, and there will be no incoming IPIs at
+	 * this point. Mark online again before rebooting so that the crash
+	 * analysis tool will see us correctly.
+	 */
+	set_cpu_online(smp_processor_id(), true);
+
+	/* Ensure remote CPUs observe that we're online before rebooting. */
+	smp_mb__after_atomic();
+
 #ifdef CONFIG_SMP
 	if (smp_processor_id() > 0) {
 		/*
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-09-28 17:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-26 19:49 [mips-next PATCH] MIPS: kdump: Mark cpu back online before rebooting Dengcheng Zhu
2018-09-28 17:10 ` Paul Burton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox