From: Paul Walmsley <paul@pwsan.com> To: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 10/12] ARM: OMAP2+: powerdomain: skip previous-power-state read if next_pwrst is ON Date: Sun, 09 Dec 2012 13:03:30 -0700 [thread overview] Message-ID: <20121209200328.3196.96843.stgit@dusk.lan> (raw) In-Reply-To: <20121209200108.3196.12452.stgit@dusk.lan> If the powerdomain's next-power-state is set to ON, then we can skip the powerdomain previous-power-state read during pwrdm_post_transition(). This is both an optimization (for all OMAPs) and a fix (for OMAP2xxx). It turns out the OMAP2xxx previous power state mechanism is slightly different than the OMAP3+ mechanism. The bitfield can't be cleared, and it's only updated after a powerdomain power state transition. So reading this value before any powerdomain power state transition occurred will always return OFF (the reset value). After this patch, if the power domain was programmed to stay ON before pwrdm_pre_transition() is called, the previous power state code will return ON during pwrdm_post_transition(). Signed-off-by: Paul Walmsley <paul@pwsan.com> --- arch/arm/mach-omap2/powerdomain.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index a4bb0bb..72d6ce0 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c @@ -681,7 +681,9 @@ static int _pwrdm_post_transition_cb(struct powerdomain *pwrdm, void *unused) int prev, fpwrst; int trace_state = 0; - prev = _pwrdm_read_prev_fpwrst(pwrdm); + prev = (pwrdm->next_fpwrst == PWRDM_FUNC_PWRST_ON) ? + PWRDM_FUNC_PWRST_ON : _pwrdm_read_prev_fpwrst(pwrdm); + if (pwrdm->fpwrst != prev) pwrdm->fpwrst_counter[prev - PWRDM_FPWRST_OFFSET]++;
WARNING: multiple messages have this Message-ID (diff)
From: paul@pwsan.com (Paul Walmsley) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 10/12] ARM: OMAP2+: powerdomain: skip previous-power-state read if next_pwrst is ON Date: Sun, 09 Dec 2012 13:03:30 -0700 [thread overview] Message-ID: <20121209200328.3196.96843.stgit@dusk.lan> (raw) In-Reply-To: <20121209200108.3196.12452.stgit@dusk.lan> If the powerdomain's next-power-state is set to ON, then we can skip the powerdomain previous-power-state read during pwrdm_post_transition(). This is both an optimization (for all OMAPs) and a fix (for OMAP2xxx). It turns out the OMAP2xxx previous power state mechanism is slightly different than the OMAP3+ mechanism. The bitfield can't be cleared, and it's only updated after a powerdomain power state transition. So reading this value before any powerdomain power state transition occurred will always return OFF (the reset value). After this patch, if the power domain was programmed to stay ON before pwrdm_pre_transition() is called, the previous power state code will return ON during pwrdm_post_transition(). Signed-off-by: Paul Walmsley <paul@pwsan.com> --- arch/arm/mach-omap2/powerdomain.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index a4bb0bb..72d6ce0 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c @@ -681,7 +681,9 @@ static int _pwrdm_post_transition_cb(struct powerdomain *pwrdm, void *unused) int prev, fpwrst; int trace_state = 0; - prev = _pwrdm_read_prev_fpwrst(pwrdm); + prev = (pwrdm->next_fpwrst == PWRDM_FUNC_PWRST_ON) ? + PWRDM_FUNC_PWRST_ON : _pwrdm_read_prev_fpwrst(pwrdm); + if (pwrdm->fpwrst != prev) pwrdm->fpwrst_counter[prev - PWRDM_FPWRST_OFFSET]++;
next prev parent reply other threads:[~2012-12-09 20:05 UTC|newest] Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-12-09 20:02 [PATCH 00/12] ARM: OMAP2+: powerdomain updates after the functional power state conversion Paul Walmsley 2012-12-09 20:02 ` Paul Walmsley 2012-12-09 20:02 ` [PATCH 01/12] ARM: OMAP2+: powerdomain: consolidate arch_pwrdm check code Paul Walmsley 2012-12-09 20:02 ` Paul Walmsley 2012-12-09 20:03 ` [PATCH 02/12] ARM: OMAP2+: PM/powerdomain: move the power state time tracking into the powerdomain code Paul Walmsley 2012-12-09 20:03 ` Paul Walmsley 2012-12-09 20:03 ` [PATCH 03/12] ARM: OMAP2+: powerdomain: split pwrdm_state_switch() Paul Walmsley 2012-12-09 20:03 ` Paul Walmsley 2012-12-09 20:03 ` [PATCH 04/12] ARM: OMAP2+: PM: clean up some debugfs functions Paul Walmsley 2012-12-09 20:03 ` Paul Walmsley 2012-12-09 20:03 ` [PATCH 05/12] ARM: OMAP2+: powerdomain: remove some redundant checks; add some notes Paul Walmsley 2012-12-09 20:03 ` [PATCH 06/12] ARM: OMAP2+: CM: use the cached copy of the clockdomain's hwsup state Paul Walmsley 2012-12-09 20:03 ` Paul Walmsley 2012-12-09 20:03 ` [PATCH 07/12] ARM: OMAP2+: powerdomain: cache the powerdomain next power state Paul Walmsley 2012-12-09 20:03 ` Paul Walmsley 2012-12-09 20:03 ` [PATCH 08/12] ARM: OMAP2+: powerdomain: cache the powerdomain's previous " Paul Walmsley 2012-12-09 20:03 ` Paul Walmsley 2012-12-09 20:03 ` [PATCH 09/12] ARM: OMAP2+: powerdomain: skip register reads for powerdomains known to be on Paul Walmsley 2012-12-09 20:03 ` Paul Walmsley 2012-12-12 10:22 ` Vaibhav Hiremath 2012-12-12 10:22 ` Vaibhav Hiremath 2012-12-19 21:09 ` Jon Hunter 2012-12-19 21:09 ` Jon Hunter 2012-12-20 17:22 ` Paul Walmsley 2012-12-20 17:22 ` Paul Walmsley 2012-12-21 6:33 ` Santosh Shilimkar 2012-12-21 6:33 ` Santosh Shilimkar 2012-12-26 6:21 ` Bedia, Vaibhav 2012-12-26 6:21 ` Bedia, Vaibhav 2012-12-26 6:31 ` Bedia, Vaibhav 2012-12-26 6:31 ` Bedia, Vaibhav 2012-12-26 20:49 ` Paul Walmsley 2012-12-26 20:49 ` Paul Walmsley 2012-12-09 20:03 ` Paul Walmsley [this message] 2012-12-09 20:03 ` [PATCH 10/12] ARM: OMAP2+: powerdomain: skip previous-power-state read if next_pwrst is ON Paul Walmsley 2012-12-09 20:03 ` [PATCH 11/12] ARM: OMAP2xxx: powerdomain: add previous power state tracking Paul Walmsley 2012-12-09 20:03 ` Paul Walmsley 2012-12-09 20:03 ` [PATCH 12/12] ARM: OMAP2xxx: PM: add pwrdm_(pre|post)_transition() calls to the 2xxx PM code Paul Walmsley 2012-12-09 20:03 ` Paul Walmsley 2013-01-04 14:26 ` [PATCH 00/12] ARM: OMAP2+: powerdomain updates after the functional power state conversion Tero Kristo 2013-01-04 14:26 ` 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=20121209200328.3196.96843.stgit@dusk.lan \ --to=paul@pwsan.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-omap@vger.kernel.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.