From: daniel.lezcano@linaro.org (Daniel Lezcano)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] ARM: s3c64xx: cpuidle - use timekeeping wrapper
Date: Mon, 14 May 2012 16:06:17 +0200 [thread overview]
Message-ID: <1337004377-17732-3-git-send-email-daniel.lezcano@linaro.org> (raw)
In-Reply-To: <1337004377-17732-1-git-send-email-daniel.lezcano@linaro.org>
The timekeeping is computed from the cpuidle core if we set
the .en_core_tk_irqen flag. Let's use it and remove the duplicated
code.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
arch/arm/mach-s3c64xx/cpuidle.c | 12 +-----------
1 files changed, 1 insertions(+), 11 deletions(-)
diff --git a/arch/arm/mach-s3c64xx/cpuidle.c b/arch/arm/mach-s3c64xx/cpuidle.c
index 2750e54..acb197c 100644
--- a/arch/arm/mach-s3c64xx/cpuidle.c
+++ b/arch/arm/mach-s3c64xx/cpuidle.c
@@ -27,12 +27,7 @@ static int s3c64xx_enter_idle(struct cpuidle_device *dev,
struct cpuidle_driver *drv,
int index)
{
- struct timeval before, after;
unsigned long tmp;
- int idle_time;
-
- local_irq_disable();
- do_gettimeofday(&before);
/* Setup PWRCFG to enter idle mode */
tmp = __raw_readl(S3C64XX_PWR_CFG);
@@ -42,12 +37,6 @@ static int s3c64xx_enter_idle(struct cpuidle_device *dev,
cpu_do_idle();
- do_gettimeofday(&after);
- local_irq_enable();
- idle_time = (after.tv_sec - before.tv_sec) * USEC_PER_SEC +
- (after.tv_usec - before.tv_usec);
-
- dev->last_residency = idle_time;
return index;
}
@@ -56,6 +45,7 @@ static DEFINE_PER_CPU(struct cpuidle_device, s3c64xx_cpuidle_device);
static struct cpuidle_driver s3c64xx_cpuidle_driver = {
.name = "s3c64xx_cpuidle",
.owner = THIS_MODULE,
+ .en_core_tk_irqen = 1,
.states = {
{
.enter = s3c64xx_enter_idle,
--
1.7.5.4
next prev parent reply other threads:[~2012-05-14 14:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-14 14:06 [PATCH 0/2] ARM: S3C64xx: cpuidle cleanups Daniel Lezcano
2012-05-14 14:06 ` [PATCH 1/2] ARM: s3c64xx: cpuidle - declare the states with the new api Daniel Lezcano
2012-05-17 7:02 ` Kukjin Kim
2012-05-17 12:28 ` Mark Brown
2012-05-19 17:35 ` Kukjin Kim
2012-05-14 14:06 ` Daniel Lezcano [this message]
2012-05-17 12:28 ` [PATCH 2/2] ARM: s3c64xx: cpuidle - use timekeeping wrapper Mark Brown
2012-05-17 6:57 ` [PATCH 0/2] ARM: S3C64xx: cpuidle cleanups Kukjin Kim
-- strict thread matches above, loose matches on Subject: below --
2012-05-09 14:08 Daniel Lezcano
2012-05-09 14:08 ` [PATCH 2/2] ARM: s3c64xx: cpuidle - use timekeeping wrapper Daniel Lezcano
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=1337004377-17732-3-git-send-email-daniel.lezcano@linaro.org \
--to=daniel.lezcano@linaro.org \
--cc=linux-arm-kernel@lists.infradead.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).