Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 22b7c752 authored by Kyle Yan's avatar Kyle Yan Committed by Prasad Sodagudi
Browse files

arm64: Dump stack for all CPUs on SMP CPU stop



Add the stack dump and printk of other CPUs when they are stopped
during an abnormal operation like a panic - This information is useful
for debugging to get a clear idea of what might have caused a crash.

Change-Id: I91a62cfc7cdb49b9cdbb247869b5ba799947ece5
Signed-off-by: default avatarKyle Yan <kyan@codeaurora.org>
Signed-off-by: default avatarPrasad Sodagudi <psodagud@codeaurora.org>
parent 311b795a
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -830,11 +830,20 @@ void arch_irq_work_raise(void)
}
#endif

static DEFINE_RAW_SPINLOCK(stop_lock);
/*
 * ipi_cpu_stop - handle IPI from smp_send_stop()
 */
static void ipi_cpu_stop(unsigned int cpu)
{
	if (system_state == SYSTEM_BOOTING ||
	    system_state == SYSTEM_RUNNING) {
		raw_spin_lock(&stop_lock);
		pr_crit("CPU%u: stopping\n", cpu);
		dump_stack();
		raw_spin_unlock(&stop_lock);
	}

	set_cpu_active(cpu, false);

	local_irq_disable();