From patchwork Thu Mar 1 00:42:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob X-Patchwork-Id: 7020 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 E1B6F23EB0 for ; Thu, 1 Mar 2012 00:43:36 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id A6D03A1825B for ; Thu, 1 Mar 2012 00:43:36 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so90122iag.11 for ; Wed, 29 Feb 2012 16:43:36 -0800 (PST) Received: from mr.google.com ([10.50.207.72]) by 10.50.207.72 with SMTP id lu8mr2829153igc.0.1330562616427 (num_hops = 1); Wed, 29 Feb 2012 16:43:36 -0800 (PST) Received: by 10.50.207.72 with SMTP id lu8mr2334003igc.0.1330562616385; Wed, 29 Feb 2012 16:43:36 -0800 (PST) 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.53.18 with SMTP id k18csp4440ibg; Wed, 29 Feb 2012 16:43:36 -0800 (PST) Received: by 10.236.174.106 with SMTP id w70mr3048848yhl.68.1330562615740; Wed, 29 Feb 2012 16:43:35 -0800 (PST) Received: from mail-gy0-f178.google.com (mail-gy0-f178.google.com [209.85.160.178]) by mx.google.com with ESMTPS id f15si54330anb.120.2012.02.29.16.43.35 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 29 Feb 2012 16:43:35 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.178 is neither permitted nor denied by best guess record for domain of rob.lee@linaro.org) client-ip=209.85.160.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.178 is neither permitted nor denied by best guess record for domain of rob.lee@linaro.org) smtp.mail=rob.lee@linaro.org Received: by mail-gy0-f178.google.com with SMTP id f1so14882ghb.37 for ; Wed, 29 Feb 2012 16:43:35 -0800 (PST) Received-SPF: pass (google.com: domain of rob.lee@linaro.org designates 10.236.191.134 as permitted sender) client-ip=10.236.191.134; Received: from mr.google.com ([10.236.191.134]) by 10.236.191.134 with SMTP id g6mr3781381yhn.95.1330562615544 (num_hops = 1); Wed, 29 Feb 2012 16:43:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.236.191.134 with SMTP id g6mr2981212yhn.95.1330562612818; Wed, 29 Feb 2012 16:43:32 -0800 (PST) Received: from b18647-20 ([67.23.168.160]) by mx.google.com with ESMTPS id v21sm429898yhk.3.2012.02.29.16.43.29 (version=SSLv3 cipher=OTHER); Wed, 29 Feb 2012 16:43:32 -0800 (PST) From: Robert Lee To: rjw@sisk.pl, len.brown@intel.com Cc: khilman@ti.com, robherring2@gmail.com, Baohua.Song@csr.com, amit.kucheria@linaro.org, nicolas.ferre@atmel.com, linux@maxim.org.za, kgene.kim@samsung.com, amit.kachhap@linaro.org, magnus.damm@gmail.com, nsekhar@ti.com, daniel.lezcano@linaro.org, mturquette@linaro.org, vincent.guittot@linaro.org, arnd.bergmann@linaro.org, linux-arm-kernel@lists.infradead.org, linaro-dev@lists.linaro.org, patches@linaro.org, deepthi@linux.vnet.ibm.com, broonie@opensource.wolfsonmicro.com, nicolas.pitre@linaro.org, linux@arm.linux.org.uk, jean.pihet@newoldbits.com, venki@google.com, ccross@google.com, g.trinabh@gmail.com, kernel@wantstofly.org, lethal@linux-sh.org, jon-hunter@ti.com, tony@atomide.com, linux-omap@vger.kernel.org, linux-sh@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH v7 8/9] ARM: shmobile: Consolidate time keeping and irq enable Date: Wed, 29 Feb 2012 18:42:57 -0600 Message-Id: <1330562578-3410-9-git-send-email-rob.lee@linaro.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1330562578-3410-1-git-send-email-rob.lee@linaro.org> References: <1330562578-3410-1-git-send-email-rob.lee@linaro.org> X-Gm-Message-State: ALoCoQmoDgMtxH+JRp9Jo9r60HI1Yele0HvSThAi/n04w5whiFkFim8Xr8BqjgyjIPsVp3ARHdA4 Enable core cpuidle timekeeping and irq enabling and remove that handling from this code. Signed-off-by: Robert Lee --- arch/arm/mach-shmobile/cpuidle.c | 31 +++++++------------------------ 1 files changed, 7 insertions(+), 24 deletions(-) diff --git a/arch/arm/mach-shmobile/cpuidle.c b/arch/arm/mach-shmobile/cpuidle.c index 1b23342..ca23b20 100644 --- a/arch/arm/mach-shmobile/cpuidle.c +++ b/arch/arm/mach-shmobile/cpuidle.c @@ -14,6 +14,7 @@ #include #include #include +#include #include static void shmobile_enter_wfi(void) @@ -29,37 +30,19 @@ static int shmobile_cpuidle_enter(struct cpuidle_device *dev, struct cpuidle_driver *drv, int index) { - ktime_t before, after; - - before = ktime_get(); - - local_irq_disable(); - local_fiq_disable(); - shmobile_cpuidle_modes[index](); - local_irq_enable(); - local_fiq_enable(); - - after = ktime_get(); - dev->last_residency = ktime_to_ns(ktime_sub(after, before)) >> 10; - return index; } static struct cpuidle_device shmobile_cpuidle_dev; static struct cpuidle_driver shmobile_cpuidle_driver = { - .name = "shmobile_cpuidle", - .owner = THIS_MODULE, - .states[0] = { - .name = "C1", - .desc = "WFI", - .exit_latency = 1, - .target_residency = 1 * 2, - .flags = CPUIDLE_FLAG_TIME_VALID, - }, - .safe_state_index = 0, /* C1 */ - .state_count = 1, + .name = "shmobile_cpuidle", + .owner = THIS_MODULE, + .en_core_tk_irqen = 1, + .states[0] = ARM_CPUIDLE_WFI_STATE, + .safe_state_index = 0, /* C1 */ + .state_count = 1, }; void (*shmobile_cpuidle_setup)(struct cpuidle_driver *drv);