From patchwork Wed Sep 12 09:55:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean Pihet X-Patchwork-Id: 1441851 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (unknown [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 6130DDF28C for ; Wed, 12 Sep 2012 10:06:18 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TBjgT-0006p6-6b; Wed, 12 Sep 2012 09:56:37 +0000 Received: from mail-wg0-f49.google.com ([74.125.82.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TBjfo-0006hQ-1I for linux-arm-kernel@lists.infradead.org; Wed, 12 Sep 2012 09:55:59 +0000 Received: by wgbdt14 with SMTP id dt14so844359wgb.18 for ; Wed, 12 Sep 2012 02:55:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=Pf+5pEfJXXfq+wJk3GR6GIcCeZq3eOu+vMPL8ZmdUXs=; b=B3EDdVNZulg6vpRNdFOsyvo65GOls5Zu1LrBbNkDAuZyRzvDXCmpyC708AgsbgmTWE TKJ/scGhFlDyxfH6zCVV24P0yS2GhRVId5iq7hegFam/fGjNhhwtjr6wJ7D1PuflN5pH TQylupipn0DzoINhPlKvkBFyt9j4cnKKwAmznLW8cKimUtJWl6BNhwNoJYh59CJYEuca lQNEeRZKH/Xjli3xWdZwXiNAx0Pf9YgV7m7Vzp0EgK739MbbJpYJswBCKQbADePYnYJV eUkDRWcWrJ48702U/ReCOTnRsfqF2QH3wHwwzdskg5wA7NcrgdPnQMAEt7Ee9Ldcu+oN oclQ== Received: by 10.216.198.10 with SMTP id u10mr11577044wen.80.1347443754156; Wed, 12 Sep 2012 02:55:54 -0700 (PDT) Received: from localhost.localdomain (52.60-66-87.adsl-dyn.isp.belgacom.be. [87.66.60.52]) by mx.google.com with ESMTPS id w7sm7312997wiz.0.2012.09.12.02.55.53 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 12 Sep 2012 02:55:53 -0700 (PDT) From: Jean Pihet To: linux-omap@vger.kernel.org, paul@pwsan.com, linux-arm-kernel@lists.infradead.org, khilman@ti.com, Benoit Cousson , Santosh Shilimkar , Nishanth Menon , Rajendra Nayak Subject: [PATCH 5/7] ARM: OMAP2+: PM debug: trace the functional power domains states Date: Wed, 12 Sep 2012 11:55:30 +0200 Message-Id: <1347443732-7411-6-git-send-email-j-pihet@ti.com> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1347443732-7411-1-git-send-email-j-pihet@ti.com> References: <1347443732-7411-1-git-send-email-j-pihet@ti.com> X-Gm-Message-State: ALoCoQn/p3ILLteBc+aBKa9wYy3Ate3EBxDryaRbzZ5/a/y2a8qVBzd6nnCsVFSP7ogT1/P+NZa7 X-Spam-Note: CRM114 invocation failed 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.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.49 listed in list.dnswl.org] -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: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Trace the power domain transitions using the functional power states, which include the power and logic states. While at it, fix the trace in the case a power domain did not hit the desired state, as reported by Paul Walmsley. Reported-by: Paul Walmsley Signed-off-by: Jean Pihet --- arch/arm/mach-omap2/powerdomain.c | 23 +++++++++++++---------- 1 files changed, 13 insertions(+), 10 deletions(-) diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index 267241f..2277ad3 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c @@ -144,7 +144,7 @@ static void _update_logic_membank_counters(struct powerdomain *pwrdm) static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag) { - int prev, state, trace_state = 0; + int prev, next, state, trace_state; if (pwrdm == NULL) return -EINVAL; @@ -165,10 +165,10 @@ static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag) * If the power domain did not hit the desired state, * generate a trace event with both the desired and hit states */ - if (state != prev) { + next = pwrdm_read_next_fpwrst(pwrdm); + if (next != prev) { trace_state = (PWRDM_TRACE_STATES_FLAG | - ((state & OMAP_POWERSTATE_MASK) << 8) | - ((prev & OMAP_POWERSTATE_MASK) << 0)); + (next << 8) | (prev << 0)); trace_power_domain_target(pwrdm->name, trace_state, smp_processor_id()); } @@ -723,6 +723,10 @@ int pwrdm_set_fpwrst(struct powerdomain *pwrdm, enum pwrdm_func_state fpwrst) } } + /* Trace the pwrdm desired target state */ + trace_power_domain_target(pwrdm->name, next_fpwrst, + smp_processor_id()); + if (logic != pwrdm_read_logic_retst(pwrdm)) pwrdm_set_logic_retst(pwrdm, logic); @@ -776,6 +780,10 @@ int pwrdm_set_next_fpwrst(struct powerdomain *pwrdm, spin_lock_irqsave(&pwrdm->lock, flags); + /* Trace the pwrdm desired target state */ + trace_power_domain_target(pwrdm->name, fpwrst, + smp_processor_id()); + ret = pwrdm_set_logic_retst(pwrdm, logic); if (ret) pr_err("%s: unable to set logic state %0x of powerdomain: %s\n", @@ -821,13 +829,8 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst) pr_debug("powerdomain: setting next powerstate for %s 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; }