From patchwork Tue Mar 17 07:28:30 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kim kyuwon X-Patchwork-Id: 12570 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n2H7SWrQ027256 for ; Tue, 17 Mar 2009 07:28:33 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752450AbZCQH2d (ORCPT ); Tue, 17 Mar 2009 03:28:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752742AbZCQH2c (ORCPT ); Tue, 17 Mar 2009 03:28:32 -0400 Received: from rv-out-0506.google.com ([209.85.198.232]:20180 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752450AbZCQH2c (ORCPT ); Tue, 17 Mar 2009 03:28:32 -0400 Received: by rv-out-0506.google.com with SMTP id g37so2008287rvb.1 for ; Tue, 17 Mar 2009 00:28:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=Tlu7hFvEFmZ8DgnsMJUiGFmeQLN6/fNli/ipeh07/3s=; b=hoyvCMTHe16XD4Bh3q9bjmWXAqP8d0o1YAcA7LfYU/YpJP7B6sGQMXoDXtyF7RIaXm X2lqpdxlzufFZqecXqQEESdJ53oe8xDbjInOkwV4BLHThDWANuFP9SvPI6SOCL/wp08z tRDKI/CAjgIzqS57sstOOB4nTJeueJCFcgPOc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=RSuOW+dsSArqM6zTmiC1uflByTiGkNlW/5ToMH1bhTD8LaUC4dv8iNyCHS+uk+SVYF IhocLFCbWrErSKZQjUU2YQFdCCfH8SDG+qYe/rco0Q74KKxe41upzyLkLPrqZ+HaeAXp kSLCzlopqjH7qHMb0Y6JNKFAUQMafrBFR55/Y= MIME-Version: 1.0 Received: by 10.143.42.6 with SMTP id u6mr2638803wfj.121.1237274910438; Tue, 17 Mar 2009 00:28:30 -0700 (PDT) Date: Tue, 17 Mar 2009 16:28:30 +0900 Message-ID: <4d34a0a70903170028t1722d565i35ec12b476427ae6@mail.gmail.com> Subject: [PATCH 3/3] OMAP3: PM: invoke omap_sram_idle() only when sleep_while_idle is enabled From: Kim Kyuwon To: OMAP Cc: q1.kim@samsung.com, Kevin Hilman , Jouni Hogander , kyungmin.park@samsung.com Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org If MPU goes to WFI in the idle thread, execution time becomes a bit slow and the JTAG Debugger doesn't work. This patch is needed for urgent works(e.g. booting and launching application) and debugging. To enable sleep_while_idle mode, use below setting. echo 1 > /sys/power/sleep_while_idle Signed-off-by: Kim Kyuwon --- arch/arm/mach-omap2/cpuidle34xx.c | 3 +++ arch/arm/mach-omap2/pm34xx.c | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index 630108c..1623c2f 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c @@ -87,6 +87,9 @@ static int omap3_enter_idle(struct cpuidle_device *dev, local_irq_disable(); local_fiq_disable(); + if (!enable_dyn_sleep) + goto return_sleep_time; + if (!enable_off_mode) { if (mpu_state < PWRDM_POWER_RET) mpu_state = PWRDM_POWER_RET; diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 9102cee..402409c 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -484,8 +484,6 @@ static int omap3_fclks_active(void) int omap3_can_sleep(void) { - if (!enable_dyn_sleep) - return 0; if (!omap_uart_can_sleep()) return 0; if (omap3_fclks_active()) @@ -545,6 +543,9 @@ static void omap3_pm_idle(void) local_irq_disable(); local_fiq_disable(); + if (!enable_dyn_sleep) + goto out; + if (!omap3_can_sleep()) goto out;