public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
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
Date: Thu, 3 Jul 2008 15:50:19 +0530	[thread overview]
Message-ID: <005101c8dcf6$658fd650$68bf18ac@ent.ti.com> (raw)
In-Reply-To: <87hcb7qzkp.fsf@trdhcp146196.ntc.nokia.com>

 

> -----Original Message-----
> From: "Högander" Jouni [mailto:jouni.hogander@nokia.com] 
> Sent: Thursday, July 03, 2008 11:28 AM
> To: ext Rajendra Nayak
> Cc: linux-omap@vger.kernel.org
> Subject: Re: [PATCH 00/11] OMAP3 CPUidle patches
> 
> "ext Rajendra Nayak" <rnayak@ti.com> writes:
> 
> > Hi,
> >
> > The following patches define and enable all of the below 
> mentioned C states for OMAP3. 
> > These are tested with a minimal kernel config on 
> OMAP3430sdp as most drivers today don't have context 
> save/restore in place and
> > some even lack aggresive clock handling. 
> > These apply on top of the workaround patch set submitted by Jouni. 
> > ([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
> >   
> > The following C states are defined
> > C0 - System executing code
> > C1 - MPU WFI + Core active
> > C2 - MPU CSWR + Core active
> > C3 - MPU OFF + Core active
> > C4 - MPU CSWR + Core CSWR
> > C5 - MPU OFF + Core CSWR
> > C6 - MPU OFF + Core OFF
> >  
> > regards,
> > Rajendra
> 
> One more general comment on these patches as I looked at the code
> after applying them.
> 
> Most of the code in omap3_enter_idle in cpuidle34xx.c could be shared
> between suspend/pm_idle/cpuidle. I would do these changes to share
> this code between these three things:
> 
> 1. read mpu_pd pwrst, neon_pd pwrst, core_pd pwrst values in
>    omap_sram_idle in pm34xx.c
> 
> 2. Move all the logic from omap3_enter_idle to omap_sram_idle. Use
>    values read in previous step to decide wether ctx savings/restores
>    are needed, what should be written to neon_pd next_pwrst, wether
>    omap2_gpio_prepare_for/resume_after_retention is needed, wether to
>    disable/enable serial and gpio clocks.
> 
> Basically what is left into omap3_enter_idle is writing next pwrsts
> and cpuidle related stuff, something like this:
> 
> static int omap3_enter_idle(struct cpuidle_device *dev,
> 			struct cpuidle_state *state)
> {
> 	struct omap3_processor_cx *cx = cpuidle_get_statedata(state);
> 	struct timespec ts_preidle, ts_postidle, ts_idle;
> 	struct powerdomain *mpu_pd, *core_pd;
> 
> 	current_cx_state = *cx;
> 
> 	if (cx->type == OMAP3_STATE_C0) {
> 		/* Do nothing for C0, not even a wfi */
> 		return 0;
> 	}
> 
> 	local_irq_disable();
> 	local_fiq_disable();
> 
> 	/* Used to keep track of the total time in idle */
> 	getnstimeofday(&ts_preidle);
> 
> 	if (cx->type > OMAP3_STATE_C1)
> 		sched_clock_idle_sleep_event(); /* about to 
> enter deep idle */
> 
> 	mpu_pd = pwrdm_lookup("mpu_pwrdm");
> 	core_pd = pwrdm_lookup("core_pwrdm");
> 
>         pwrdm_set_next_pwrst(mpu_pd, cx->mpu_state);
> 	pwrdm_set_next_pwrst(core_pd, cx->core_state);
> 
> 	if (omap_irq_pending())
> 		goto return_sleep_time;
> 
> 	/* Execute ARM wfi */
> 	omap_sram_idle();
> 
> return_sleep_time:
> 	getnstimeofday(&ts_postidle);
> 	ts_idle = timespec_sub(ts_postidle, ts_preidle);
> 
> 	if (cx->type > OMAP3_STATE_C1)
> 		sched_clock_idle_wakeup_event(timespec_to_ns(&ts_idle));
> 
> 	local_irq_enable();
> 	local_fiq_disable();
> 
> 	return (u32)timespec_to_ns(&ts_idle)/1000;
> }
> 
> If this is not done, we need to copy paste code from omap3_enter_idle
> into suspend code anyway if we want to use offmode in it. It would be
> more nice to have one funcion with this logic shared between
> suspend/pm_idle/cpuidle rather than two or even three copies of it.

Yes, all this looks good to me.

> 
> -- 
> 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

  reply	other threads:[~2008-07-03 12:00 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 [this message]
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
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='005101c8dcf6$658fd650$68bf18ac@ent.ti.com' \
    --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