diff options
author | Steven Miao <realmz6@gmail.com> | 2013-11-15 02:41:35 -0500 |
---|---|---|
committer | Steven Miao <realmz6@gmail.com> | 2013-11-15 05:14:49 -0500 |
commit | 177a48fdc8a0156b32f96d9d0056361d88203983 (patch) | |
tree | 23f3fb2c7a17708623a84d1db63475850d5a0a17 /arch/blackfin | |
parent | aefefe92116b776203f95f3249ae61b94f73f170 (diff) |
smp: bf561: and smb_wmb()/smp_rmb() at ipi send/receive
add smb_wmb()/smp_rmb() to keep cache coherent
Signed-off-by: Steven Miao <realmz6@gmail.com>
Diffstat (limited to 'arch/blackfin')
-rw-r--r-- | arch/blackfin/mach-common/smp.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/blackfin/mach-common/smp.c b/arch/blackfin/mach-common/smp.c index 82f301c117a5..2bbae0783819 100644 --- a/arch/blackfin/mach-common/smp.c +++ b/arch/blackfin/mach-common/smp.c | |||
@@ -146,6 +146,7 @@ static irqreturn_t ipi_handler_int1(int irq, void *dev_instance) | |||
146 | 146 | ||
147 | platform_clear_ipi(cpu, IRQ_SUPPLE_1); | 147 | platform_clear_ipi(cpu, IRQ_SUPPLE_1); |
148 | 148 | ||
149 | smp_rmb(); | ||
149 | bfin_ipi_data = &__get_cpu_var(bfin_ipi); | 150 | bfin_ipi_data = &__get_cpu_var(bfin_ipi); |
150 | while ((pending = atomic_xchg(&bfin_ipi_data->bits, 0)) != 0) { | 151 | while ((pending = atomic_xchg(&bfin_ipi_data->bits, 0)) != 0) { |
151 | msg = 0; | 152 | msg = 0; |
@@ -161,18 +162,20 @@ static irqreturn_t ipi_handler_int1(int irq, void *dev_instance) | |||
161 | case BFIN_IPI_CALL_FUNC: | 162 | case BFIN_IPI_CALL_FUNC: |
162 | generic_smp_call_function_interrupt(); | 163 | generic_smp_call_function_interrupt(); |
163 | break; | 164 | break; |
164 | |||
165 | case BFIN_IPI_CALL_FUNC_SINGLE: | 165 | case BFIN_IPI_CALL_FUNC_SINGLE: |
166 | generic_smp_call_function_single_interrupt(); | 166 | generic_smp_call_function_single_interrupt(); |
167 | break; | 167 | break; |
168 | |||
169 | case BFIN_IPI_CPU_STOP: | 168 | case BFIN_IPI_CPU_STOP: |
170 | ipi_cpu_stop(cpu); | 169 | ipi_cpu_stop(cpu); |
171 | break; | 170 | break; |
171 | default: | ||
172 | goto out; | ||
172 | } | 173 | } |
173 | atomic_dec(&bfin_ipi_data->count); | 174 | atomic_dec(&bfin_ipi_data->count); |
174 | } while (msg < BITS_PER_LONG); | 175 | } while (msg < BITS_PER_LONG); |
176 | |||
175 | } | 177 | } |
178 | out: | ||
176 | return IRQ_HANDLED; | 179 | return IRQ_HANDLED; |
177 | } | 180 | } |
178 | 181 | ||
@@ -198,10 +201,11 @@ void send_ipi(const struct cpumask *cpumask, enum ipi_message_type msg) | |||
198 | bfin_ipi_data = &per_cpu(bfin_ipi, cpu); | 201 | bfin_ipi_data = &per_cpu(bfin_ipi, cpu); |
199 | atomic_set_mask((1 << msg), &bfin_ipi_data->bits); | 202 | atomic_set_mask((1 << msg), &bfin_ipi_data->bits); |
200 | atomic_inc(&bfin_ipi_data->count); | 203 | atomic_inc(&bfin_ipi_data->count); |
201 | platform_send_ipi_cpu(cpu, IRQ_SUPPLE_1); | ||
202 | } | 204 | } |
203 | |||
204 | local_irq_restore(flags); | 205 | local_irq_restore(flags); |
206 | smp_wmb(); | ||
207 | for_each_cpu(cpu, cpumask) | ||
208 | platform_send_ipi_cpu(cpu, IRQ_SUPPLE_1); | ||
205 | } | 209 | } |
206 | 210 | ||
207 | void arch_send_call_function_single_ipi(int cpu) | 211 | void arch_send_call_function_single_ipi(int cpu) |