linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: khilman@linaro.org (Kevin Hilman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 16/18] ARM: OMAP4+: CPUidle: Deprecate use of omap4_mpuss_read_prev_context_state()
Date: Wed, 03 Apr 2013 14:37:18 -0700	[thread overview]
Message-ID: <876203qos1.fsf@linaro.org> (raw)
In-Reply-To: <1364205910-32392-17-git-send-email-santosh.shilimkar@ti.com> (Santosh Shilimkar's message of "Mon, 25 Mar 2013 15:35:08 +0530")

Santosh Shilimkar <santosh.shilimkar@ti.com> writes:

> Current OMAP4 CPUIdle driver is using omap4_mpuss_read_prev_context_state()
> function to check whether the MPU cluster lost context or not. Thanks to
> couple CPUIdle, cluster low power entry is almost guaranteed and hence
> the programmed cluster check is enough in idle exit path. The API was
> more of an optimization for corner cases, where if the cluster low power
> entry fails for some reason, the cluster context restore gets skipped.
>
> Moving forward, OMAP CPUidle drivers needs to be moved to drivers/idle/*
> once the PRM/CM code gets moved to drivers. This patch also reduces one
> dependency with platform code for idle driver movement.
>
> Acked-by: Nishanth Menon <nm@ti.com>
> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>

Looks good, but I find the changelog a bit confusing.

Below is a slightly modified patch (I only modified the changelog).  If
those changes are OK with you, I'll add it to my cpuidle branch as well.

Kevin

>From c01794dc249f826f0714578f26ff9efd35ea6296 Mon Sep 17 00:00:00 2001
From: Santosh Shilimkar <santosh.shilimkar@ti.com>
Date: Mon, 25 Mar 2013 15:35:08 +0530
Subject: [PATCH] ARM: OMAP4+: CPUidle: Deprecate use of
 omap4_mpuss_read_prev_context_state()

Current OMAP4 CPUIdle driver is using omap4_mpuss_read_prev_context_state()
to check whether the MPU cluster lost context or not before calling
cpu_cluster_pm_exit().  This was initially done an optimization for
corner cases, where if the cluster low power entry fails for some
reason, the cluster context restore gets skipped.  However, since
reading the previous context is expensive (involving slow accesses to
the PRCM), it's better to avoid it and simply check the target cluster
state instead.

Moving forward, OMAP CPUidle drivers needs to be moved to drivers/idle/*
once the PRM/CM code gets moved to drivers. This patch also reduces one
dependency with platform code for idle driver movement.

Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
[khilman at linaro.org: minor changelog edits]
Signed-off-by: Kevin Hilman <khilman@linaro.org>
---
 arch/arm/mach-omap2/common.h              |  5 -----
 arch/arm/mach-omap2/cpuidle44xx.c         |  3 ++-
 arch/arm/mach-omap2/omap-mpuss-lowpower.c | 14 --------------
 3 files changed, 2 insertions(+), 20 deletions(-)

diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 40f4a03..f5c9983 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -249,7 +249,6 @@ extern int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state);
 extern int omap4_finish_suspend(unsigned long cpu_state);
 extern void omap4_cpu_resume(void);
 extern int omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state);
-extern u32 omap4_mpuss_read_prev_context_state(void);
 #else
 static inline int omap4_enter_lowpower(unsigned int cpu,
 					unsigned int power_state)
@@ -277,10 +276,6 @@ static inline int omap4_finish_suspend(unsigned long cpu_state)
 static inline void omap4_cpu_resume(void)
 {}
 
-static inline u32 omap4_mpuss_read_prev_context_state(void)
-{
-	return 0;
-}
 #endif
 
 struct omap_sdrc_params;
diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c
index 354517a..3cad103 100644
--- a/arch/arm/mach-omap2/cpuidle44xx.c
+++ b/arch/arm/mach-omap2/cpuidle44xx.c
@@ -149,7 +149,8 @@ static int omap4_enter_idle_coupled(struct cpuidle_device *dev,
 	 * Call idle CPU cluster PM exit notifier chain
 	 * to restore GIC and wakeupgen context.
 	 */
-	if (omap4_mpuss_read_prev_context_state())
+	if ((cx->mpu_state == PWRDM_POWER_RET) &&
+		(cx->mpu_logic_state == PWRDM_POWER_OFF))
 		cpu_cluster_pm_exit();
 
 	clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu_id);
diff --git a/arch/arm/mach-omap2/omap-mpuss-lowpower.c b/arch/arm/mach-omap2/omap-mpuss-lowpower.c
index 8bcb64b..e80327b 100644
--- a/arch/arm/mach-omap2/omap-mpuss-lowpower.c
+++ b/arch/arm/mach-omap2/omap-mpuss-lowpower.c
@@ -139,20 +139,6 @@ static inline void cpu_clear_prev_logic_pwrst(unsigned int cpu_id)
 	}
 }
 
-/**
- * omap4_mpuss_read_prev_context_state:
- * Function returns the MPUSS previous context state
- */
-u32 omap4_mpuss_read_prev_context_state(void)
-{
-	u32 reg;
-
-	reg = omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION,
-		OMAP4430_PRM_MPU_INST, OMAP4_RM_MPU_MPU_CONTEXT_OFFSET);
-	reg &= OMAP4430_LOSTCONTEXT_DFF_MASK;
-	return reg;
-}
-
 /*
  * Store the CPU cluster state for L2X0 low power operations.
  */
-- 
1.8.2

  reply	other threads:[~2013-04-03 21:37 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-25 10:04 [PATCH v2 00/18] ARM: OMAP5: PM: Add MPUSS suspend and CPUidle support Santosh Shilimkar
2013-03-25 10:04 ` [PATCH v2 01/18] ARM: OMAP4+: PM: Consolidate MPU subsystem PM code for re-use Santosh Shilimkar
2013-04-03 19:44   ` Kevin Hilman
2013-04-04 11:32     ` Santosh Shilimkar
2013-03-25 10:04 ` [PATCH v2 02/18] ARM: OMAP5: PM: Update CPU context register offset Santosh Shilimkar
2013-03-25 10:04 ` [PATCH v2 03/18] ARM: OMAP4+: PM: Consolidate and use OMAP4 PM code for OMAP5 Santosh Shilimkar
2013-04-03 20:20   ` Kevin Hilman
2013-04-04 11:51     ` Santosh Shilimkar
2013-04-04 11:55       ` Santosh Shilimkar
2013-03-25 10:04 ` [PATCH v2 04/18] ARM: OMAP5: PM: Set MPUSS-EMIF clock-domain static dependency Santosh Shilimkar
2013-03-25 10:04 ` [PATCH v2 05/18] ARM: OMAP5: PM: Enables ES2 PM mode by default Santosh Shilimkar
2013-04-03 20:25   ` Kevin Hilman
2013-04-04 12:02     ` Santosh Shilimkar
2013-03-25 10:04 ` [PATCH v2 06/18] ARM: OMAP5: PM: Enable Mercury retention mode on CPUx powerdomains Santosh Shilimkar
2013-04-03 20:31   ` Kevin Hilman
2013-04-04 12:08     ` Santosh Shilimkar
2013-03-25 10:04 ` [PATCH v2 07/18] ARM: OMAP5: Add init_late() hook to enable pm initialization Santosh Shilimkar
2013-04-03 20:33   ` Kevin Hilman
2013-04-04 12:28     ` Santosh Shilimkar
2013-03-25 10:05 ` [PATCH v2 08/18] ARM: OMAP5: PM: Add CPU power off in hotplug path Santosh Shilimkar
2013-04-03 20:49   ` Kevin Hilman
2013-04-04 13:23     ` Santosh Shilimkar
2013-04-04 17:31       ` Kevin Hilman
2013-04-05  9:04         ` Santosh Shilimkar
2013-03-25 10:05 ` [PATCH v2 09/18] ARM: OMAP4+: PM: Restore CPU power state to ON with clockdomain force wakeup method Santosh Shilimkar
2013-04-03 20:54   ` Kevin Hilman
2013-04-04 13:37     ` Santosh Shilimkar
2013-04-04 17:42       ` Kevin Hilman
2013-04-05  9:07         ` Santosh Shilimkar
2013-04-05 11:58           ` Santosh Shilimkar
2013-03-25 10:05 ` [PATCH v2 10/18] ARM: OMAP5: PM: Add MPU Open Switch Retention support Santosh Shilimkar
2013-03-25 10:05 ` [PATCH v2 11/18] ARM: OMAP5: PM: Add L2 memory power down support Santosh Shilimkar
2013-04-03 20:58   ` Kevin Hilman
2013-04-04 13:46     ` Santosh Shilimkar
2013-03-25 10:05 ` [PATCH v2 12/18] ARM: OMAP4: CPUidle: Avoid double idle driver registration Santosh Shilimkar
2013-04-03 21:03   ` Kevin Hilman
2013-04-04 13:47     ` Santosh Shilimkar
2013-03-25 10:05 ` [PATCH v2 13/18] ARM: OMAP: CPUidle: Unregister drivere on device registration failure Santosh Shilimkar
2013-04-03 21:03   ` Kevin Hilman
2013-04-04 13:48     ` Santosh Shilimkar
2013-03-25 10:05 ` [PATCH v2 14/18] ARM: OMAP4: CPUidle: Make C-state description field more precise Santosh Shilimkar
2013-04-03 21:05   ` Kevin Hilman
2013-04-04 13:48     ` Santosh Shilimkar
2013-03-25 10:05 ` [PATCH v2 15/18] ARM: OMAP4+: CPUidle: Consolidate idle driver for OMAP5 support Santosh Shilimkar
2013-04-03 21:10   ` Kevin Hilman
2013-04-04 14:04     ` Santosh Shilimkar
2013-03-25 10:05 ` [PATCH v2 16/18] ARM: OMAP4+: CPUidle: Deprecate use of omap4_mpuss_read_prev_context_state() Santosh Shilimkar
2013-04-03 21:37   ` Kevin Hilman [this message]
2013-04-04 13:59     ` Santosh Shilimkar
2013-03-25 10:05 ` [PATCH v2 17/18] ARM: OMAP4+: CPUidle: Add OMAP5 idle driver support Santosh Shilimkar
2013-04-03 21:25   ` Kevin Hilman
2013-04-04 14:16     ` Santosh Shilimkar
2013-04-04 17:55       ` Kevin Hilman
2013-04-05  9:41         ` Santosh Shilimkar
2013-03-25 10:05 ` [PATCH v2 18/18] ARM: OMAP5: PM: handle device instance for warm reset Santosh Shilimkar
2013-03-25 11:46 ` [PATCH v2 00/18] ARM: OMAP5: PM: Add MPUSS suspend and CPUidle support Lokesh Vutla
2013-03-25 12:10   ` Santosh Shilimkar
2013-03-25 12:27 ` Sourav Poddar
2013-03-25 12:47   ` Rajendra Nayak
2013-03-25 13:00     ` Sourav Poddar
2013-04-03 22:52 ` Kevin Hilman
2013-04-04 14:34   ` Santosh Shilimkar
2013-04-04 16:49     ` Santosh Shilimkar
2013-04-04 17:57       ` Kevin Hilman

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=876203qos1.fsf@linaro.org \
    --to=khilman@linaro.org \
    --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).