linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: paul@pwsan.com (Paul Walmsley)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 11/12] ARM: OMAP2+: powerdomain: program memory bank next-power-state upon init
Date: Sun, 09 Dec 2012 10:53:37 -0700	[thread overview]
Message-ID: <20121209175335.6933.37266.stgit@dusk.lan> (raw)
In-Reply-To: <20121209174545.6933.59371.stgit@dusk.lan>

During powerdomain init, we were previously programming a reasonable
default for the powerdomain and logic next-power-state fields, but not
touching the memory bank next-power-state fields.  To ensure that the
previous OS or bootloader didn't leave the system in a bad state, program
the memory bank next-power-state bitfields to reasonable defaults.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
 arch/arm/mach-omap2/powerdomain.c |   21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index fdeabbf..a70e3f6 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -563,21 +563,28 @@ int pwrdm_register_pwrdms(struct powerdomain **ps)
  *
  * Do whatever is necessary to initialize registered powerdomains and
  * powerdomain code.  Currently, this programs the next power state
- * for each powerdomain to ON.  This prevents powerdomains from
- * unexpectedly losing context or entering high wakeup latency modes
- * with non-power-management-enabled kernels.  Must be called after
- * pwrdm_register_pwrdms().  Returns -EACCES if called before
- * pwrdm_register_pwrdms(), or 0 upon success.
+ * for each powerdomain to ON, and programs the memory bank power
+ * states to follow the powerdomain power states.  This prevents
+ * powerdomains from unexpectedly losing context or entering high
+ * wakeup latency modes with non-power-management-enabled kernels.
+ * Must be called after pwrdm_register_pwrdms().  Returns -EACCES if
+ * called before pwrdm_register_pwrdms(), or 0 upon success.
  */
 int pwrdm_complete_init(void)
 {
 	struct powerdomain *temp_p;
+	int i;
 
 	if (list_empty(&pwrdm_list))
 		return -EACCES;
 
-	list_for_each_entry(temp_p, &pwrdm_list, node)
-		pwrdm_set_next_fpwrst(temp_p, PWRDM_FUNC_PWRST_ON);
+	list_for_each_entry(temp_p, &pwrdm_list, node) {
+		for (i = 0; i < temp_p->banks; i++) {
+			pwrdm_set_mem_onst(temp_p, i, PWRDM_POWER_ON);
+			pwrdm_set_mem_retst(temp_p, i, PWRDM_POWER_RET);
+		}
+		WARN_ON(pwrdm_set_next_fpwrst(temp_p, PWRDM_FUNC_PWRST_ON));
+	}
 
 	return 0;
 }

  parent reply	other threads:[~2012-12-09 17:53 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-09 17:52 [PATCH 00/12] ARM: OMAP2+: powerdomain/PM: convert to functional power states Paul Walmsley
2012-12-09 17:52 ` [PATCH 01/12] ARM: OMAP2+: powerdomain: add functions that report on powerdomain capabilities Paul Walmsley
2012-12-09 17:53 ` [PATCH 02/12] ARM: OMAP2+: PM: introduce power domains functional states Paul Walmsley
2012-12-12 10:00   ` Jean Pihet
2013-01-29 21:20     ` Paul Walmsley
2012-12-12 10:21   ` Vaibhav Hiremath
2012-12-12 10:33   ` Jean Pihet
2013-01-04 13:22     ` Tero Kristo
2012-12-26  6:06   ` Bedia, Vaibhav
2012-12-09 17:53 ` [PATCH 03/12] ARM: OMAP2+: PM debug: trace the functional power domains states Paul Walmsley
2012-12-09 17:53 ` [PATCH 04/12] ARM: OMAP2xxx: PM: convert to use the functional power states API Paul Walmsley
2012-12-09 17:53 ` [PATCH 05/12] ARM: OMAP3xxx: " Paul Walmsley
2012-12-12 10:18   ` Jean Pihet
2012-12-12 10:29   ` Jean Pihet
2013-01-04 13:45   ` Tero Kristo
2012-12-09 17:53 ` [PATCH 06/12] ARM: OMAP44xx: " Paul Walmsley
2012-12-12 10:41   ` Jean Pihet
2013-01-04 14:01   ` Tero Kristo
2012-12-09 17:53 ` [PATCH 07/12] ARM: OMAP2+: PM: use power domain functional state in stats counters Paul Walmsley
2012-12-12 10:46   ` Jean Pihet
2013-01-04 14:07   ` Tero Kristo
2012-12-09 17:53 ` [PATCH 08/12] ARM: OMAP2+: powerdomain: drop many low-level powerdomain funcs Paul Walmsley
2012-12-09 17:53 ` [PATCH 09/12] ARM: OMAP2+: powerdomain: add ability to test for supported power states Paul Walmsley
2012-12-09 17:53 ` [PATCH 10/12] ARM: OMAP2+: powerdomain/PM: only program " Paul Walmsley
2012-12-09 17:53 ` Paul Walmsley [this message]
2012-12-09 17:53 ` [PATCH 12/12] ARM: OMAP2+: powerdomain: assume memory bank power states follow powerdomain Paul Walmsley
2013-01-04 14:12 ` [PATCH 00/12] ARM: OMAP2+: powerdomain/PM: convert to functional power states Tero Kristo

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=20121209175335.6933.37266.stgit@dusk.lan \
    --to=paul@pwsan.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).