Merge branch 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/kaber/nf-2.6
[pandora-kernel.git] / arch / blackfin / mach-common / smp.c
index 40e6cbc..6e17a26 100644 (file)
  */
 struct corelock_slot corelock __attribute__ ((__section__(".l2.bss")));
 
+#ifdef CONFIG_ICACHE_FLUSH_L1
+unsigned long blackfin_iflush_l1_entry[NR_CPUS];
+#endif
+
 void __cpuinitdata *init_retx_coreb, *init_saved_retx_coreb,
        *init_saved_seqstat_coreb, *init_saved_icplb_fault_addr_coreb,
        *init_saved_dcplb_fault_addr_coreb;
@@ -244,12 +248,13 @@ int smp_call_function(void (*func)(void *info), void *info, int wait)
 {
        cpumask_t callmap;
 
+       preempt_disable();
        callmap = cpu_online_map;
        cpu_clear(smp_processor_id(), callmap);
-       if (cpus_empty(callmap))
-               return 0;
+       if (!cpus_empty(callmap))
+               smp_send_message(callmap, BFIN_IPI_CALL_FUNC, func, info, wait);
 
-       smp_send_message(callmap, BFIN_IPI_CALL_FUNC, func, info, wait);
+       preempt_enable();
 
        return 0;
 }
@@ -286,12 +291,13 @@ void smp_send_stop(void)
 {
        cpumask_t callmap;
 
+       preempt_disable();
        callmap = cpu_online_map;
        cpu_clear(smp_processor_id(), callmap);
-       if (cpus_empty(callmap))
-               return;
+       if (!cpus_empty(callmap))
+               smp_send_message(callmap, BFIN_IPI_CPU_STOP, NULL, NULL, 0);
 
-       smp_send_message(callmap, BFIN_IPI_CPU_STOP, NULL, NULL, 0);
+       preempt_enable();
 
        return;
 }