From: jean.pihet@newoldbits.com
To: "Rafael J. Wysocki" <rjw@sisk.pl>, Paul Walmsley <paul@pwsan.com>,
Kevin Hilman <khilman@ti.com>,
Magnus Damm <magnus.damm@gmail.com>,
Linux PM mailing list <linux-pm@lists.linux-foun>
Cc: Jean Pihet <j-pihet@ti.com>
Subject: [PATCH 07/13] OMAP PM: early init of the pwrdms states
Date: Thu, 28 Jul 2011 10:30:14 +0200 [thread overview]
Message-ID: <1311841821-10252-8-git-send-email-j-pihet@ti.com> (raw)
In-Reply-To: <1311841821-10252-1-git-send-email-j-pihet@ti.com>
From: Jean Pihet <j-pihet@ti.com>
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 <j-pihet@ti.com>
---
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;
--
1.7.2.5
next prev parent reply other threads:[~2011-07-28 8:31 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-28 8:30 [RFC/PATCH v3 00/13] PM QoS: add a per-device latency constraints class jean.pihet
2011-07-28 8:30 ` [PATCH 01/13] PM: QoS: rename pm_qos_params files to pm_qos jean.pihet
2011-07-29 21:57 ` Rafael J. Wysocki
2011-08-02 9:31 ` Jean Pihet
2011-08-02 9:47 ` Rafael J. Wysocki
2011-07-28 8:30 ` [PATCH 02/13] PM: add a per-device wake-up latency constraints plist jean.pihet
2011-07-29 21:58 ` Rafael J. Wysocki
2011-07-28 8:30 ` [PATCH 03/13] PM: QoS: extend the in-kernel API with per-device latency constraints jean.pihet
2011-07-29 22:55 ` Rafael J. Wysocki
2011-08-02 9:41 ` Jean Pihet
2011-08-02 21:02 ` Rafael J. Wysocki
2011-08-02 18:01 ` Kevin Hilman
2011-07-28 8:30 ` [PATCH 04/13] PM: QoS: implement the " jean.pihet
2011-07-30 22:30 ` Rafael J. Wysocki
2011-08-02 10:05 ` Jean Pihet
2011-08-02 21:13 ` Rafael J. Wysocki
2011-07-28 8:30 ` [PATCH 05/13] PM: QoS: support the dynamic insertion and removal of devices jean.pihet
2011-07-30 22:38 ` Rafael J. Wysocki
2011-08-02 10:07 ` Jean Pihet
2011-07-28 8:30 ` [PATCH 06/13] OMAP PM: create a PM layer plugin for per-device constraints jean.pihet
2011-07-28 8:30 ` jean.pihet [this message]
2011-07-29 8:08 ` [PATCH 07/13] OMAP PM: early init of the pwrdms states Todd Poynor
2011-07-29 8:50 ` Jean Pihet
2011-08-02 8:57 ` Jean Pihet
2011-08-11 15:12 ` Jean Pihet
2011-07-28 8:30 ` [PATCH 08/13] OMAP2+: powerdomain: control power domains next state jean.pihet
2011-07-29 7:59 ` Todd Poynor
2011-07-29 8:47 ` Jean Pihet
2011-07-29 18:00 ` Todd Poynor
2011-08-11 15:09 ` Jean Pihet
2011-07-28 8:30 ` [PATCH 09/13] OMAP3: powerdomain data: add wake-up latency figures jean.pihet
2011-07-28 8:30 ` [PATCH 10/13] OMAP4: " jean.pihet
2011-07-28 8:30 ` [PATCH 11/13] OMAP2+: omap_hwmod: manage the wake-up latency constraints jean.pihet
2011-07-28 8:30 ` [PATCH 12/13] OMAP: PM CONSTRAINTS: implement the devices " jean.pihet
2011-07-28 8:30 ` [PATCH 13/13] OMAP2+: cpuidle only influences the MPU state jean.pihet
2011-07-28 13:14 ` [RFC/PATCH v3 00/13] PM QoS: add a per-device latency constraints class mark gross
2011-07-29 8:37 ` Jean Pihet
2011-07-29 14:24 ` mark gross
2011-07-29 21:46 ` Rafael J. Wysocki
2011-07-31 17:38 ` [linux-pm] " mark gross
2011-07-29 21:25 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1311841821-10252-8-git-send-email-j-pihet@ti.com \
--to=jean.pihet@newoldbits.com \
--cc=j-pihet@ti.com \
--cc=khilman@ti.com \
--cc=linux-pm@lists.linux-foun \
--cc=magnus.damm@gmail.com \
--cc=paul@pwsan.com \
--cc=rjw@sisk.pl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).