Skip to content

Commit 8922ba7

Browse files
martenliRussell King (Oracle)
authored andcommitted
ARM: 9317/1: kexec: Make smp stop calls asynchronous
If a panic is triggered by a hrtimer interrupt all online cpus will be notified and set offline. But as highlighted by commit 19dbdcb ("smp: Warn on function calls from softirq context") this call should not be made synchronous with disabled interrupts: softdog: Initiating panic Kernel panic - not syncing: Software Watchdog Timer expired WARNING: CPU: 1 PID: 0 at kernel/smp.c:753 smp_call_function_many_cond unwind_backtrace: show_stack dump_stack_lvl __warn warn_slowpath_fmt smp_call_function_many_cond smp_call_function crash_smp_send_stop.part.0 machine_crash_shutdown __crash_kexec panic softdog_fire __hrtimer_run_queues hrtimer_interrupt Make the smp call for machine_crash_nonpanic_core() asynchronous. Signed-off-by: Mårten Lindahl <marten.lindahl@axis.com> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
1 parent e6b5153 commit 8922ba7

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

arch/arm/kernel/machine_kexec.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,28 @@ static void machine_crash_nonpanic_core(void *unused)
9494
}
9595
}
9696

97+
static DEFINE_PER_CPU(call_single_data_t, cpu_stop_csd) =
98+
CSD_INIT(machine_crash_nonpanic_core, NULL);
99+
97100
void crash_smp_send_stop(void)
98101
{
99102
static int cpus_stopped;
100103
unsigned long msecs;
104+
call_single_data_t *csd;
105+
int cpu, this_cpu = raw_smp_processor_id();
101106

102107
if (cpus_stopped)
103108
return;
104109

105110
atomic_set(&waiting_for_crash_ipi, num_online_cpus() - 1);
106-
smp_call_function(machine_crash_nonpanic_core, NULL, false);
111+
for_each_online_cpu(cpu) {
112+
if (cpu == this_cpu)
113+
continue;
114+
115+
csd = &per_cpu(cpu_stop_csd, cpu);
116+
smp_call_function_single_async(cpu, csd);
117+
}
118+
107119
msecs = 1000; /* Wait at most a second for the other cpus to stop */
108120
while ((atomic_read(&waiting_for_crash_ipi) > 0) && msecs) {
109121
mdelay(1);

0 commit comments

Comments
 (0)