Pull button into test branch
[linux-drm-fsl-dcu.git] / arch / x86_64 / kernel / smp.c
index 5a1c0a3bf87262c027c327773628e93e58194188..af1ec4d23cf89131f16e5063f31c81a6810c63ba 100644 (file)
@@ -203,7 +203,7 @@ int __cpuinit init_smp_flush(void)
 {
        int i;
        for_each_cpu_mask(i, cpu_possible_map) {
-               spin_lock_init(&per_cpu(flush_state.tlbstate_lock, i));
+               spin_lock_init(&per_cpu(flush_state, i).tlbstate_lock);
        }
        return 0;
 }
@@ -376,16 +376,20 @@ int smp_call_function_single (int cpu, void (*func) (void *info), void *info,
        /* prevent preemption and reschedule on another processor */
        int me = get_cpu();
        if (cpu == me) {
-               WARN_ON(1);
                put_cpu();
-               return -EBUSY;
+               return 0;
        }
+
+       /* Can deadlock when called with interrupts disabled */
+       WARN_ON(irqs_disabled());
+
        spin_lock_bh(&call_lock);
        __smp_call_function_single(cpu, func, info, nonatomic, wait);
        spin_unlock_bh(&call_lock);
        put_cpu();
        return 0;
 }
+EXPORT_SYMBOL(smp_call_function_single);
 
 /*
  * this function sends a 'generic call function' IPI to all other CPUs
@@ -522,26 +526,3 @@ asmlinkage void smp_call_function_interrupt(void)
        }
 }
 
-int safe_smp_processor_id(void)
-{
-       unsigned apicid, i;
-
-       if (disable_apic)
-               return 0;
-
-       apicid = hard_smp_processor_id();
-       if (apicid < NR_CPUS && x86_cpu_to_apicid[apicid] == apicid)
-               return apicid;
-
-       for (i = 0; i < NR_CPUS; ++i) {
-               if (x86_cpu_to_apicid[i] == apicid)
-                       return i;
-       }
-
-       /* No entries in x86_cpu_to_apicid?  Either no MPS|ACPI,
-        * or called too early.  Either way, we must be CPU 0. */
-       if (x86_cpu_to_apicid[0] == BAD_APICID)
-               return 0;
-
-       return 0; /* Should not happen */
-}