From patchwork Wed Sep 12 11:50:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 1443281 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (unknown [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 7DA8D3FE79 for ; Wed, 12 Sep 2012 12:01:39 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TBlT5-0007jk-60; Wed, 12 Sep 2012 11:50:55 +0000 Received: from comal.ext.ti.com ([198.47.26.152]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TBlSx-0007gp-PO for linux-arm-kernel@lists.infradead.org; Wed, 12 Sep 2012 11:50:49 +0000 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id q8CBoMgs011453; Wed, 12 Sep 2012 06:50:22 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8CBoMVR020394; Wed, 12 Sep 2012 06:50:22 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by dfle72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.1.323.3; Wed, 12 Sep 2012 06:50:22 -0500 Received: from rockdesk.emea.dhcp.ti.com (rockdesk.emea.dhcp.ti.com [137.167.41.72]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8CBoKet030447; Wed, 12 Sep 2012 06:50:21 -0500 From: Roger Quadros To: Subject: [PATCH] perf: Use raw_smp_processor_id insted of smp_processor_id Date: Wed, 12 Sep 2012 14:50:10 +0300 Message-ID: <1347450610-4342-1-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 1.7.4.1 MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -7.3 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [198.47.26.152 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.4 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linux-omap@vger.kernel.org, sboyd@codeaurora.org, jean.pihet@newoldbits.com, linux-arm-kernel@lists.infradead.org, Roger Quadros X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org gets rid of below messages with CONFIG_DEBUG_PREEMPT enabled [ 28.832916] debug_smp_processor_id: 18 callbacks suppressed [ 28.832946] BUG: using smp_processor_id() in preemptible [00000000] code: modprobe/1763 [ 28.841491] caller is pwrdm_set_next_pwrst+0x54/0x120 Tested with perf on OMAP4 Panda. Signed-off-by: Roger Quadros --- arch/arm/mach-omap2/clock.c | 6 +++--- arch/arm/mach-omap2/pm34xx.c | 11 +++++++---- arch/arm/mach-omap2/powerdomain.c | 4 ++-- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index ea3f565..2765acd 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c @@ -285,7 +285,7 @@ void omap2_clk_disable(struct clk *clk) pr_debug("clock: %s: disabling in hardware\n", clk->name); if (clk->ops && clk->ops->disable) { - trace_clock_disable(clk->name, 0, smp_processor_id()); + trace_clock_disable(clk->name, 0, raw_smp_processor_id()); clk->ops->disable(clk); } @@ -339,7 +339,7 @@ int omap2_clk_enable(struct clk *clk) } if (clk->ops && clk->ops->enable) { - trace_clock_enable(clk->name, 1, smp_processor_id()); + trace_clock_enable(clk->name, 1, raw_smp_processor_id()); ret = clk->ops->enable(clk); if (ret) { WARN(1, "clock: %s: could not enable: %d\n", @@ -380,7 +380,7 @@ int omap2_clk_set_rate(struct clk *clk, unsigned long rate) /* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */ if (clk->set_rate) { - trace_clock_set_rate(clk->name, rate, smp_processor_id()); + trace_clock_set_rate(clk->name, rate, raw_smp_processor_id()); ret = clk->set_rate(clk, rate); } diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 05bd8f0..d384068 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -346,18 +346,21 @@ void omap_sram_idle(void) static void omap3_pm_idle(void) { + int cpu; + local_fiq_disable(); if (omap_irq_pending()) goto out; - trace_power_start(POWER_CSTATE, 1, smp_processor_id()); - trace_cpu_idle(1, smp_processor_id()); + cpu = raw_smp_processor_id(); + trace_power_start(POWER_CSTATE, 1, cpu); + trace_cpu_idle(1, cpu); omap_sram_idle(); - trace_power_end(smp_processor_id()); - trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id()); + trace_power_end(cpu); + trace_cpu_idle(PWR_EVENT_EXIT, cpu); out: local_fiq_enable(); diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index 69b36e1..f1d0d69 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c @@ -169,7 +169,7 @@ static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag) ((state & OMAP_POWERSTATE_MASK) << 8) | ((prev & OMAP_POWERSTATE_MASK) << 0)); trace_power_domain_target(pwrdm->name, trace_state, - smp_processor_id()); + raw_smp_processor_id()); } break; default: @@ -491,7 +491,7 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst) if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) { /* Trace the pwrdm desired target state */ trace_power_domain_target(pwrdm->name, pwrst, - smp_processor_id()); + raw_smp_processor_id()); /* Program the pwrdm desired target state */ ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst); }