From patchwork Thu Jul 28 08:30:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean Pihet X-Patchwork-Id: 1014902 Received: from smtp1.linux-foundation.org (smtp1.linux-foundation.org [140.211.169.13]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6S8YJb6020308 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Thu, 28 Jul 2011 08:34:39 GMT Received: from daredevil.linux-foundation.org (localhost [127.0.0.1]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id p6S8WkuF007654; Thu, 28 Jul 2011 01:32:47 -0700 Received: from mail-ww0-f43.google.com (mail-ww0-f43.google.com [74.125.82.43]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id p6S8Uvs1006927 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Thu, 28 Jul 2011 01:31:07 -0700 Received: by mail-ww0-f43.google.com with SMTP id 18so1876102wwi.24 for ; Thu, 28 Jul 2011 01:31:07 -0700 (PDT) Received: by 10.227.19.137 with SMTP id a9mr7303736wbb.105.1311841867228; Thu, 28 Jul 2011 01:31:07 -0700 (PDT) Received: from localhost.localdomain (60.73-66-87.adsl-dyn.isp.belgacom.be [87.66.73.60]) by mx.google.com with ESMTPS id eo18sm622335wbb.29.2011.07.28.01.31.05 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Jul 2011 01:31:06 -0700 (PDT) From: jean.pihet@newoldbits.com To: "Rafael J. Wysocki" , Paul Walmsley , Kevin Hilman , Magnus Damm , Linux PM mailing list , linux-omap@vger.kernel.org, markgross@thegnar.org, broonie@opensource.wolfsonmicro.com Date: Thu, 28 Jul 2011 10:30:14 +0200 Message-Id: <1311841821-10252-8-git-send-email-j-pihet@ti.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1311841821-10252-1-git-send-email-j-pihet@ti.com> References: <1311841821-10252-1-git-send-email-j-pihet@ti.com> Received-SPF: pass (localhost is always allowed.) X-Spam-Status: No, hits=-3.573 required=5 tests=AWL, BAYES_00, OSDL_HEADER_SUBJECT_BRACKETED X-Spam-Checker-Version: SpamAssassin 3.2.4-osdl_revision__1.47__ X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.21 Cc: Jean Pihet Subject: [linux-pm] [PATCH 07/13] OMAP PM: early init of the pwrdms states X-BeenThere: linux-pm@lists.linux-foundation.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux power management List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-pm-bounces@lists.linux-foundation.org Errors-To: linux-pm-bounces@lists.linux-foundation.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 28 Jul 2011 08:34:39 +0000 (UTC) From: Jean Pihet The powerdomains next states are initialized in pwrdms_setup as a late_initcall. Because the PM QoS devices constraint can be requested early in the boot sequence, the power domains next states can be overwritten by pwrdms_setup. This patch fixes it by initializing the power domains next states early at boot, so that the constraints can be applied. Later in the pwrdms_setup function the currently programmed next states are re-used as next state values. Applies to OMAP3 and OMAP4. Tested on OMAP3 Beagleboard and OMAP4 Pandaboard in RET/OFF using wake-up latency constraints on MPU, CORE and PER. Signed-off-by: Jean Pihet --- arch/arm/mach-omap2/pm34xx.c | 2 +- arch/arm/mach-omap2/pm44xx.c | 2 +- arch/arm/mach-omap2/powerdomain.c | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 96a7624..af626ac 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -822,7 +822,7 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused) if (!pwrst) return -ENOMEM; pwrst->pwrdm = pwrdm; - pwrst->next_state = PWRDM_POWER_RET; + pwrst->next_state = pwrdm_read_next_pwrst(pwrdm); list_add(&pwrst->node, &pwrst_list); if (pwrdm_has_hdwr_sar(pwrdm)) diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c index 59a870b..91ede72 100644 --- a/arch/arm/mach-omap2/pm44xx.c +++ b/arch/arm/mach-omap2/pm44xx.c @@ -84,7 +84,7 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused) if (!pwrst) return -ENOMEM; pwrst->pwrdm = pwrdm; - pwrst->next_state = PWRDM_POWER_ON; + pwrst->next_state = pwrdm_read_next_pwrst(pwrdm); list_add(&pwrst->node, &pwrst_list); return pwrdm_set_next_pwrst(pwrst->pwrdm, pwrst->next_state); diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index 9af0847..63c3e7a 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c @@ -108,6 +108,9 @@ static int _pwrdm_register(struct powerdomain *pwrdm) pwrdm->state = pwrdm_read_pwrst(pwrdm); pwrdm->state_counter[pwrdm->state] = 1; + /* Early init of the next power state */ + pwrdm_set_next_pwrst(pwrdm, PWRDM_POWER_RET); + pr_debug("powerdomain: registered %s\n", pwrdm->name); return 0;