All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean Pihet <jean.pihet@newoldbits.com>
To: linux-omap@vger.kernel.org, paul@pwsan.com,
	linux-arm-kernel@lists.infradead.org, khilman@ti.com,
	Benoit Cousson <b-cousson@ti.com>,
	Santosh Shilimkar <santosh.shilimkar@ti.com>,
	Nishanth Menon <nm@ti.com>, Rajendra Nayak <rnayak@ti.com>
Cc: Jean Pihet <j-pihet@ti.com>
Subject: [PATCH 5/7] ARM: OMAP2+: PM debug: trace the functional power domains states
Date: Wed, 12 Sep 2012 11:55:30 +0200	[thread overview]
Message-ID: <1347443732-7411-6-git-send-email-j-pihet@ti.com> (raw)
In-Reply-To: <1347443732-7411-1-git-send-email-j-pihet@ti.com>

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 <paul@pwsan.com>
Signed-off-by: Jean Pihet <j-pihet@ti.com>
---
 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;
 }
-- 
1.7.7.6


WARNING: multiple messages have this Message-ID (diff)
From: jean.pihet@newoldbits.com (Jean Pihet)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/7] ARM: OMAP2+: PM debug: trace the functional power domains states
Date: Wed, 12 Sep 2012 11:55:30 +0200	[thread overview]
Message-ID: <1347443732-7411-6-git-send-email-j-pihet@ti.com> (raw)
In-Reply-To: <1347443732-7411-1-git-send-email-j-pihet@ti.com>

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 <paul@pwsan.com>
Signed-off-by: Jean Pihet <j-pihet@ti.com>
---
 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;
 }
-- 
1.7.7.6

  parent reply	other threads:[~2012-09-12  9:55 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-12  9:55 [PATCH v6 0/7] ARM: OMAP2+: PM: introduce the power domains functional states Jean Pihet
2012-09-12  9:55 ` Jean Pihet
2012-09-12  9:55 ` [PATCH 1/7] ARM: OMAP2+: PM: introduce " Jean Pihet
2012-09-12  9:55   ` Jean Pihet
2012-09-12  9:55 ` [PATCH 2/7] ARM: OMAP2+: PM: add a lock to protect the powerdomains next state Jean Pihet
2012-09-12  9:55   ` Jean Pihet
2012-09-12  9:55 ` [PATCH 3/7] ARM: OMAP2+: PM: use the functional power states API Jean Pihet
2012-09-12  9:55   ` Jean Pihet
2012-09-12  9:55 ` [PATCH 4/7] ARM: OMAP2+: PM: use power domain functional state in stats counters Jean Pihet
2012-09-12  9:55   ` Jean Pihet
2012-09-12 23:35   ` Kevin Hilman
2012-09-12 23:35     ` Kevin Hilman
2012-09-12  9:55 ` Jean Pihet [this message]
2012-09-12  9:55   ` [PATCH 5/7] ARM: OMAP2+: PM debug: trace the functional power domains states Jean Pihet
2012-09-12 23:47   ` Kevin Hilman
2012-09-12 23:47     ` Kevin Hilman
2012-09-13  7:26     ` Jean Pihet
2012-09-13  7:26       ` Jean Pihet
2012-09-13  7:31     ` Jean Pihet
2012-09-13  7:31       ` Jean Pihet
2012-09-12  9:55 ` [PATCH 6/7] ARM: OMAP2+: powerdomain: add error logs Jean Pihet
2012-09-12  9:55   ` Jean Pihet
2012-09-12  9:55 ` [PATCH 7/7] ARM: OMAP2+: PM: reorganize the powerdomain API in public and private parts Jean Pihet
2012-09-12  9:55   ` Jean Pihet
2012-09-13  0:11   ` Kevin Hilman
2012-09-13  0:11     ` Kevin Hilman
2012-09-13  7:29     ` Jean Pihet
2012-09-13  7:29       ` Jean Pihet
2012-09-13  0:34 ` [PATCH v6 0/7] ARM: OMAP2+: PM: introduce the power domains functional states Kevin Hilman
2012-09-13  0:34   ` Kevin Hilman
2012-09-13  7:04   ` Jean Pihet
2012-09-13  7:04     ` Jean Pihet
2012-09-18 16:51     ` Jean Pihet
2012-09-18 16:51       ` Jean Pihet
2012-09-26 21:28 ` Paul Walmsley
2012-09-26 21:28   ` Paul Walmsley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1347443732-7411-6-git-send-email-j-pihet@ti.com \
    --to=jean.pihet@newoldbits.com \
    --cc=b-cousson@ti.com \
    --cc=j-pihet@ti.com \
    --cc=khilman@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=paul@pwsan.com \
    --cc=rnayak@ti.com \
    --cc=santosh.shilimkar@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.