From: "Rajendra Nayak" <rnayak@ti.com>
To: "'\"Högander\" Jouni'" <jouni.hogander@nokia.com>
Cc: linux-omap@vger.kernel.org
Subject: RE: [PATCH 00/11] OMAP3 CPUidle patches - ver 2
Date: Wed, 13 Aug 2008 11:27:05 +0530 [thread overview]
Message-ID: <00ad01c8fd09$6bcdc6c0$LocalHost@wipultra1382> (raw)
In-Reply-To: <874p5q8l0c.fsf@trdhcp146196.ntc.nokia.com>
>
> Check wether serial can sleep is missing from
> omap3_enter_idle and it should be removed from omap3_can_sleep:
>
> diff --git a/arch/arm/mach-omap2/cpuidle34xx.c
> b/arch/arm/mach-omap2/cpuidle34xx.c
> index a02da6d..16ff30b 100644
> --- a/arch/arm/mach-omap2/cpuidle34xx.c
> +++ b/arch/arm/mach-omap2/cpuidle34xx.c
> @@ -431,7 +431,7 @@ static int omap3_enter_idle(struct
> cpuidle_device *dev,
>
> current_cx_state = *cx;
>
> - if (cx->type == OMAP3_STATE_C0) {
> + if (cx->type == OMAP3_STATE_C0 || !omap_serial_can_sleep()) {
> /* Do nothing for C0, not even a wfi */
> return 0;
> }
>
> diff --git a/arch/arm/mach-omap2/pm34xx.c
> b/arch/arm/mach-omap2/pm34xx.c index f68fa0a..f9b3676 100644
> @@ -391,8 +391,6 @@ int omap3_can_sleep(void)
> return 0;
> if (atomic_read(&sleep_block) > 0)
> return 0;
> - if (!omap_serial_can_sleep())
> - return 0;
> return 1;
> }
>
> Doing this would make serial console to work faster.
Yes, I removed these in my patches and put in the changes suggested by Richard
in 8250.c
I thought the final conclusion of the discussion was that it was too expensive to the keep the
system in C0 all the time while UART inactivity runs, or did I miss something?
>
> _omap_sram_idle should be non-static:
>
> diff --git a/arch/arm/mach-omap2/pm34xx.c
> b/arch/arm/mach-omap2/pm34xx.c index f68fa0a..133a666 100644
> --- a/arch/arm/mach-omap2/pm34xx.c
> +++ b/arch/arm/mach-omap2/pm34xx.c
> @@ -60,7 +60,7 @@ u32 restore_pointer_address;
>
> static LIST_HEAD(pwrst_list);
>
> -static void (*_omap_sram_idle)(u32 *addr, int save_state);
> +void (*_omap_sram_idle)(u32 *addr, int save_state);
>
> static void (*saved_idle)(void);
I thought this is already part of the patches. It is now non-static.
>
> Serial and gpio clock disabling and gpio_prepare/resume can
> be removed from omap3_pm_idle because they are already done
> in omap_sram_idle. And if omap_serial_can_sleep is removed
> from omap3_can_sleep it should be added to omap3_pm_idle.
> Omap3_pm_idle can be also put behind #ifndef CONFIG_CPU_IDLE:
>
> +#ifndef CONFIG_CPU_IDLE
> static void omap3_pm_idle(void)
> {
> local_irq_disable();
> @@ -454,33 +455,16 @@ static void omap3_pm_idle(void)
> if (omap_irq_pending())
> goto out;
>
> - omap2_gpio_prepare_for_retention();
> -
> - if (clocks_off_while_idle) {
> - omap_serial_enable_clocks(0, 0);
> - omap_serial_enable_clocks(0, 1);
> - omap_serial_enable_clocks(0, 2);
> - /* XXX This is for gpio fclk hack. Will be removed as
> - * gpio driver * handles fcks correctly */
> - per_gpio_clk_disable();
> - }
> + if (!omap_serial_can_sleep())
> + goto out;
>
> omap_sram_idle();
>
> - if (clocks_off_while_idle) {
> - omap_serial_enable_clocks(1, 0);
> - omap_serial_enable_clocks(1, 1);
> - omap_serial_enable_clocks(1, 2);
> - /* XXX This is for gpio fclk hack. Will be removed as
> - * gpio driver * handles fcks correctly */
> - per_gpio_clk_enable();
> - }
> -
> - omap2_gpio_resume_after_retention();
> out:
> local_fiq_enable();
> local_irq_enable();
> }
> +#endif /* CONFIG_CPU_IDLE */
These are also done as part of the last patch in the series.
>
> I would like to see also some reformatting. E.g. patch 11
> contains lots of code which is not related to "CORE context
> save/restore". It might be also good idea to enable only
> non-off mode C states and have a pwrdms_setup function which
> is something like this:
>
> static int __init pwrdms_setup(struct powerdomain *pwrdm) {
> struct power_state *pwrst;
>
> if (!pwrdm->pwrsts)
> return 0;
>
> pwrst = kmalloc(sizeof(struct power_state), GFP_KERNEL);
> if (!pwrst)
> return -ENOMEM;
> pwrst->pwrdm = pwrdm;
> pwrst->next_state = PWRDM_POWER_RET;
> list_add(&pwrst->node, &pwrst_list);
>
> if (pwrdm_has_hdwr_sar(pwrdm))
> pwrdm_enable_hdwr_sar(pwrdm);
>
> #ifdef CONFIG_CPU_IDLE
> /* Let cpuidle do selection here */
> if (!strcmp(pwrst->pwrdm->name, "core_pwrdm") ||
> !strcmp(pwrst->pwrdm->name, "mpu_pwrdm") ||
> !strcmp(pwrst->pwrdm->name, "neon_pwrdm"))
> return set_pwrdm_state(pwrst->pwrdm, PWRDM_POWER_ON);
> else
> #endif
> return set_pwrdm_state(pwrst->pwrdm,
> pwrst->next_state); }
>
> This way cpuidle code would be in a state that it could be
> applied on linux-omap tree and it wouldn't break anything.
> Then have e.g. separate patch for testing off state. This
> patch could modify code to set next states to off and mark
> off mode C states as a valid.
Yes, will do that. Maybe the couple of comments above are also due to
the last patch doing a lot more than it actually should.
>
> >
> >> Hi,
> >>
> >> I am sending an updated patch set for CPUidle which includes all
> >> fixes/comments posted on the previous set by Jouni/Richard W/Peter
> >> and others.
> >>
> >> The Following are the fixes
> >> 1) Uart clock enable/disable moved out of the context save/restore
> >> patch
> >> 2) GPIO IRQENABLE save/restore fix from Richard
> >> 3) Fixes from Jouni which do the following
> >> 1. Add wkdep between neon and mpu
> >> 2. Add wkdep between per and core
> >> 3. Deny hwsup mode before writing next pwrst state
> >> 4. Make sure that order in idle loop is such that clocks are
> >> _really_
> >> enabled before accessing registers
> (serial & gpio).
> >> 4) Safe state idle fix from Richard
> >> 5) Uart smart-force fix from Richard
> >> 6) Toggle IO-PAD enable/disable in idle
> >>
> >> As earlier these patches apply on top of Jouni's
> workaround patch set
> >> ([PATCH 0/6] 34XX: PM: Workarounds to get omap3 to retention 4th.)
> >>
> >> The following is neccessay even with a minimal config to
> achieve OFF.
> >> $ echo 1 > /sys/power/sleep_while_idle $ echo 1 >
> >> /sys/power/clocks_off_while_idle
> >>
> >> regards,
> >> Rajendra
> >>
> >
> >
> > --
> > 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
> >
> >
>
> --
> Jouni Högander
>
>
>
--
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:[~2008-08-13 5:57 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-01 14:16 [PATCH 00/11] OMAP3 CPUidle patches Rajendra Nayak
2008-07-02 13:11 ` Peter 'p2' De Schrijver
2008-07-02 13:37 ` Rajendra Nayak
2008-07-02 15:42 ` Peter 'p2' De Schrijver
2008-07-03 8:39 ` Rajendra Nayak
2008-07-03 12:44 ` Peter 'p2' De Schrijver
2008-07-04 7:26 ` Högander Jouni
2008-07-04 9:32 ` Högander Jouni
2008-07-04 9:45 ` Koen Kooi
2008-07-04 9:45 ` Rajendra Nayak
2008-07-04 9:55 ` Högander Jouni
2008-07-04 11:08 ` Högander Jouni
2008-07-07 9:38 ` Kalle Jokiniemi
2008-07-07 9:56 ` Högander Jouni
2008-07-07 13:58 ` Premi, Sanjeev
2008-07-07 22:25 ` Woodruff, Richard
2008-07-08 6:15 ` Högander Jouni
2008-07-08 12:11 ` Woodruff, Richard
2008-07-08 13:41 ` Högander Jouni
2008-07-08 13:52 ` Woodruff, Richard
2008-07-09 6:48 ` Högander Jouni
2008-07-09 16:31 ` Woodruff, Richard
2008-07-04 11:05 ` Peter 'p2' De Schrijver
2008-07-04 11:39 ` Peter 'p2' De Schrijver
2008-07-03 5:57 ` Högander Jouni
2008-07-03 10:20 ` Rajendra Nayak
2008-07-15 13:20 ` Rajendra Nayak
2008-07-18 13:18 ` [PATCH 00/11] OMAP3 CPUidle patches - ver 2 Rajendra Nayak
[not found] ` <002f01c8f7c5$0790fea0$LocalHost@wipultra1382>
2008-08-06 13:12 ` Rajendra Nayak
2008-08-07 9:54 ` Kalle Jokiniemi
2008-08-12 12:40 ` Högander Jouni
2008-08-13 5:57 ` Rajendra Nayak [this message]
2008-08-13 6:06 ` Rajendra Nayak
2008-08-13 6:55 ` Högander Jouni
2008-08-13 12:35 ` Woodruff, Richard
2008-08-13 13:12 ` Högander Jouni
2008-08-14 5:25 ` Rajendra Nayak
2008-08-19 19:08 ` 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='00ad01c8fd09$6bcdc6c0$LocalHost@wipultra1382' \
--to=rnayak@ti.com \
--cc=jouni.hogander@nokia.com \
--cc=linux-omap@vger.kernel.org \
/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