Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946373AbWJ0Kto (ORCPT ); Fri, 27 Oct 2006 06:49:44 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1946378AbWJ0Kto (ORCPT ); Fri, 27 Oct 2006 06:49:44 -0400 Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:61844 "EHLO fgwmail6.fujitsu.co.jp") by vger.kernel.org with ESMTP id S1946373AbWJ0Ktm (ORCPT ); Fri, 27 Oct 2006 06:49:42 -0400 Date: Fri, 27 Oct 2006 19:49:53 +0900 Message-ID: <87mz7ivxri.wl%takeuchi_satoru@jp.fujitsu.com> From: Satoru Takeuchi To: linux-ia64 , Linux Kernel Cc: Ashok Raj , "Luck, Tony" , Andrew Morton , KAMEZAWA Hiroyuki , Kenji Kaneshige , Satoru Takeuchi Subject: [BUGFIX] [PATCH 1/2] cpu-hotplug: Fixing confliction between CPU hot-add and IPI User-Agent: Wanderlust/2.11.30 (Wonderwall) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/21.4 (i386-pc-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1457 Lines: 44 From: Kenji Kaneshige --- Fixing the confliction between CPU hot-add and IPI. Signed-off-by: Kenji Kaneshige Acked-by: Satoru Takeuchi Acked-by: KAMEZAWA Hiroyuki Index: linux-2.6.19-rc3/arch/ia64/kernel/smp.c =================================================================== --- linux-2.6.19-rc3.orig/arch/ia64/kernel/smp.c 2006-10-27 18:40:47.000000000 +0900 +++ linux-2.6.19-rc3/arch/ia64/kernel/smp.c 2006-10-27 18:49:48.000000000 +0900 @@ -328,10 +328,14 @@ smp_call_function (void (*func) (void *info), void *info, int nonatomic, int wait) { struct call_data_struct data; - int cpus = num_online_cpus()-1; + int cpus; - if (!cpus) + spin_lock(&call_lock); + cpus = num_online_cpus() - 1; + if (!cpus) { + spin_unlock(&call_lock); return 0; + } /* Can deadlock when called with interrupts disabled */ WARN_ON(irqs_disabled()); @@ -343,8 +347,6 @@ if (wait) atomic_set(&data.finished, 0); - spin_lock(&call_lock); - call_data = &data; mb(); /* ensure store to call_data precedes setting of IPI_CALL_FUNC */ send_IPI_allbutself(IPI_CALL_FUNC); - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/