From: "Fenghua Yu" Subject: [PATCH v10 12/14] x86, hotplug: Handle retrigger irq by the first available CPU Date: Tue, 13 Nov 2012 11:32:49 -0800 Message-ID: <1352835171-3958-13-git-send-email-fenghua.yu@intel.com> References: <1352835171-3958-1-git-send-email-fenghua.yu@intel.com> Return-path: In-Reply-To: <1352835171-3958-1-git-send-email-fenghua.yu@intel.com> Sender: linux-kernel-owner@vger.kernel.org To: Ingo Molnar , Thomas Gleixner , H Peter Anvin , Linus Torvalds , Andrew Morton , Asit K Mallick , Tony Luck , Arjan Dan De Ven , Suresh B Siddha , Len Brown , "Srivatssa S. Bhat" , Randy Dunlap , "Rafael J. Wysocki" , Chen Gong , linux-kernel , linux-pm , x86 Cc: Fenghua Yu List-Id: linux-pm@vger.kernel.org From: Fenghua Yu The first cpu in irq cfg->domain is likely to be CPU 0 and may not be available when CPU 0 is offline. Instead of using CPU 0 to handle retriggered irq, we use first available CPU which is online and in this irq's domain. Signed-off-by: Fenghua Yu --- arch/x86/kernel/apic/io_apic.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index b134f0b..c94bac8 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@ -2199,9 +2199,11 @@ static int ioapic_retrigger_irq(struct irq_data *data) { struct irq_cfg *cfg = data->chip_data; unsigned long flags; + int cpu; raw_spin_lock_irqsave(&vector_lock, flags); - apic->send_IPI_mask(cpumask_of(cpumask_first(cfg->domain)), cfg->vector); + cpu = cpumask_first_and(cfg->domain, cpu_online_mask); + apic->send_IPI_mask(cpumask_of(cpu), cfg->vector); raw_spin_unlock_irqrestore(&vector_lock, flags); return 1; -- 1.7.2