From: Kevin Hilman <khilman@deeprootsystems.com>
To: Tero Kristo <tero.kristo@nokia.com>
Cc: linux-omap@vger.kernel.org
Subject: Re: [PATCH 02/17] OMAP3: PM: Dynamic check for CORE target state
Date: Tue, 20 Oct 2009 09:16:44 -0700 [thread overview]
Message-ID: <871vkyniqb.fsf@deeprootsystems.com> (raw)
In-Reply-To: <1255690150-16853-3-git-send-email-tero.kristo@nokia.com> (Tero Kristo's message of "Fri\, 16 Oct 2009 13\:48\:55 +0300")
Tero Kristo <tero.kristo@nokia.com> writes:
> From: Tero Kristo <tero.kristo@nokia.com>
>
> Sleep code will now check if core will actually enter power save state or
> not. This is needed so that PER domain does not enter retention / off while
> core stays on and thus preventing I/O pad wakeups.
>
> This also optimizes core context save and restore logic, it will skip
> saving / restoring core context when this is requested but not needed.
I understand this being useful to save an extra save/restore but not
sure about the wakeup issue.
If CORE stays ON, then yes, IO pad will not be armed so IOpad wakeups
will not work. But module level wakeups should work fine. It seems
the bug is actually that module level wakeups are not properly
configured.
There were definitely problems in the PM branch with module level
wakeups. We now have fixes at least for GPIO and UART3 module level
wakeups which were found to be broken if CORE was left on.
This is easy enough to test/debug by forcing CORE to say on:
# echo 3 > /debug/pm_debug/core_pwrdm/suspend
going into suspend and testing the various wakeup sources.
Kevin
> Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
> Signed-off-by: Jouni Hogander <jouni.hogander@nokia.com>
> ---
> arch/arm/mach-omap2/cm.h | 1 +
> arch/arm/mach-omap2/pm34xx.c | 46 +++++++++++++++++++++++++++++++++++++++++-
> 2 files changed, 46 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/cm.h b/arch/arm/mach-omap2/cm.h
> index a2fcfcc..715ab14 100644
> --- a/arch/arm/mach-omap2/cm.h
> +++ b/arch/arm/mach-omap2/cm.h
> @@ -76,6 +76,7 @@
> #define OMAP3430ES2_CM_CLKEN2 0x0004
> #define OMAP3430ES2_CM_FCLKEN3 0x0008
> #define OMAP3430_CM_IDLEST_PLL CM_IDLEST2
> +#define OMAP3430_CM_IDLEST3 0x0028
> #define OMAP3430_CM_AUTOIDLE_PLL CM_AUTOIDLE2
> #define OMAP3430ES2_CM_AUTOIDLE2_PLL CM_AUTOIDLE2
> #define OMAP3430_CM_CLKSEL1 CM_CLKSEL
> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
> index 5e2ef63..e8704a6 100644
> --- a/arch/arm/mach-omap2/pm34xx.c
> +++ b/arch/arm/mach-omap2/pm34xx.c
> @@ -64,6 +64,28 @@ u32 sleep_while_idle;
> u32 wakeup_timer_seconds;
> u32 voltage_off_while_idle;
>
> +/* IDLEST bitmasks for core status checks */
> +#define CORE_IDLEST1_ALL (\
> + OMAP3430ES2_ST_MMC3_MASK|OMAP3430_ST_ICR_MASK|\
> + OMAP3430_ST_AES2_MASK|OMAP3430_ST_SHA12_MASK|\
> + OMAP3430_ST_DES2_MASK|OMAP3430_ST_MMC2_MASK|\
> + OMAP3430_ST_MMC1_MASK|OMAP3430_ST_MSPRO_MASK|\
> + OMAP3430_ST_HDQ_MASK|OMAP3430_ST_MCSPI4_MASK|\
> + OMAP3430_ST_MCSPI3_MASK|OMAP3430_ST_MCSPI2_MASK|\
> + OMAP3430_ST_MCSPI1_MASK|OMAP3430_ST_I2C3_MASK|\
> + OMAP3430_ST_I2C2_MASK|OMAP3430_ST_I2C1_MASK|\
> + OMAP3430_ST_GPT11_MASK|OMAP3430_ST_GPT10_MASK|\
> + OMAP3430_ST_MCBSP5_MASK|OMAP3430_ST_MCBSP1_MASK|\
> + OMAP3430ES2_ST_HSOTGUSB_STDBY_MASK|\
> + OMAP3430ES2_ST_SSI_IDLE_MASK|OMAP3430_ST_SDMA_MASK|\
> + OMAP3430_ST_SSI_STDBY_MASK|OMAP3430_ST_D2D_MASK)
> +#define CORE_IDLEST2_ALL (\
> + OMAP3430_ST_PKA_MASK|OMAP3430_ST_AES1_MASK|\
> + OMAP3430_ST_RNG_MASK|OMAP3430_ST_SHA11_MASK|\
> + OMAP3430_ST_DES1_MASK)
> +#define CORE_IDLEST3_ALL (\
> + OMAP3430ES2_ST_USBTLL_MASK|OMAP3430ES2_ST_CPEFUSE_MASK)
> +
> struct power_state {
> struct powerdomain *pwrdm;
> u32 next_state;
> @@ -408,6 +430,7 @@ void omap_sram_idle(void)
> int core_prev_state, per_prev_state;
> u32 sdrc_pwr = 0;
> int per_state_modified = 0;
> + int core_saved_state = PWRDM_POWER_ON;
>
> if (!_omap_sram_idle)
> return;
> @@ -439,9 +462,28 @@ void omap_sram_idle(void)
> if (pwrdm_read_pwrst(neon_pwrdm) == PWRDM_POWER_ON)
> pwrdm_set_next_pwrst(neon_pwrdm, mpu_next_state);
>
> + /*
> + * Check whether core will enter idle or not. This is needed
> + * because I/O pad wakeup will fail if core stays on and PER
> + * enters off. This will also prevent unnecessary core context
> + * save / restore.
> + */
> + core_next_state = pwrdm_read_next_pwrst(core_pwrdm);
> + if (core_next_state < PWRDM_POWER_ON) {
> + core_saved_state = core_next_state;
> + if ((cm_read_mod_reg(CORE_MOD, CM_IDLEST1) & CORE_IDLEST1_ALL)
> + != CORE_IDLEST1_ALL ||
> + (cm_read_mod_reg(CORE_MOD, CM_IDLEST2) & CORE_IDLEST2_ALL)
> + != CORE_IDLEST2_ALL ||
> + (cm_read_mod_reg(CORE_MOD, OMAP3430_CM_IDLEST3) &
> + CORE_IDLEST3_ALL) != CORE_IDLEST3_ALL) {
> + core_next_state = PWRDM_POWER_ON;
> + pwrdm_set_next_pwrst(core_pwrdm, PWRDM_POWER_ON);
> + }
> + }
> +
> /* PER */
> per_next_state = pwrdm_read_next_pwrst(per_pwrdm);
> - core_next_state = pwrdm_read_next_pwrst(core_pwrdm);
> if (per_next_state < PWRDM_POWER_ON) {
> omap_uart_prepare_idle(2);
> omap2_gpio_prepare_for_idle(per_next_state);
> @@ -539,6 +581,8 @@ void omap_sram_idle(void)
> enable_smartreflex(SR1);
> enable_smartreflex(SR2);
> }
> + if (core_saved_state != core_next_state)
> + pwrdm_set_next_pwrst(core_pwrdm, core_saved_state);
>
> /* PER */
> if (per_next_state < PWRDM_POWER_ON) {
> --
> 1.5.4.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2009-10-20 16:16 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-16 10:48 [PATCH 00/17] Misc PM patches Tero Kristo
2009-10-16 10:48 ` [PATCH 01/17] PM: fix suspend control for IVA2 Tero Kristo
2009-10-16 10:48 ` [PATCH 02/17] OMAP3: PM: Dynamic check for CORE target state Tero Kristo
2009-10-16 10:48 ` [PATCH 03/17] PM: Block CORE off when DSS is active Tero Kristo
2009-10-16 10:48 ` [PATCH 04/17] OMAP3: PM: Do not enable IO wake-up on boot Tero Kristo
2009-10-16 10:48 ` [PATCH 05/17] OMAP:PM: Precedence fix Tero Kristo
2009-10-16 10:48 ` [PATCH 06/17] OMAP3: PM: Added next state check for IVA2, USB and PER into idle loop Tero Kristo
2009-10-16 10:49 ` [PATCH 07/17] OMAP3: Disable Smartreflex before pwrdm enters RET Tero Kristo
2009-10-16 10:49 ` [PATCH 08/17] OMAP2/3: GPTIMER: Clear pending interrupts when entering suspend Tero Kristo
2009-10-16 10:49 ` [PATCH 09/17] OMAP3: PM: Ack pending interrupts before " Tero Kristo
2009-10-16 10:49 ` [PATCH 10/17] OMAP3: PM: Enable system control module autoidle Tero Kristo
2009-10-16 10:49 ` [PATCH 11/17] Make USBHOST powerdomain go to sleep after warm reset Tero Kristo
2009-10-16 10:49 ` [PATCH 12/17] OMAP2/3: Do not enable AUTOIDLE in interrupt controller Tero Kristo
2009-10-16 10:49 ` [PATCH 13/17] OMAP3: Fixed ARM aux ctrl register save/restore Tero Kristo
2009-10-16 10:49 ` [PATCH 14/17] OMAP3: PM: Disabled I2C4 repeated start operation mode Tero Kristo
2009-10-16 10:49 ` [PATCH 15/17] OMAP3: PM: Added support for L2 aux ctrl register save and restore Tero Kristo
2009-10-16 10:49 ` [PATCH 16/17] OMAP3: PM: Write voltage and clock setup times dynamically in idle loop Tero Kristo
2009-10-16 10:49 ` [PATCH 17/17] OMAP3: PM: Force disable OTG autoidle Tero Kristo
2009-10-20 18:44 ` Kevin Hilman
2009-10-21 10:21 ` Tero.Kristo
2009-10-20 17:47 ` [PATCH 16/17] OMAP3: PM: Write voltage and clock setup times dynamically in idle loop Kevin Hilman
2009-10-21 9:55 ` Tero.Kristo
2009-10-21 14:15 ` Kevin Hilman
2009-10-21 15:37 ` Tero.Kristo
2009-10-16 14:39 ` [PATCH 12/17] OMAP2/3: Do not enable AUTOIDLE in interrupt controller Woodruff, Richard
2009-10-16 17:47 ` Girish S G
2009-10-16 18:04 ` Woodruff, Richard
[not found] ` <005001ca4e8b$ea107c10$3d1018ac@am.dhcp.ti! .com>
2009-10-16 18:10 ` Girish S G
2009-10-19 10:18 ` Tero.Kristo
2009-10-19 17:21 ` Woodruff, Richard
2009-10-19 18:31 ` Girish S G
2009-10-20 16:01 ` Kevin Hilman
2009-10-20 16:15 ` Tero.Kristo
2009-10-20 16:32 ` Kevin Hilman
2009-10-21 4:37 ` Gopinath, Thara
2009-10-21 15:25 ` Girish S G
2009-10-20 16:19 ` Girish S G
2009-10-20 17:39 ` [PATCH 11/17] Make USBHOST powerdomain go to sleep after warm reset Kevin Hilman
2009-10-20 17:30 ` [PATCH 09/17] OMAP3: PM: Ack pending interrupts before entering suspend Kevin Hilman
2009-10-21 10:03 ` Tero.Kristo
2009-10-21 14:19 ` Kevin Hilman
2009-10-21 16:01 ` Tero.Kristo
2009-10-20 17:36 ` [PATCH 08/17] OMAP2/3: GPTIMER: Clear pending interrupts when " Kevin Hilman
2009-10-21 10:09 ` Tero.Kristo
2009-10-16 13:16 ` [PATCH 06/17] OMAP3: PM: Added next state check for IVA2, USB and PER into idle loop Sripathy, Vishwanath
2009-10-16 13:35 ` Tero.Kristo
2009-10-16 14:57 ` Cousson, Benoit
2009-10-20 19:04 ` Kevin Hilman
2009-10-20 17:23 ` [PATCH 05/17] OMAP:PM: Precedence fix Kevin Hilman
2009-10-20 17:21 ` [PATCH 04/17] OMAP3: PM: Do not enable IO wake-up on boot Kevin Hilman
2009-10-16 15:27 ` [PATCH 03/17] PM: Block CORE off when DSS is active Cousson, Benoit
2009-10-19 9:37 ` Tero.Kristo
2009-10-20 17:19 ` Kevin Hilman
2009-10-20 16:16 ` Kevin Hilman [this message]
2009-10-16 17:16 ` [PATCH 01/17] PM: fix suspend control for IVA2 Girish S G
2009-10-19 9:22 ` Tero.Kristo
2009-10-19 18:26 ` Girish S G
2009-10-20 16:10 ` Kevin Hilman
2009-10-22 10:24 ` Paul Walmsley
2009-10-22 21:21 ` Woodruff, Richard
2009-10-23 5:22 ` Artem Bityutskiy
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=871vkyniqb.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