public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: khilman@deeprootsystems•com (Kevin Hilman)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 4/7] ARM: OMAP2+: PM: use power domain functional state in stats counters
Date: Wed, 12 Sep 2012 16:35:10 -0700	[thread overview]
Message-ID: <87ligestld.fsf@deeprootsystems.com> (raw)
In-Reply-To: <1347443732-7411-5-git-send-email-j-pihet@ti.com> (Jean Pihet's message of "Wed, 12 Sep 2012 11:55:29 +0200")

Jean Pihet <jean.pihet@newoldbits•com> writes:

> The PM code uses some counters to keep track of the power domains
> transitions, in order to provide the information to drivers (in
> pwrdm_get_context_loss_count) and to expose the information to
> sysfs for debug purpose.

nit: this is part of debugfs, not sysfs

Otherwise, patch is fine.

> This patch provides the information for each functional state.
>
> Signed-off-by: Jean Pihet <j-pihet@ti•com>

Kevin

> ---
>  arch/arm/mach-omap2/pm-debug.c    |   15 ++++++++-------
>  arch/arm/mach-omap2/powerdomain.c |   12 ++++++------
>  arch/arm/mach-omap2/powerdomain.h |    4 ++--
>  3 files changed, 16 insertions(+), 15 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
> index 814bcd9..8eaa3f2 100644
> --- a/arch/arm/mach-omap2/pm-debug.c
> +++ b/arch/arm/mach-omap2/pm-debug.c
> @@ -53,9 +53,10 @@ enum {
>  	DEBUG_FILE_TIMERS,
>  };
>  
> -static const char pwrdm_state_names[][PWRDM_MAX_PWRSTS] = {
> +static const char pwrdm_state_names[][PWRDM_MAX_FUNC_PWRSTS] = {
>  	"OFF",
> -	"RET",
> +	"OSWR",
> +	"CSWR",
>  	"INA",
>  	"ON"
>  };
> @@ -102,13 +103,13 @@ static int pwrdm_dbg_show_counter(struct powerdomain *pwrdm, void *user)
>  		strncmp(pwrdm->name, "dpll", 4) == 0)
>  		return 0;
>  
> -	if (pwrdm->state != pwrdm_read_pwrst(pwrdm))
> +	if (pwrdm->state != pwrdm_read_fpwrst(pwrdm))
>  		printk(KERN_ERR "pwrdm state mismatch(%s) %d != %d\n",
> -			pwrdm->name, pwrdm->state, pwrdm_read_pwrst(pwrdm));
> +		       pwrdm->name, pwrdm->state, pwrdm_read_fpwrst(pwrdm));
>  
>  	seq_printf(s, "%s (%s)", pwrdm->name,
>  			pwrdm_state_names[pwrdm->state]);
> -	for (i = 0; i < PWRDM_MAX_PWRSTS; i++)
> +	for (i = 0; i < PWRDM_MAX_FUNC_PWRSTS; i++)
>  		seq_printf(s, ",%s:%d", pwrdm_state_names[i],
>  			pwrdm->state_counter[i]);
>  
> @@ -137,7 +138,7 @@ static int pwrdm_dbg_show_timer(struct powerdomain *pwrdm, void *user)
>  	seq_printf(s, "%s (%s)", pwrdm->name,
>  		pwrdm_state_names[pwrdm->state]);
>  
> -	for (i = 0; i < 4; i++)
> +	for (i = 0; i < PWRDM_MAX_FUNC_PWRSTS; i++)
>  		seq_printf(s, ",%s:%lld", pwrdm_state_names[i],
>  			pwrdm->state_timer[i]);
>  
> @@ -211,7 +212,7 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *dir)
>  
>  	t = sched_clock();
>  
> -	for (i = 0; i < 4; i++)
> +	for (i = 0; i < PWRDM_MAX_FUNC_PWRSTS; i++)
>  		pwrdm->state_timer[i] = 0;
>  
>  	pwrdm->timer = t;
> diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
> index 82ae9e9..267241f 100644
> --- a/arch/arm/mach-omap2/powerdomain.c
> +++ b/arch/arm/mach-omap2/powerdomain.c
> @@ -106,7 +106,7 @@ static int _pwrdm_register(struct powerdomain *pwrdm)
>  	list_add(&pwrdm->node, &pwrdm_list);
>  
>  	/* Initialize the powerdomain's state counter */
> -	for (i = 0; i < PWRDM_MAX_PWRSTS; i++)
> +	for (i = 0; i < PWRDM_MAX_FUNC_PWRSTS; i++)
>  		pwrdm->state_counter[i] = 0;
>  
>  	pwrdm->ret_logic_off_counter = 0;
> @@ -114,7 +114,7 @@ static int _pwrdm_register(struct powerdomain *pwrdm)
>  		pwrdm->ret_mem_off_counter[i] = 0;
>  
>  	pwrdm_wait_transition(pwrdm);
> -	pwrdm->state = pwrdm_read_pwrst(pwrdm);
> +	pwrdm->state = pwrdm_read_fpwrst(pwrdm);
>  	pwrdm->state_counter[pwrdm->state] = 1;
>  
>  	pr_debug("powerdomain: registered %s\n", pwrdm->name);
> @@ -149,17 +149,17 @@ static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
>  	if (pwrdm == NULL)
>  		return -EINVAL;
>  
> -	state = pwrdm_read_pwrst(pwrdm);
> +	state = pwrdm_read_fpwrst(pwrdm);
>  
>  	switch (flag) {
>  	case PWRDM_STATE_NOW:
>  		prev = pwrdm->state;
>  		break;
>  	case PWRDM_STATE_PREV:
> -		prev = pwrdm_read_prev_pwrst(pwrdm);
> +		prev = pwrdm_read_prev_fpwrst(pwrdm);
>  		if (pwrdm->state != prev)
>  			pwrdm->state_counter[prev]++;
> -		if (prev == PWRDM_POWER_RET)
> +		if (prev == PWRDM_FUNC_PWRST_OSWR)
>  			_update_logic_membank_counters(pwrdm);
>  		/*
>  		 * If the power domain did not hit the desired state,
> @@ -1414,7 +1414,7 @@ int pwrdm_get_context_loss_count(struct powerdomain *pwrdm)
>  		return -ENODEV;
>  	}
>  
> -	count = pwrdm->state_counter[PWRDM_POWER_OFF];
> +	count = pwrdm->state_counter[PWRDM_FUNC_PWRST_OFF];
>  	count += pwrdm->ret_logic_off_counter;
>  
>  	for (i = 0; i < pwrdm->banks; i++)
> diff --git a/arch/arm/mach-omap2/powerdomain.h b/arch/arm/mach-omap2/powerdomain.h
> index c3dc363..a29caec 100644
> --- a/arch/arm/mach-omap2/powerdomain.h
> +++ b/arch/arm/mach-omap2/powerdomain.h
> @@ -146,7 +146,7 @@ struct powerdomain {
>  	struct list_head voltdm_node;
>  	spinlock_t lock;
>  	int state;
> -	unsigned state_counter[PWRDM_MAX_PWRSTS];
> +	unsigned state_counter[PWRDM_MAX_FUNC_PWRSTS];
>  	unsigned ret_logic_off_counter;
>  	unsigned ret_mem_off_counter[PWRDM_MAX_MEM_BANKS];
>  
> @@ -160,7 +160,7 @@ struct powerdomain {
>  
>  #ifdef CONFIG_PM_DEBUG
>  	s64 timer;
> -	s64 state_timer[PWRDM_MAX_PWRSTS];
> +	s64 state_timer[PWRDM_MAX_FUNC_PWRSTS];
>  #endif
>  };

  reply	other threads:[~2012-09-12 23:35 UTC|newest]

Thread overview: 18+ 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 ` [PATCH 1/7] ARM: OMAP2+: PM: introduce " 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 ` [PATCH 3/7] ARM: OMAP2+: PM: use the functional power states API 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 23:35   ` Kevin Hilman [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-13  7:26     ` 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 ` [PATCH 7/7] ARM: OMAP2+: PM: reorganize the powerdomain API in public and private parts Jean Pihet
2012-09-13  0:11   ` Kevin Hilman
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  7:04   ` Jean Pihet
2012-09-18 16:51     ` Jean Pihet
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=87ligestld.fsf@deeprootsystems.com \
    --to=khilman@deeprootsystems$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox