From patchwork Fri Aug 10 14:05:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 1305741 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 26A313FC66 for ; Fri, 10 Aug 2012 14:06:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756954Ab2HJOGW (ORCPT ); Fri, 10 Aug 2012 10:06:22 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:51296 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756320Ab2HJOGV (ORCPT ); Fri, 10 Aug 2012 10:06:21 -0400 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id q7AE6FoZ013779; Fri, 10 Aug 2012 09:06:15 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q7AE6FUS030970; Fri, 10 Aug 2012 09:06:15 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by dfle73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.1.323.3; Fri, 10 Aug 2012 09:06:15 -0500 Received: from rockdesk.tieu.ti.com (h68-11.vpn.ti.com [172.24.68.11]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id q7AE6CVA023454; Fri, 10 Aug 2012 09:06:13 -0500 From: Roger Quadros To: CC: , , , , , Roger Quadros Subject: [PATCH] perf: Use pre-empt safe cpu_get/put insted of smp_processor_id Date: Fri, 10 Aug 2012 17:05:58 +0300 Message-ID: <1344607558-15481-1-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 1.7.4.1 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.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 Signed-off-by: Roger Quadros --- arch/arm/mach-omap2/clock.c | 9 ++++++--- arch/arm/mach-omap2/pm34xx.c | 12 ++++++++---- arch/arm/mach-omap2/powerdomain.c | 6 ++++-- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index ea3f565..06747b6 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c @@ -285,7 +285,8 @@ 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, get_cpu()); + put_cpu(); clk->ops->disable(clk); } @@ -339,7 +340,8 @@ 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, get_cpu()); + put_cpu(); ret = clk->ops->enable(clk); if (ret) { WARN(1, "clock: %s: could not enable: %d\n", @@ -380,7 +382,8 @@ 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, get_cpu()); + put_cpu(); ret = clk->set_rate(clk, rate); } diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index e4fc88c..81fec2e 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -357,18 +357,22 @@ void omap_sram_idle(void) static void omap3_pm_idle(void) { + unsigned 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 = get_cpu(); + 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); + put_cpu(); out: local_fiq_enable(); diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index 69b36e1..138bf86 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c @@ -169,7 +169,8 @@ 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()); + get_cpu()); + put_cpu(); } break; default: @@ -491,7 +492,8 @@ 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()); + get_cpu()); + put_cpu(); /* Program the pwrdm desired target state */ ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst); }