Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753140Ab3FWNu6 (ORCPT ); Sun, 23 Jun 2013 09:50:58 -0400 Received: from e28smtp05.in.ibm.com ([122.248.162.5]:39749 "EHLO e28smtp05.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753122Ab3FWNuu (ORCPT ); Sun, 23 Jun 2013 09:50:50 -0400 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 Cc: rostedt@goodmis.org, wangyun@linux.vnet.ibm.com, xiaoguangrong@linux.vnet.ibm.com, sbw@mit.edu, fweisbec@gmail.com, zhong@linux.vnet.ibm.com, nikunj@linux.vnet.ibm.com, srivatsa.bhat@linux.vnet.ibm.com, linux-pm@vger.kernel.org, linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Herrenschmidt , Paul Mackerras , Kumar Gala , Zhao Chenhui , Thomas Gleixner , linuxppc-dev@lists.ozlabs.org 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> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13062313-8256-0000-0000-0000080B6693 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1776 Lines: 48 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(); -- 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/