From patchwork Wed Apr 25 12:11:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Daniel Kachhap X-Patchwork-Id: 8132 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 B1CA923E47 for ; Wed, 25 Apr 2012 12:12:15 +0000 (UTC) Received: from mail-gy0-f180.google.com (mail-gy0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id 4E197A18436 for ; Wed, 25 Apr 2012 12:12:15 +0000 (UTC) Received: by ghbz12 with SMTP id z12so11653ghb.11 for ; Wed, 25 Apr 2012 05:12:14 -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 :dkim-signature:sender:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=jM4y1KhD3/OucQs6ONXmOhn7DGpfUk6S86mY6T4c9qY=; b=TYuUaUrPZHUmqyIUAWQHVg3TNTwHI2kMQdso4/+8HD/O2N8/DKEbYJIofRZ5mFK1Sa RI1epsrxiNY6wOLyL1CCZVzu1bPeSiw1UhM6UFY1k5zIVn82xeEQQIgYMUIBwnTeCjGa Q3hvfUZHzTO38nSN+iPzSmJl+lvHi1NuMSzBni4cne+xK1DLmVxFt2117xrEw6Ep6jTM Uw3+wSYVQZj4OTW03z/txV1Lz4c0k+53yFuGauH9Nb/EKD5swq9Xi5HgQzVx8q7JSk3x hLJddeYEbNDLKucFQyToHVhE2xdEUVLN6PO5UtUysTPmn3NxyAJYmgIm6pdx1htcHnel 5VBw== Received: by 10.50.207.38 with SMTP id lt6mr2115489igc.55.1335355934596; Wed, 25 Apr 2012 05:12:14 -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.137.198 with SMTP id x6csp255445ibt; Wed, 25 Apr 2012 05:12:13 -0700 (PDT) Received: by 10.68.238.164 with SMTP id vl4mr6105402pbc.37.1335355932970; Wed, 25 Apr 2012 05:12:12 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id kx9si3364924pbc.177.2012.04.25.05.12.11 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 Apr 2012 05:12:12 -0700 (PDT) Received-SPF: pass (google.com: domain of amitdanielk@gmail.com designates 209.85.160.50 as permitted sender) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=pass (google.com: domain of amitdanielk@gmail.com designates 209.85.160.50 as permitted sender) smtp.mail=amitdanielk@gmail.com; dkim=pass header.i=@gmail.com Received: by pbcxa12 with SMTP id xa12so1621557pbc.37 for ; Wed, 25 Apr 2012 05:12:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer; bh=jM4y1KhD3/OucQs6ONXmOhn7DGpfUk6S86mY6T4c9qY=; b=INZqom4p84GlXj/oB7lHMO/yEjzOBG+LmdxeuyaChVjdrLKWRB3h4y+EmDzUcPstSR 1uVGY6b+b87I2mC40noDWxWMcHxKT2ydEqJ6gL6AE5pCg/Qt44SDg9kIhbDW2ZjVlnKf LyWRJBjhg30tctoUFdJ0jUkpgWbDWYhH3Ul62AjQtpZpCiWT38cj9E0o/RmP/W/aFA5C hbxH5qApzrsk3rE/hOVfFDpjzcVMJEWe8LZSSrZHGz5M3IuezkJ9y/9PdgE6n5Qe4MOc bOje5l1kz8NyjFV90oZPCNL37WyOnOLT5V6Mcd9v+Rq8DpOyOS1SOnuPjP/6Pb3xfKoX BzUA== Received: by 10.68.220.2 with SMTP id ps2mr7018181pbc.109.1335355931627; Wed, 25 Apr 2012 05:12:11 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id wo8sm5652080pbc.0.2012.04.25.05.12.05 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 Apr 2012 05:12:10 -0700 (PDT) Sender: amit kachhap From: Amit Daniel Kachhap To: linux-samsung-soc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, kgene.kim@samsung.com, linaro-dev@lists.linaro.org, amit.kachhap@linaro.org, patches@linaro.org, Daniel Lezcano , Robert Lee Subject: [PATCH] ARM: exynos: Adapt to cpuidle core time keeping and irq enable Date: Wed, 25 Apr 2012 17:41:52 +0530 Message-Id: <1335355912-26063-1-git-send-email-amit.kachhap@linaro.org> X-Mailer: git-send-email 1.7.1 X-Gm-Message-State: ALoCoQlf3FHsSQMWGhnmT1wmwnjLjtdl+w3V/t4b8vk/DyLrZbuw/sPAzkI5nw45q0DMTiV6QfQO This patch enables core cpuidle timekeeping and irq enabling and remove those redundant parts from the exynos cpuidle drivers CC: Daniel Lezcano CC: Robert Lee Signed-off-by: Amit Daniel Acked-by: Daniel Lezcano Acked-by: Robert Lee --- arch/arm/mach-exynos/cpuidle.c | 53 ++++----------------------------------- 1 files changed, 6 insertions(+), 47 deletions(-) diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c index 33ab4e7..26dac28 100644 --- a/arch/arm/mach-exynos/cpuidle.c +++ b/arch/arm/mach-exynos/cpuidle.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -34,22 +35,12 @@ #define S5P_CHECK_AFTR 0xFCBA0D10 -static int exynos4_enter_idle(struct cpuidle_device *dev, - struct cpuidle_driver *drv, - int index); static int exynos4_enter_lowpower(struct cpuidle_device *dev, struct cpuidle_driver *drv, int index); static struct cpuidle_state exynos4_cpuidle_set[] __initdata = { - [0] = { - .enter = exynos4_enter_idle, - .exit_latency = 1, - .target_residency = 100000, - .flags = CPUIDLE_FLAG_TIME_VALID, - .name = "C0", - .desc = "ARM clock gating(WFI)", - }, + [0] = ARM_CPUIDLE_WFI_STATE, [1] = { .enter = exynos4_enter_lowpower, .exit_latency = 300, @@ -63,8 +54,9 @@ static struct cpuidle_state exynos4_cpuidle_set[] __initdata = { static DEFINE_PER_CPU(struct cpuidle_device, exynos4_cpuidle_device); static struct cpuidle_driver exynos4_idle_driver = { - .name = "exynos4_idle", - .owner = THIS_MODULE, + .name = "exynos4_idle", + .owner = THIS_MODULE, + .en_core_tk_irqen = 1, }; /* Ext-GIC nIRQ/nFIQ is the only wakeup source in AFTR */ @@ -103,13 +95,8 @@ static int exynos4_enter_core0_aftr(struct cpuidle_device *dev, struct cpuidle_driver *drv, int index) { - struct timeval before, after; - int idle_time; unsigned long tmp; - local_irq_disable(); - do_gettimeofday(&before); - exynos4_set_wakeupmask(); /* Set value of power down register for aftr mode */ @@ -150,34 +137,6 @@ static int exynos4_enter_core0_aftr(struct cpuidle_device *dev, /* Clear wakeup state register */ __raw_writel(0x0, S5P_WAKEUP_STAT); - 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; -} - -static int exynos4_enter_idle(struct cpuidle_device *dev, - struct cpuidle_driver *drv, - int index) -{ - struct timeval before, after; - int idle_time; - - local_irq_disable(); - do_gettimeofday(&before); - - 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; } @@ -192,7 +151,7 @@ static int exynos4_enter_lowpower(struct cpuidle_device *dev, new_index = drv->safe_state_index; if (new_index == 0) - return exynos4_enter_idle(dev, drv, new_index); + return arm_cpuidle_simple_enter(dev, drv, new_index); else return exynos4_enter_core0_aftr(dev, drv, new_index); }