[mips-next PATCH] MIPS: kdump: Mark cpu back online before rebooting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxx>
---
 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



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux