aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin
diff options
context:
space:
mode:
authorSteven Miao <realmz6@gmail.com>2011-11-25 01:25:30 -0500
committerBob Liu <lliubbo@gmail.com>2012-01-08 21:26:15 -0500
commita2eff9dd8bca6d03bc3c87790bac3fdb4fe6dbf0 (patch)
tree2218c5d6b9d1258f1f8c8c691ae210abe41c44e2 /arch/blackfin
parent7d157fb02bc3f4dc74e6830725864ba501d92da7 (diff)
blackfin: smp: fix msg queue overflow issue
disable preemption when icache flush and use wait mode cross call, hold the msg queue lock while handle cross function call to avoid overflow Signed-off-by: Steven Miao <realmz6@gmail.com> Signed-off-by: Bob Liu <lliubbo@gmail.com>
Diffstat (limited to 'arch/blackfin')
-rw-r--r--arch/blackfin/mach-common/smp.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/blackfin/mach-common/smp.c b/arch/blackfin/mach-common/smp.c
index d3464053dfdb..ac8f8a43158c 100644
--- a/arch/blackfin/mach-common/smp.c
+++ b/arch/blackfin/mach-common/smp.c
@@ -193,14 +193,10 @@ static irqreturn_t ipi_handler_int1(int irq, void *dev_instance)
193 scheduler_ipi(); 193 scheduler_ipi();
194 break; 194 break;
195 case BFIN_IPI_CALL_FUNC: 195 case BFIN_IPI_CALL_FUNC:
196 spin_unlock_irqrestore(&msg_queue->lock, flags);
197 ipi_call_function(cpu, msg); 196 ipi_call_function(cpu, msg);
198 spin_lock_irqsave(&msg_queue->lock, flags);
199 break; 197 break;
200 case BFIN_IPI_CPU_STOP: 198 case BFIN_IPI_CPU_STOP:
201 spin_unlock_irqrestore(&msg_queue->lock, flags);
202 ipi_cpu_stop(cpu); 199 ipi_cpu_stop(cpu);
203 spin_lock_irqsave(&msg_queue->lock, flags);
204 break; 200 break;
205 default: 201 default:
206 printk(KERN_CRIT "CPU%u: Unknown IPI message 0x%lx\n", 202 printk(KERN_CRIT "CPU%u: Unknown IPI message 0x%lx\n",
@@ -482,8 +478,10 @@ void smp_icache_flush_range_others(unsigned long start, unsigned long end)
482 smp_flush_data.start = start; 478 smp_flush_data.start = start;
483 smp_flush_data.end = end; 479 smp_flush_data.end = end;
484 480
485 if (smp_call_function(&ipi_flush_icache, &smp_flush_data, 0)) 481 preempt_disable();
482 if (smp_call_function(&ipi_flush_icache, &smp_flush_data, 1))
486 printk(KERN_WARNING "SMP: failed to run I-cache flush request on other CPUs\n"); 483 printk(KERN_WARNING "SMP: failed to run I-cache flush request on other CPUs\n");
484 preempt_enable();
487} 485}
488EXPORT_SYMBOL_GPL(smp_icache_flush_range_others); 486EXPORT_SYMBOL_GPL(smp_icache_flush_range_others);
489 487