public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@deeprootsystems.com>
To: Tero Kristo <tero.kristo@nokia.com>
Cc: linux-omap@vger.kernel.org
Subject: Re: [PATCHv6 9/9] OMAP3: PM: Added support for suspending to INACTIVE state
Date: Mon, 01 Mar 2010 15:43:18 -0800	[thread overview]
Message-ID: <873a0j8v6x.fsf@deeprootsystems.com> (raw)
In-Reply-To: <1265999265-4363-10-git-send-email-tero.kristo@nokia.com> (Tero Kristo's message of "Fri\, 12 Feb 2010 20\:27\:45 +0200")

Tero Kristo <tero.kristo@nokia.com> writes:

> From: Tero Kristo <tero.kristo@nokia.com>
>
> With the new support functions this is now possible. Suspending to INACTIVE
> is useful for testing purposes.
>
> Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
> ---
>  arch/arm/mach-omap2/pm34xx.c |   11 ++++++-----
>  1 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
> index cdbedcf..41d6cc3 100644
> --- a/arch/arm/mach-omap2/pm34xx.c
> +++ b/arch/arm/mach-omap2/pm34xx.c
> @@ -633,11 +633,12 @@ int set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
>  	if (pwrdm == NULL || IS_ERR(pwrdm))
>  		return -EINVAL;
>  
> -	while (!(pwrdm->pwrsts & (1 << state))) {
> -		if (state == PWRDM_POWER_OFF)
> -			return ret;
> -		state--;
> -	}

The comment above set_pwrdm_state() says only ON & RET are supported.
Please update that comment as well.


> +	if (state != PWRDM_POWER_INACTIVE)
> +		while (!(pwrdm->pwrsts & (1 << state))) {
> +			if (state == PWRDM_POWER_OFF)
> +				return ret;
> +			state--;
> +		}

I think all powerdomains can be inactive right?

I think it would be cleaner to just have all the pwrdm->pwrsts fields
include intactive as a valid option.

Something like the patch below.  IIRC, you did something like this in
one of the earlier versions of the patch.

Kevin

diff --git a/arch/arm/plat-omap/include/plat/powerdomain.h b/arch/arm/plat-omap/include/plat/powerdomain.h
index a1ecd47..c692472 100644
--- a/arch/arm/plat-omap/include/plat/powerdomain.h
+++ b/arch/arm/plat-omap/include/plat/powerdomain.h
@@ -31,17 +31,17 @@
 #define PWRDM_MAX_PWRSTS	4
 
 /* Powerdomain allowable state bitfields */
-#define PWRSTS_OFF_ON		((1 << PWRDM_POWER_OFF) | \
+#define PWRSTS_ON		((1 << PWRDM_POWER_INACTIVE) | \
 				 (1 << PWRDM_POWER_ON))
 
+#define PWRSTS_OFF_ON		((1 << PWRDM_POWER_OFF) | PWRSTS_ON)
+
 #define PWRSTS_OFF_RET		((1 << PWRDM_POWER_OFF) | \
 				 (1 << PWRDM_POWER_RET))
 
-#define PWRSTS_RET_ON		((1 << PWRDM_POWER_RET) | \
-				 (1 << PWRDM_POWER_ON))
-
-#define PWRSTS_OFF_RET_ON	(PWRSTS_OFF_RET | (1 << PWRDM_POWER_ON))
+#define PWRSTS_RET_ON		((1 << PWRDM_POWER_RET) | PWRSTS_ON)
 
+#define PWRSTS_OFF_RET_ON	(PWRSTS_OFF_RET | PWRSTS_ON)
 
 /* Powerdomain flags */
 #define PWRDM_HAS_HDWR_SAR	(1 << 0) /* hardware save-and-restore support */

  reply	other threads:[~2010-03-01 23:43 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-12 18:27 [PATCHv6 0/9] Refreshed idlestatus patches with minor fixes Tero Kristo
2010-02-12 18:27 ` [PATCHv6 1/9] OMAP3: PM: Added support functions for omap3 pwrdm handling Tero Kristo
2010-02-12 18:27   ` [PATCHv6 2/9] OMAP3: PM: Added support for INACTIVE and ON states in omap_sram_idle Tero Kristo
2010-02-12 18:27     ` [PATCHv6 3/9] OMAP3: CPUidle: Fixed support for ON / INACTIVE states Tero Kristo
2010-02-12 18:27       ` [PATCHv6 4/9] OMAP3: PM: Removed pwrdm state hacking from omap_sram_idle Tero Kristo
2010-02-12 18:27         ` [PATCHv6 5/9] OMAP3: Clock: Added IDLEST definitions for SGX Tero Kristo
2010-02-12 18:27           ` [PATCHv6 6/9] OMAP: Powerdomains: Add support for checking if pwrdm/clkdm can idle Tero Kristo
2010-02-12 18:27             ` [PATCHv6 7/9] OMAP3: CPUidle: Added peripheral pwrdm checks into bm check Tero Kristo
2010-02-12 18:27               ` [PATCHv6 8/9] OMAP3: CPUidle: Fixed off-mode support to fall-back to proper C state Tero Kristo
2010-02-12 18:27                 ` [PATCHv6 9/9] OMAP3: PM: Added support for suspending to INACTIVE state Tero Kristo
2010-03-01 23:43                   ` Kevin Hilman [this message]
2010-03-02 10:12                     ` Tero.Kristo
2010-03-08 17:16                       ` Kevin Hilman
2010-03-09  8:07                         ` Tero.Kristo
2010-03-09 19:02                           ` Kevin Hilman
2010-03-01 23:32             ` [PATCHv6 6/9] OMAP: Powerdomains: Add support for checking if pwrdm/clkdm can idle Kevin Hilman
2010-03-01 23:31         ` [PATCHv6 4/9] OMAP3: PM: Removed pwrdm state hacking from omap_sram_idle Kevin Hilman
2010-03-02 10:13           ` Tero.Kristo
2010-03-01 23:17   ` [PATCHv6 1/9] OMAP3: PM: Added support functions for omap3 pwrdm handling Kevin Hilman
2010-03-02 10:20     ` Tero.Kristo
2010-03-02 17:14       ` Kevin Hilman
2010-03-01 23:17 ` [PATCHv6 0/9] Refreshed idlestatus patches with minor fixes Kevin Hilman

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=873a0j8v6x.fsf@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=tero.kristo@nokia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox