Commit 3eb0be30 authored by Catalin Marinas's avatar Catalin Marinas Committed by Russell King

ARM: 7703/1: Disable preemption in broadcast_tlb*_a15_erratum()

Commit 93dc6887 (ARM: 7684/1: errata: Workaround for Cortex-A15 erratum
798181 (TLBI/DSB operations)) introduces calls to smp_processor_id() and
smp_call_function_many() with preemption enabled. This patch disables
preemption and also optimises the smp_processor_id() call in
broadcast_tlb_mm_a15_erratum(). The broadcast_tlb_a15_erratum() function
is changed to use smp_call_function() which disables preemption.
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Reported-by: default avatarGeoff Levand <geoff@infradead.org>
Reported-by: default avatarNicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 60d509fa
...@@ -98,21 +98,21 @@ static void broadcast_tlb_a15_erratum(void) ...@@ -98,21 +98,21 @@ static void broadcast_tlb_a15_erratum(void)
return; return;
dummy_flush_tlb_a15_erratum(); dummy_flush_tlb_a15_erratum();
smp_call_function_many(cpu_online_mask, ipi_flush_tlb_a15_erratum, smp_call_function(ipi_flush_tlb_a15_erratum, NULL, 1);
NULL, 1);
} }
static void broadcast_tlb_mm_a15_erratum(struct mm_struct *mm) static void broadcast_tlb_mm_a15_erratum(struct mm_struct *mm)
{ {
int cpu; int cpu, this_cpu;
cpumask_t mask = { CPU_BITS_NONE }; cpumask_t mask = { CPU_BITS_NONE };
if (!erratum_a15_798181()) if (!erratum_a15_798181())
return; return;
dummy_flush_tlb_a15_erratum(); dummy_flush_tlb_a15_erratum();
this_cpu = get_cpu();
for_each_online_cpu(cpu) { for_each_online_cpu(cpu) {
if (cpu == smp_processor_id()) if (cpu == this_cpu)
continue; continue;
/* /*
* We only need to send an IPI if the other CPUs are running * We only need to send an IPI if the other CPUs are running
...@@ -127,6 +127,7 @@ static void broadcast_tlb_mm_a15_erratum(struct mm_struct *mm) ...@@ -127,6 +127,7 @@ static void broadcast_tlb_mm_a15_erratum(struct mm_struct *mm)
cpumask_set_cpu(cpu, &mask); cpumask_set_cpu(cpu, &mask);
} }
smp_call_function_many(&mask, ipi_flush_tlb_a15_erratum, NULL, 1); smp_call_function_many(&mask, ipi_flush_tlb_a15_erratum, NULL, 1);
put_cpu();
} }
void flush_tlb_all(void) void flush_tlb_all(void)
......
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