Skip to content

Commit 1439d03

Browse files
soniczaet00
authored andcommitted
blackfin: kgdb: call generic_exec_single() directly
Current generic API smp_call_function_single() is changed to avoid raise IPI and call function in IPI handler on the same core which is necessary to support KGDB switch master core in SMP case, so call generic_exec_single() directly instead of smp_call_function_single(). Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Bob Liu <lliubbo@gmail.com>
1 parent f1a1d52 commit 1439d03

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

arch/blackfin/kernel/kgdb.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,19 +329,28 @@ static void bfin_disable_hw_debug(struct pt_regs *regs)
329329
}
330330

331331
#ifdef CONFIG_SMP
332+
extern void generic_exec_single(int cpu, struct call_single_data *data, int wait);
333+
static struct call_single_data kgdb_smp_ipi_data[NR_CPUS];
334+
332335
void kgdb_passive_cpu_callback(void *info)
333336
{
334337
kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs());
335338
}
336339

337340
void kgdb_roundup_cpus(unsigned long flags)
338341
{
339-
smp_call_function(kgdb_passive_cpu_callback, NULL, 0);
342+
unsigned int cpu;
343+
344+
for (cpu = cpumask_first(cpu_online_mask); cpu < nr_cpu_ids;
345+
cpu = cpumask_next(cpu, cpu_online_mask)) {
346+
kgdb_smp_ipi_data[cpu].func = kgdb_passive_cpu_callback;
347+
generic_exec_single(cpu, &kgdb_smp_ipi_data[cpu], 0);
348+
}
340349
}
341350

342351
void kgdb_roundup_cpu(int cpu, unsigned long flags)
343352
{
344-
smp_call_function_single(cpu, kgdb_passive_cpu_callback, NULL, 0);
353+
generic_exec_single(cpu, &kgdb_smp_ipi_data[cpu], 0);
345354
}
346355
#endif
347356

0 commit comments

Comments
 (0)