From patchwork Wed May 9 14:08:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 8498 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 BE8DD23E42 for ; Wed, 9 May 2012 14:08:22 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id 8D3D9A18A27 for ; Wed, 9 May 2012 14:08:22 +0000 (UTC) Received: by gglu1 with SMTP id u1so223419ggl.11 for ; Wed, 09 May 2012 07:08:22 -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=cc7Vk4z8E+ghMSN/0IYL5WvXfd666qCn2Gf5KXtBOCWZxu358k0rmqjq3wWHQUQ1d4 UYSn8qT1wHuGQiWp9nnEJjS1iluR7hZ7yWYidgYkczgf2JxGrSTj26nnjiwS9MMvF3wV U/Suu+jEeHkZlpzNm+iH0SAJWL+bWBiN3zjKkorOVINf/TH8lYSSyGHEWUl69NkWYZ7Z Ju6iVd1zR700/+h5G0ao9HG4umJ1f9ZGtrlaXe3oVjgPsZ/12osKKNkMAVnslwApX54z Ci/i4Bh08wqIBawy5+XytC37zYEGziDre1mYVkrKMuGUtQi8EGD5WZiZWbCzvwunCCuM R3ew== Received: by 10.68.227.227 with SMTP id sd3mr9325833pbc.53.1336572501660; Wed, 09 May 2012 07:08:21 -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.73.147 with SMTP id q19csp18814ibj; Wed, 9 May 2012 07:08:20 -0700 (PDT) Received: by 10.180.85.69 with SMTP id f5mr628078wiz.18.1336572500458; Wed, 09 May 2012 07:08:20 -0700 (PDT) Received: from mail-wg0-f42.google.com (mail-wg0-f42.google.com [74.125.82.42]) by mx.google.com with ESMTPS id w2si3280866wew.44.2012.05.09.07.08.18 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 May 2012 07:08:19 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.42 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=74.125.82.42; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.42 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) smtp.mail=daniel.lezcano@linaro.org Received: by wgbds11 with SMTP id ds11so1661806wgb.1 for ; Wed, 09 May 2012 07:08:17 -0700 (PDT) Received: by 10.180.98.137 with SMTP id ei9mr769355wib.0.1336572497729; Wed, 09 May 2012 07:08:17 -0700 (PDT) Received: from localhost.localdomain (AToulouse-159-1-109-226.w92-134.abo.wanadoo.fr. [92.134.236.226]) by mx.google.com with ESMTPS id gd4sm9940915wib.6.2012.05.09.07.08.16 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 May 2012 07:08:17 -0700 (PDT) From: Daniel Lezcano To: ben-linux@fluff.org Cc: linux-arm-kernel@lists.infradead.org, linaro-dev@lists.linaro.org, patches@linaro.org Subject: [PATCH 2/2] ARM: s3c64xx: cpuidle - use timekeeping wrapper Date: Wed, 9 May 2012 16:08:09 +0200 Message-Id: <1336572489-21457-3-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1336572489-21457-1-git-send-email-daniel.lezcano@linaro.org> References: <1336572489-21457-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQksh3UODgPlw7sLat1T0KvlbJL+rNWOP1Ew8X2n2LJEr7CxL+BKbabyXqD0ma/BW6SiZYkU 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 --- 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,