From: Colin Cross <ccross@google.com>
To: Robert Lee <rob.lee@linaro.org>
Cc: len.brown@intel.com, khilman@ti.com, nicolas.pitre@linaro.org,
daniel.lezcano@linaro.org, linaro-dev@lists.linaro.org,
nicolas.ferre@atmel.com, linux@arm.linux.org.uk,
kgene.kim@samsung.com, mturquette@linaro.org,
linux-pm@vger.kernel.org, magnus.damm@gmail.com,
linux-acpi@vger.kernel.org, shawn.guo@freescale.com,
arnd.bergmann@linaro.org, patches@linaro.org, nsekhar@ti.com,
s.hauer@pengutronix.de, Baohua.Song@csr.com,
vincent.guittot@linaro.org, linux@maxim.org.za,
linux-arm-kernel@lists.infradead.org, deepthi@linux.vnet.ibm.com,
broonie@opensource.wolfsonmicro.com, amit.kucheria@linaro.org,
amit.kachhap@linaro.org
Subject: Re: [RFC PATCH v4 1/4] cpuidle: Add time keeping and irq enabling
Date: Sat, 4 Feb 2012 11:02:47 -0800 [thread overview]
Message-ID: <CAMbhsRQxgvRN0skteFxeDBqmUArTa3wu2uZPqowDnBTSWuqScg@mail.gmail.com> (raw)
In-Reply-To: <1328065215-28108-2-git-send-email-rob.lee@linaro.org>
On Tue, Jan 31, 2012 at 7:00 PM, Robert Lee <rob.lee@linaro.org> wrote:
> Make necessary changes to add implement time keepign and irq enabling
keeping
> in the core cpuidle code. This will allow the remove of these
> functionalities from the platform cpuidle implementations.
>
> Signed-off-by: Robert Lee <rob.lee@linaro.org>
> ---
> drivers/cpuidle/cpuidle.c | 75 +++++++++++++++++++++++++++++++++++---------
> include/linux/cpuidle.h | 26 ++++++++++-----
> 2 files changed, 76 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
> index 59f4261..8ea0fc3 100644
> --- a/drivers/cpuidle/cpuidle.c
> +++ b/drivers/cpuidle/cpuidle.c
> @@ -57,14 +57,18 @@ static int __cpuidle_register_device(struct cpuidle_device *dev);
> * cpuidle_idle_call - the main idle loop
> *
> * NOTE: no locks or semaphores should be used here
> + * NOTE: Should only be called from a local irq disabled context
> * return non-zero on failure
> + *
> */
> int cpuidle_idle_call(void)
> {
> struct cpuidle_device *dev = __this_cpu_read(cpuidle_devices);
> struct cpuidle_driver *drv = cpuidle_get_driver();
> struct cpuidle_state *target_state;
> - int next_state, entered_state;
> + int idx, ret = 0;
> + ktime_t t1, t2;
> + s64 diff;
>
> if (off)
> return -ENODEV;
> @@ -86,37 +90,76 @@ int cpuidle_idle_call(void)
> #endif
>
> /* ask the governor for the next state */
> - next_state = cpuidle_curr_governor->select(drv, dev);
> + idx = cpuidle_curr_governor->select(drv, dev);
> +
> + target_state = &drv->states[idx];
> +
> + /*
> + * Check with the device to see if it can enter this state or if another
> + * state should be used.
> + */
> + if (target_state->pre_enter) {
> + idx = target_state->
> + pre_enter(dev, drv, idx);
Unnecessary line wrap and braces.
What's the point of the pre_enter call? This seems very similar to
the prepare call that was removed in 3.2. Drivers can already demote
the target state in their enter call. The only thing you do between
pre_enter and enter is trace and account for the time. Is there some
long call you don't want included in the idle time? Some
documentation would help, and you need to very clearly define the
semantics of when post_enter gets called when pre_enter or enter
return errors.
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" 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:[~2012-02-04 19:02 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-01 3:00 [RFC PATCH v4 0/4] Consolidate cpuidle timekeeping and irq enabling Robert Lee
2012-02-01 3:00 ` [RFC PATCH v4 1/4] cpuidle: Add time keeping " Robert Lee
2012-02-04 19:02 ` Colin Cross [this message]
2012-02-04 22:06 ` Turquette, Mike
2012-02-05 1:36 ` Colin Cross
[not found] ` <CAMbhsRR2Zsv7d+_iganMhz5WxDiUYd-zOCoVehz4yjzyH2q+wA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-05 1:48 ` Turquette, Mike
2012-02-06 16:38 ` Rob Lee
[not found] ` <CAMbhsRQxgvRN0skteFxeDBqmUArTa3wu2uZPqowDnBTSWuqScg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-06 17:14 ` Rob Lee
2012-02-01 3:00 ` [RFC PATCH v4 2/4] ARM: omap: Remove cpuidle timekeeping and irq enable/disable Robert Lee
[not found] ` <1328065215-28108-3-git-send-email-rob.lee-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2012-02-02 16:21 ` Jean Pihet
2012-02-02 17:35 ` Rob Lee
2012-02-01 3:00 ` [RFC PATCH v4 3/4] acpi: " Robert Lee
2012-02-01 3:00 ` [RFC PATCH v4 4/4] x86: " Robert Lee
2012-02-10 19:32 ` [RFC PATCH v4 0/4] Consolidate cpuidle timekeeping and irq enabling Rob Lee
2012-02-10 20:06 ` Amit Kucheria
2012-02-22 20:52 ` Colin Cross
2012-02-23 6:39 ` Rob Lee
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=CAMbhsRQxgvRN0skteFxeDBqmUArTa3wu2uZPqowDnBTSWuqScg@mail.gmail.com \
--to=ccross@google.com \
--cc=Baohua.Song@csr.com \
--cc=amit.kachhap@linaro.org \
--cc=amit.kucheria@linaro.org \
--cc=arnd.bergmann@linaro.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=daniel.lezcano@linaro.org \
--cc=deepthi@linux.vnet.ibm.com \
--cc=kgene.kim@samsung.com \
--cc=khilman@ti.com \
--cc=len.brown@intel.com \
--cc=linaro-dev@lists.linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=linux@maxim.org.za \
--cc=magnus.damm@gmail.com \
--cc=mturquette@linaro.org \
--cc=nicolas.ferre@atmel.com \
--cc=nicolas.pitre@linaro.org \
--cc=nsekhar@ti.com \
--cc=patches@linaro.org \
--cc=rob.lee@linaro.org \
--cc=s.hauer@pengutronix.de \
--cc=shawn.guo@freescale.com \
--cc=vincent.guittot@linaro.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;
as well as URLs for NNTP newsgroup(s).