]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/genx2apic_cluster.c
x86: fix cpu_mask_to_apicid_and to include cpu_online_mask
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / genx2apic_cluster.c
index 4716a0c9f9369a3c721a147aadb423850d80035e..d451c9b9fdff22a3d397b2f0de7aa0054cdbe509 100644 (file)
@@ -133,7 +133,9 @@ static unsigned int x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
         * We're using fixed IRQ delivery, can only return one phys APIC ID.
         * May as well be the first.
         */
-       cpu = cpumask_any_and(cpumask, andmask);
+       for_each_cpu_and(cpu, cpumask, andmask)
+               if (cpumask_test_cpu(cpu, cpu_online_mask))
+                       break;
        if (cpu < nr_cpu_ids)
                return per_cpu(x86_cpu_to_apicid, cpu);
        return BAD_APICID;