From patchwork Tue Mar 20 20:22:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob X-Patchwork-Id: 7372 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 0E98F23DC3 for ; Tue, 20 Mar 2012 20:23:26 +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 C64C2A1817F for ; Tue, 20 Mar 2012 20:23:25 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so671092iag.11 for ; Tue, 20 Mar 2012 13:23: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=zI4yj9I5of0O7M6ChmOp7p4h8mUYr4nrGBlmwYseRPs=; b=DFWFYvH+Atipwa7rUNU/iZZOx+hx1M1NLA4qBQUk0bagp/zlwdKBLlwklnDqp/V+7+ eBOqV5iqUdHZsnL0jNS716IYubEdr0cNLHMVhHhdwSs9zqzDV4PgFEvmPryqzp7vNw7I C+AfpeJsxZCgmHXm9KPoLdEgZB9pP6460d43D0/A5EcekKsSYxPeE6ZLFFWvew53BM1u MiYE2ZU1Q5xnjkUH5zRE+TqL45WPJa3T5cLZTWMYegO5B04VnX0taKiV9P7rt5hlyMMc AgPJy16nce0X/APYxQaXmAZahJnGuqp7i5RnoyHTKbX/ORgwqXKd7SYHqrY0aP+/hEBn T4CQ== Received: by 10.42.72.130 with SMTP id o2mr957852icj.8.1332275005602; Tue, 20 Mar 2012 13:23:25 -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.203.79 with SMTP id fh15csp12157ibb; Tue, 20 Mar 2012 13:23:25 -0700 (PDT) Received: by 10.229.106.34 with SMTP id v34mr502347qco.153.1332275004617; Tue, 20 Mar 2012 13:23:24 -0700 (PDT) Received: from mail-qc0-f178.google.com (mail-qc0-f178.google.com [209.85.216.178]) by mx.google.com with ESMTPS id l7si1074534qcw.160.2012.03.20.13.23.24 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Mar 2012 13:23:24 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.216.178 is neither permitted nor denied by best guess record for domain of rob.lee@linaro.org) client-ip=209.85.216.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.216.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-qc0-f178.google.com with SMTP id e14so250671qcs.37 for ; Tue, 20 Mar 2012 13:23:24 -0700 (PDT) Received: by 10.229.102.134 with SMTP id g6mr597834qco.21.1332275000887; Tue, 20 Mar 2012 13:23:20 -0700 (PDT) Received: from localhost.localdomain ([216.59.27.113]) by mx.google.com with ESMTPS id n8sm4392976qan.12.2012.03.20.13.23.17 (version=SSLv3 cipher=OTHER); Tue, 20 Mar 2012 13:23:20 -0700 (PDT) From: Robert Lee To: len.brown@intel.com Cc: akpm@linux-foundation.org, rjw@sisk.pl, 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-kernel@vger.kernel.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 v8 7/8] ARM: shmobile: Consolidate time keeping and irq enable Date: Tue, 20 Mar 2012 15:22:48 -0500 Message-Id: <1332274969-15782-8-git-send-email-rob.lee@linaro.org> X-Mailer: git-send-email 1.7.9.4 In-Reply-To: <1332274969-15782-1-git-send-email-rob.lee@linaro.org> References: <1332274969-15782-1-git-send-email-rob.lee@linaro.org> X-Gm-Message-State: ALoCoQmCtLoi30NovYdu6zcZNAQWsjWjwTlOVANq2jLuCgbTKwT7e/FCTmJ3J2Zu13Ec71i3LPoB Enable core cpuidle timekeeping and irq enabling and remove that handling from this code. Signed-off-by: Robert Lee Reviewed-by: Kevin Hilman Reviewed-by: Daniel Lezcano Acked-by: Jean Pihet --- arch/arm/mach-shmobile/cpuidle.c | 31 +++++++------------------------ 1 file 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);