From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e28smtp02.in.ibm.com (e28smtp02.in.ibm.com [122.248.162.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "e28smtp02.in.ibm.com", Issuer "GeoTrust SSL CA" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 7EE6D2C0B8B for ; Wed, 26 Jun 2013 06:37:01 +1000 (EST) Received: from /spool/local by e28smtp02.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 26 Jun 2013 01:59:03 +0530 Received: from d28relay04.in.ibm.com (d28relay04.in.ibm.com [9.184.220.61]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id 1034A125804E for ; Wed, 26 Jun 2013 02:06:00 +0530 (IST) Received: from d28av05.in.ibm.com (d28av05.in.ibm.com [9.184.220.67]) by d28relay04.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r5PKaqir26738928 for ; Wed, 26 Jun 2013 02:06:52 +0530 Received: from d28av05.in.ibm.com (loopback [127.0.0.1]) by d28av05.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r5PKasq9009824 for ; Wed, 26 Jun 2013 06:36:56 +1000 From: "Srivatsa S. Bhat" Subject: [PATCH v2 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: Wed, 26 Jun 2013 02:03:39 +0530 Message-ID: <20130625203339.16593.60632.stgit@srivatsabhat.in.ibm.com> In-Reply-To: <20130625202452.16593.22810.stgit@srivatsabhat.in.ibm.com> References: <20130625202452.16593.22810.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 S. Bhat" , 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();