Commit 815af8ff authored by Max Filippov's avatar Max Filippov

xtensa: SMP: rework IPI processing

Don't skip current CPU in send_ipi_message: callers of this function
take care of it and it's harmless anyway.
Don't clear IPI bits one by one, clear all that were read at once.
Check IPI register in a loop in case new IPI was posted while previous
was being handled.
Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
parent 05bdebd5
...@@ -372,7 +372,6 @@ static void send_ipi_message(const struct cpumask *callmask, ...@@ -372,7 +372,6 @@ static void send_ipi_message(const struct cpumask *callmask,
unsigned long mask = 0; unsigned long mask = 0;
for_each_cpu(index, callmask) for_each_cpu(index, callmask)
if (index != smp_processor_id())
mask |= 1 << index; mask |= 1 << index;
set_er(mask, MIPISET(msg_id)); set_er(mask, MIPISET(msg_id));
...@@ -412,22 +411,31 @@ irqreturn_t ipi_interrupt(int irq, void *dev_id) ...@@ -412,22 +411,31 @@ irqreturn_t ipi_interrupt(int irq, void *dev_id)
{ {
unsigned int cpu = smp_processor_id(); unsigned int cpu = smp_processor_id();
struct ipi_data *ipi = &per_cpu(ipi_data, cpu); struct ipi_data *ipi = &per_cpu(ipi_data, cpu);
for (;;) {
unsigned int msg; unsigned int msg;
unsigned i;
msg = get_er(MIPICAUSE(cpu)); msg = get_er(MIPICAUSE(cpu));
for (i = 0; i < IPI_MAX; i++) set_er(msg, MIPICAUSE(cpu));
if (msg & (1 << i)) {
set_er(1 << i, MIPICAUSE(cpu)); if (!msg)
++ipi->ipi_count[i]; break;
if (msg & (1 << IPI_CALL_FUNC)) {
++ipi->ipi_count[IPI_CALL_FUNC];
generic_smp_call_function_interrupt();
} }
if (msg & (1 << IPI_RESCHEDULE)) if (msg & (1 << IPI_RESCHEDULE)) {
++ipi->ipi_count[IPI_RESCHEDULE];
scheduler_ipi(); scheduler_ipi();
if (msg & (1 << IPI_CALL_FUNC)) }
generic_smp_call_function_interrupt();
if (msg & (1 << IPI_CPU_STOP)) if (msg & (1 << IPI_CPU_STOP)) {
++ipi->ipi_count[IPI_CPU_STOP];
ipi_cpu_stop(cpu); ipi_cpu_stop(cpu);
}
}
return IRQ_HANDLED; return IRQ_HANDLED;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment