From patchwork Tue Jun 25 20:33:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Srivatsa S. Bhat" X-Patchwork-Id: 2780681 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7326AC0AB1 for ; Tue, 25 Jun 2013 20:39:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 73265204CE for ; Tue, 25 Jun 2013 20:39:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 727A6204C9 for ; Tue, 25 Jun 2013 20:39:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754084Ab3FYUhI (ORCPT ); Tue, 25 Jun 2013 16:37:08 -0400 Received: from e28smtp07.in.ibm.com ([122.248.162.7]:36611 "EHLO e28smtp07.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754143Ab3FYUhD (ORCPT ); Tue, 25 Jun 2013 16:37:03 -0400 Received: from /spool/local by e28smtp07.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 26 Jun 2013 01:59:58 +0530 Received: from d28dlp02.in.ibm.com (9.184.220.127) by e28smtp07.in.ibm.com (192.168.1.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 26 Jun 2013 01:59:54 +0530 Received: from d28relay01.in.ibm.com (d28relay01.in.ibm.com [9.184.220.58]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id 59664394004E; Wed, 26 Jun 2013 02:06:57 +0530 (IST) Received: from d28av05.in.ibm.com (d28av05.in.ibm.com [9.184.220.67]) by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r5PKbDLK22216722; Wed, 26 Jun 2013 02:07:13 +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 r5PKasqJ009824; Wed, 26 Jun 2013 06:36:57 +1000 Received: from srivatsabhat.in.ibm.com ([9.79.199.80]) by d28av05.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r5PKarOO009704; Wed, 26 Jun 2013 06:36:53 +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 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, "Srivatsa S. Bhat" 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> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13062520-8878-0000-0000-000007B0AC08 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(+) -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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();