From patchwork Sun Dec 9 17:53:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Walmsley X-Patchwork-Id: 1854031 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id D9D2DDF230 for ; Sun, 9 Dec 2012 17:58:36 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Thl5W-0003BJ-HF; Sun, 09 Dec 2012 17:54:50 +0000 Received: from utopia.booyaka.com ([74.50.51.50]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Thl5R-00038E-A1 for linux-arm-kernel@lists.infradead.org; Sun, 09 Dec 2012 17:54:46 +0000 Received: (qmail 2360 invoked by uid 1019); 9 Dec 2012 17:54:43 -0000 MBOX-Line: From nobody Sun Dec 9 10:53:09 2012 Subject: [PATCH 03/12] ARM: OMAP2+: PM debug: trace the functional power domains states To: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org From: Paul Walmsley Date: Sun, 09 Dec 2012 10:53:09 -0700 Message-ID: <20121209175301.6933.81855.stgit@dusk.lan> In-Reply-To: <20121209174545.6933.59371.stgit@dusk.lan> References: <20121209174545.6933.59371.stgit@dusk.lan> User-Agent: StGit/0.16-37-g27ac3 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121209_125445_603176_95384D69 X-CRM114-Status: GOOD ( 11.74 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.7 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: Jean Pihet 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 From: Jean Pihet Trace the power domain transitions using the functional power states, which include the power and logic states. Signed-off-by: Jean Pihet [paul@pwsan.com: split the fix that was originally part of this patch into a separate patch] Signed-off-by: Paul Walmsley --- arch/arm/mach-omap2/powerdomain.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index 18f33de..2c732b6 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c @@ -881,13 +881,8 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst) pr_debug("powerdomain: %s: setting next powerstate to %0x\n", pwrdm->name, 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()); - /* Program the pwrdm desired target state */ + if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst); - } return ret; } @@ -1571,6 +1566,9 @@ int pwrdm_set_next_fpwrst(struct powerdomain *pwrdm, u8 fpwrst) pr_debug("%s: set fpwrst %0x to pwrdm %s\n", __func__, fpwrst, pwrdm->name); + /* Trace the pwrdm desired target state */ + trace_power_domain_target(pwrdm->name, fpwrst, smp_processor_id()); + pwrdm_lock(pwrdm); ret = _set_logic_retst_and_pwrdm_pwrst(pwrdm, logic, pwrst); pwrdm_unlock(pwrdm); @@ -1658,6 +1656,10 @@ int pwrdm_set_fpwrst(struct powerdomain *pwrdm, enum pwrdm_func_state fpwrst) if (next_fpwrst == fpwrst) goto psf_out; + /* Trace the pwrdm desired target state */ + trace_power_domain_target(pwrdm->name, next_fpwrst, + smp_processor_id()); + sleep_switch = _pwrdm_save_clkdm_state_and_activate(pwrdm, pwrst, &hwsup);