From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e28smtp06.in.ibm.com (e28smtp06.in.ibm.com [122.248.162.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "e28smtp06.in.ibm.com", Issuer "GeoTrust SSL CA" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 715ED2C12A3 for ; Sun, 23 Jun 2013 23:50:49 +1000 (EST) Received: from /spool/local by e28smtp06.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 23 Jun 2013 19:13:23 +0530 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id CA8F81258052 for ; Sun, 23 Jun 2013 19:19:45 +0530 (IST) Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r5NDoeah28573946 for ; Sun, 23 Jun 2013 19:20:40 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r5NDogYn016361 for ; Sun, 23 Jun 2013 13:50:43 GMT From: "Srivatsa S. Bhat" Subject: [PATCH 42/45] powerpc: Use get/put_online_cpus_atomic() to avoid false-positive warning To: tglx@linutronix.de, peterz@infradead.org, tj@kernel.org, oleg@redhat.com, paulmck@linux.vnet.ibm.com, rusty@rustcorp.com.au, mingo@kernel.org, akpm@linux-foundation.org, namhyung@kernel.org, walken@google.com, vincent.guittot@linaro.org, laijs@cn.fujitsu.com Date: Sun, 23 Jun 2013 19:17:29 +0530 Message-ID: <20130623134725.19094.9780.stgit@srivatsabhat.in.ibm.com> In-Reply-To: <20130623133642.19094.16038.stgit@srivatsabhat.in.ibm.com> References: <20130623133642.19094.16038.stgit@srivatsabhat.in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Cc: linux-arch@vger.kernel.org, nikunj@linux.vnet.ibm.com, zhong@linux.vnet.ibm.com, linux-pm@vger.kernel.org, fweisbec@gmail.com, linux-kernel@vger.kernel.org, rostedt@goodmis.org, xiaoguangrong@linux.vnet.ibm.com, sbw@mit.edu, Paul Mackerras , wangyun@linux.vnet.ibm.com, srivatsa.bhat@linux.vnet.ibm.com, netdev@vger.kernel.org, Thomas Gleixner , linuxppc-dev@lists.ozlabs.org, Zhao Chenhui List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Bringing a secondary CPU online is a special case in which, accessing the cpu_online_mask is safe, even though that task (which running on the CPU coming online) is not the hotplug writer. It is a little hard to teach this to the debugging checks under CONFIG_DEBUG_HOTPLUG_CPU. But luckily powerpc is one of the few places where the CPU coming online traverses the cpu_online_mask before fully coming online. So wrap that part under get/put_online_cpus_atomic(), to avoid false-positive warnings from the CPU hotplug debug code. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Kumar Gala Cc: Zhao Chenhui Cc: Thomas Gleixner Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Srivatsa S. Bhat --- arch/powerpc/kernel/smp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index 2123bec..59c9a09 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c @@ -657,6 +657,7 @@ __cpuinit void start_secondary(void *unused) cpumask_set_cpu(base + i, cpu_core_mask(cpu)); } l2_cache = cpu_to_l2cache(cpu); + get_online_cpus_atomic(); for_each_online_cpu(i) { struct device_node *np = cpu_to_l2cache(i); if (!np) @@ -667,6 +668,7 @@ __cpuinit void start_secondary(void *unused) } of_node_put(np); } + put_online_cpus_atomic(); of_node_put(l2_cache); local_irq_enable();