From patchwork Wed Feb 16 09:01:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishwanath BS X-Patchwork-Id: 154 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:40:23 -0000 Delivered-To: patches@linaro.org Received: by 10.146.25.23 with SMTP id 23cs5691yay; Wed, 16 Feb 2011 00:58:17 -0800 (PST) Received: by 10.236.95.17 with SMTP id o17mr614744yhf.56.1297846696607; Wed, 16 Feb 2011 00:58:16 -0800 (PST) Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by mx.google.com with ESMTPS id j48si9474057yha.4.2011.02.16.00.58.16 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 16 Feb 2011 00:58:16 -0800 (PST) Received-SPF: pass (google.com: domain of vishwanath.bs@ti.com designates 198.47.26.152 as permitted sender) client-ip=198.47.26.152; Authentication-Results: mx.google.com; spf=pass (google.com: domain of vishwanath.bs@ti.com designates 198.47.26.152 as permitted sender) smtp.mail=vishwanath.bs@ti.com Received: from dbdp31.itg.ti.com ([172.24.170.98]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id p1G8wDjJ028662 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Feb 2011 02:58:15 -0600 Received: from localhost.localdomain (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p1G8wA8Z018858; Wed, 16 Feb 2011 14:28:12 +0530 (IST) From: Vishwanath BS To: linux-omap@vger.kernel.org Cc: patches@linaro.org, Vishwanath BS Subject: [PATCH 1/3] OMAP3 PM: Deny clock gating only for safe state Date: Wed, 16 Feb 2011 14:31:12 +0530 Message-Id: <1297846874-18286-2-git-send-email-vishwanath.bs@ti.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1297846874-18286-1-git-send-email-vishwanath.bs@ti.com> References: <1297846874-18286-1-git-send-email-vishwanath.bs@ti.com> Currently clock gating for MPU and core are denied whenever C1 state is selected. It should be denied only when safe state is selected. Signed-off-by: Vishwanath BS --- arch/arm/mach-omap2/cpuidle34xx.c | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index f8e35b3..1e4ec7f 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c @@ -139,19 +139,9 @@ static int omap3_enter_idle(struct cpuidle_device *dev, if (omap_irq_pending() || need_resched()) goto return_sleep_time; - if (cx->type == OMAP3_STATE_C1) { - pwrdm_for_each_clkdm(mpu_pd, _cpuidle_deny_idle); - pwrdm_for_each_clkdm(core_pd, _cpuidle_deny_idle); - } - /* Execute ARM wfi */ omap_sram_idle(); - if (cx->type == OMAP3_STATE_C1) { - pwrdm_for_each_clkdm(mpu_pd, _cpuidle_allow_idle); - pwrdm_for_each_clkdm(core_pd, _cpuidle_allow_idle); - } - return_sleep_time: getnstimeofday(&ts_postidle); ts_idle = timespec_sub(ts_postidle, ts_preidle); @@ -315,8 +305,18 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev, select_state: dev->last_state = new_state; + + if (new_state == dev->safe_state) { + pwrdm_for_each_clkdm(mpu_pd, _cpuidle_deny_idle); + pwrdm_for_each_clkdm(core_pd, _cpuidle_deny_idle); + } ret = omap3_enter_idle(dev, new_state); + if (new_state == dev->safe_state) { + pwrdm_for_each_clkdm(mpu_pd, _cpuidle_allow_idle); + pwrdm_for_each_clkdm(core_pd, _cpuidle_allow_idle); + } + /* Restore original PER state if it was modified */ if (per_next_state != per_saved_state) pwrdm_set_next_pwrst(per_pd, per_saved_state);