From patchwork Mon May 14 14:06:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 8595 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 07A8723EB5 for ; Mon, 14 May 2012 14:06:26 +0000 (UTC) Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by fiordland.canonical.com (Postfix) with ESMTP id 007D7A18027 for ; Mon, 14 May 2012 14:06:25 +0000 (UTC) Received: by wibhm6 with SMTP id hm6so1451765wib.5 for ; Mon, 14 May 2012 07:06:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=5U+UCuFe8kuW5gE8gll0fwOHUdOMgCL7PdB9szRV4VI=; b=FUkzq/AwvqT4acB2NL8sWsARrszCby+Gf2u9D42si4+0BOGPUFKPKFYV2ZrhL3ZBHq I9KJW07szl9bLzbl4Qq1QjaajlZGqZkSw0pyqYlWc1WkJEGt2UtUPZK2ZVlaaDI6aUG4 tjRs0WdQefSYtGfRdAudlVZxfWxfCfpUDjjHC1R2pFTQjcrnK6sA1Uruxkwam63In/v3 zau4zIEBjAIpVq1VOS7gDOzLHepAEbptmv7gjQTfk7Okssxhawvy6lrYwurRlNg+zFw/ 4qzMUTXYDAShoGWWZF/oLZiirO2rfbMld9RdekIpqNagaHSA7x4xJzRp8xSEVt0GneYY LsdA== Received: by 10.50.40.193 with SMTP id z1mr4354276igk.0.1337004383586; Mon, 14 May 2012 07:06:23 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.35.72 with SMTP id o8csp345272ibd; Mon, 14 May 2012 07:06:22 -0700 (PDT) Received: by 10.180.78.105 with SMTP id a9mr19887154wix.20.1337004382175; Mon, 14 May 2012 07:06:22 -0700 (PDT) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx.google.com with ESMTPS id d3si12954085wed.115.2012.05.14.07.06.21 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 14 May 2012 07:06:22 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.50 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=74.125.82.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.50 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) smtp.mail=daniel.lezcano@linaro.org Received: by mail-wg0-f50.google.com with SMTP id ds11so4849834wgb.31 for ; Mon, 14 May 2012 07:06:21 -0700 (PDT) Received: by 10.180.81.36 with SMTP id w4mr12740009wix.16.1337004381669; Mon, 14 May 2012 07:06:21 -0700 (PDT) Received: from localhost.localdomain (AToulouse-159-1-63-91.w92-134.abo.wanadoo.fr. [92.134.214.91]) by mx.google.com with ESMTPS id j3sm55355995wiw.1.2012.05.14.07.06.20 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 14 May 2012 07:06:20 -0700 (PDT) From: Daniel Lezcano To: ben-linux@fluff.org, kgene.kim@samsung.com, broonie@opensource.wolfsonmicro.com Cc: linux-arm-kernel@lists.infradead.org, linaro-dev@lists.linaro.org, patches@linaro.org, linux-samsung-soc@vger.kernel.org, heiko@sntech.de Subject: [PATCH 2/2] ARM: s3c64xx: cpuidle - use timekeeping wrapper Date: Mon, 14 May 2012 16:06:17 +0200 Message-Id: <1337004377-17732-3-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1337004377-17732-1-git-send-email-daniel.lezcano@linaro.org> References: <1337004377-17732-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQkD91fKUrLA1lI/D7woU3m79nhCiE1FDP8wEWdXEI1YegIe+EEhqiRQ4RbOymksfcWHD3a9 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 Tested-by: Mark Brown --- 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,