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

Commit a2d15862 authored by Kyle Yan's avatar Kyle Yan
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>
parent 830592ef
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -808,11 +808,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);

	flush_cache_all();