All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] OMAP3: PM: fix save secure RAM to restore MPU power state
@ 2011-01-26  0:50 ` Kevin Hilman
  0 siblings, 0 replies; 6+ messages in thread
From: Kevin Hilman @ 2011-01-26  0:50 UTC (permalink / raw)
  To: linux-omap; +Cc: linux-arm-kernel, Tero Kristo

Currently, on HS/EMU devices, MPU power state forced to on during PM
init by the save secure RAM code.  Rather than forcing the state of
MPU powerdomain to on, simply read the current value and restore it
after the ROM code has run.

This only affects the !CPUidle case since when CPUidle is enabled, the
MPU power state is dynamically changed by CPUidle.  In the !CPUidle
case, MPU power state is initialized once at init and never touched.

Cc: Tero Kristo <tero.kristo@nokia.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
---
If no objectsions, will be queued in my pm-fixes branch for 2.6.38-rc.

 arch/arm/mach-omap2/pm34xx.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 8cbbead..1916038 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -168,9 +168,10 @@ static void omap3_core_restore_context(void)
  * once during boot sequence, but this works as we are not using secure
  * services.
  */
-static void omap3_save_secure_ram_context(u32 target_mpu_state)
+static void omap3_save_secure_ram_context(void)
 {
 	u32 ret;
+	int mpu_next_state = pwrdm_read_next_pwrst(mpu_pwrdm);
 
 	if (omap_type() != OMAP2_DEVICE_TYPE_GP) {
 		/*
@@ -181,7 +182,7 @@ static void omap3_save_secure_ram_context(u32 target_mpu_state)
 		pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON);
 		ret = _omap_save_secure_sram((u32 *)
 				__pa(omap3_secure_ram_storage));
-		pwrdm_set_next_pwrst(mpu_pwrdm, target_mpu_state);
+		pwrdm_set_next_pwrst(mpu_pwrdm, mpu_next_state);
 		/* Following is for error tracking, it should not happen */
 		if (ret) {
 			printk(KERN_ERR "save_secure_sram() returns %08x\n",
@@ -1094,7 +1095,7 @@ static int __init omap3_pm_init(void)
 		local_fiq_disable();
 
 		omap_dma_global_context_save();
-		omap3_save_secure_ram_context(PWRDM_POWER_ON);
+		omap3_save_secure_ram_context();
 		omap_dma_global_context_restore();
 
 		local_irq_enable();
-- 
1.7.3.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] OMAP3: PM: fix save secure RAM to restore MPU power state
@ 2011-01-26  0:50 ` Kevin Hilman
  0 siblings, 0 replies; 6+ messages in thread
From: Kevin Hilman @ 2011-01-26  0:50 UTC (permalink / raw)
  To: linux-arm-kernel

Currently, on HS/EMU devices, MPU power state forced to on during PM
init by the save secure RAM code.  Rather than forcing the state of
MPU powerdomain to on, simply read the current value and restore it
after the ROM code has run.

This only affects the !CPUidle case since when CPUidle is enabled, the
MPU power state is dynamically changed by CPUidle.  In the !CPUidle
case, MPU power state is initialized once at init and never touched.

Cc: Tero Kristo <tero.kristo@nokia.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
---
If no objectsions, will be queued in my pm-fixes branch for 2.6.38-rc.

 arch/arm/mach-omap2/pm34xx.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 8cbbead..1916038 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -168,9 +168,10 @@ static void omap3_core_restore_context(void)
  * once during boot sequence, but this works as we are not using secure
  * services.
  */
-static void omap3_save_secure_ram_context(u32 target_mpu_state)
+static void omap3_save_secure_ram_context(void)
 {
 	u32 ret;
+	int mpu_next_state = pwrdm_read_next_pwrst(mpu_pwrdm);
 
 	if (omap_type() != OMAP2_DEVICE_TYPE_GP) {
 		/*
@@ -181,7 +182,7 @@ static void omap3_save_secure_ram_context(u32 target_mpu_state)
 		pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON);
 		ret = _omap_save_secure_sram((u32 *)
 				__pa(omap3_secure_ram_storage));
-		pwrdm_set_next_pwrst(mpu_pwrdm, target_mpu_state);
+		pwrdm_set_next_pwrst(mpu_pwrdm, mpu_next_state);
 		/* Following is for error tracking, it should not happen */
 		if (ret) {
 			printk(KERN_ERR "save_secure_sram() returns %08x\n",
@@ -1094,7 +1095,7 @@ static int __init omap3_pm_init(void)
 		local_fiq_disable();
 
 		omap_dma_global_context_save();
-		omap3_save_secure_ram_context(PWRDM_POWER_ON);
+		omap3_save_secure_ram_context();
 		omap_dma_global_context_restore();
 
 		local_irq_enable();
-- 
1.7.3.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* RE: [PATCH] OMAP3: PM: fix save secure RAM to restore MPU power state
  2011-01-26  0:50 ` Kevin Hilman
@ 2011-01-26  9:27   ` Tero.Kristo at nokia.com
  -1 siblings, 0 replies; 6+ messages in thread
From: Tero.Kristo @ 2011-01-26  9:27 UTC (permalink / raw)
  To: khilman, linux-omap; +Cc: linux-arm-kernel



>-----Original Message-----
>From: ext Kevin Hilman [mailto:khilman@ti.com]
>Sent: 26 January, 2011 02:50
>To: linux-omap@vger.kernel.org
>Cc: linux-arm-kernel@lists.infradead.org; Kristo Tero (Nokia-MS/Tampere)
>Subject: [PATCH] OMAP3: PM: fix save secure RAM to restore MPU power
>state
>
>Currently, on HS/EMU devices, MPU power state forced to on during PM
>init by the save secure RAM code.  Rather than forcing the state of
>MPU powerdomain to on, simply read the current value and restore it
>after the ROM code has run.
>
>This only affects the !CPUidle case since when CPUidle is enabled, the
>MPU power state is dynamically changed by CPUidle.  In the !CPUidle
>case, MPU power state is initialized once at init and never touched.
>
>Cc: Tero Kristo <tero.kristo@nokia.com>
>Signed-off-by: Kevin Hilman <khilman@ti.com>
>---
>If no objectsions, will be queued in my pm-fixes branch for 2.6.38-rc.

Looks good to me. Ack, if you need one.
 
>
> arch/arm/mach-omap2/pm34xx.c |    7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
>
>diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
>index 8cbbead..1916038 100644
>--- a/arch/arm/mach-omap2/pm34xx.c
>+++ b/arch/arm/mach-omap2/pm34xx.c
>@@ -168,9 +168,10 @@ static void omap3_core_restore_context(void)
>  * once during boot sequence, but this works as we are not using secure
>  * services.
>  */
>-static void omap3_save_secure_ram_context(u32 target_mpu_state)
>+static void omap3_save_secure_ram_context(void)
> {
> 	u32 ret;
>+	int mpu_next_state = pwrdm_read_next_pwrst(mpu_pwrdm);
>
> 	if (omap_type() != OMAP2_DEVICE_TYPE_GP) {
> 		/*
>@@ -181,7 +182,7 @@ static void omap3_save_secure_ram_context(u32
>target_mpu_state)
> 		pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON);
> 		ret = _omap_save_secure_sram((u32 *)
> 				__pa(omap3_secure_ram_storage));
>-		pwrdm_set_next_pwrst(mpu_pwrdm, target_mpu_state);
>+		pwrdm_set_next_pwrst(mpu_pwrdm, mpu_next_state);
> 		/* Following is for error tracking, it should not happen */
> 		if (ret) {
> 			printk(KERN_ERR "save_secure_sram() returns %08x\n",
>@@ -1094,7 +1095,7 @@ static int __init omap3_pm_init(void)
> 		local_fiq_disable();
>
> 		omap_dma_global_context_save();
>-		omap3_save_secure_ram_context(PWRDM_POWER_ON);
>+		omap3_save_secure_ram_context();
> 		omap_dma_global_context_restore();
>
> 		local_irq_enable();
>--
>1.7.3.5


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] OMAP3: PM: fix save secure RAM to restore MPU power state
@ 2011-01-26  9:27   ` Tero.Kristo at nokia.com
  0 siblings, 0 replies; 6+ messages in thread
From: Tero.Kristo at nokia.com @ 2011-01-26  9:27 UTC (permalink / raw)
  To: linux-arm-kernel



>-----Original Message-----
>From: ext Kevin Hilman [mailto:khilman at ti.com]
>Sent: 26 January, 2011 02:50
>To: linux-omap at vger.kernel.org
>Cc: linux-arm-kernel at lists.infradead.org; Kristo Tero (Nokia-MS/Tampere)
>Subject: [PATCH] OMAP3: PM: fix save secure RAM to restore MPU power
>state
>
>Currently, on HS/EMU devices, MPU power state forced to on during PM
>init by the save secure RAM code.  Rather than forcing the state of
>MPU powerdomain to on, simply read the current value and restore it
>after the ROM code has run.
>
>This only affects the !CPUidle case since when CPUidle is enabled, the
>MPU power state is dynamically changed by CPUidle.  In the !CPUidle
>case, MPU power state is initialized once at init and never touched.
>
>Cc: Tero Kristo <tero.kristo@nokia.com>
>Signed-off-by: Kevin Hilman <khilman@ti.com>
>---
>If no objectsions, will be queued in my pm-fixes branch for 2.6.38-rc.

Looks good to me. Ack, if you need one.
 
>
> arch/arm/mach-omap2/pm34xx.c |    7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
>
>diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
>index 8cbbead..1916038 100644
>--- a/arch/arm/mach-omap2/pm34xx.c
>+++ b/arch/arm/mach-omap2/pm34xx.c
>@@ -168,9 +168,10 @@ static void omap3_core_restore_context(void)
>  * once during boot sequence, but this works as we are not using secure
>  * services.
>  */
>-static void omap3_save_secure_ram_context(u32 target_mpu_state)
>+static void omap3_save_secure_ram_context(void)
> {
> 	u32 ret;
>+	int mpu_next_state = pwrdm_read_next_pwrst(mpu_pwrdm);
>
> 	if (omap_type() != OMAP2_DEVICE_TYPE_GP) {
> 		/*
>@@ -181,7 +182,7 @@ static void omap3_save_secure_ram_context(u32
>target_mpu_state)
> 		pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON);
> 		ret = _omap_save_secure_sram((u32 *)
> 				__pa(omap3_secure_ram_storage));
>-		pwrdm_set_next_pwrst(mpu_pwrdm, target_mpu_state);
>+		pwrdm_set_next_pwrst(mpu_pwrdm, mpu_next_state);
> 		/* Following is for error tracking, it should not happen */
> 		if (ret) {
> 			printk(KERN_ERR "save_secure_sram() returns %08x\n",
>@@ -1094,7 +1095,7 @@ static int __init omap3_pm_init(void)
> 		local_fiq_disable();
>
> 		omap_dma_global_context_save();
>-		omap3_save_secure_ram_context(PWRDM_POWER_ON);
>+		omap3_save_secure_ram_context();
> 		omap_dma_global_context_restore();
>
> 		local_irq_enable();
>--
>1.7.3.5

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] OMAP3: PM: fix save secure RAM to restore MPU power state
  2011-01-26  9:27   ` Tero.Kristo at nokia.com
@ 2011-01-26 20:48     ` Kevin Hilman
  -1 siblings, 0 replies; 6+ messages in thread
From: Kevin Hilman @ 2011-01-26 20:48 UTC (permalink / raw)
  To: Tero.Kristo; +Cc: linux-omap, linux-arm-kernel

Hi Tero,

<Tero.Kristo@nokia.com> writes:

>>Currently, on HS/EMU devices, MPU power state forced to on during PM
>>init by the save secure RAM code.  Rather than forcing the state of
>>MPU powerdomain to on, simply read the current value and restore it
>>after the ROM code has run.
>>
>>This only affects the !CPUidle case since when CPUidle is enabled, the
>>MPU power state is dynamically changed by CPUidle.  In the !CPUidle
>>case, MPU power state is initialized once at init and never touched.
>>
>>Cc: Tero Kristo <tero.kristo@nokia.com>
>>Signed-off-by: Kevin Hilman <khilman@ti.com>
>>---
>>If no objectsions, will be queued in my pm-fixes branch for 2.6.38-rc.
>
> Looks good to me. Ack, if you need one.
>  

Thanks, I was looking for your ack.

Kevin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] OMAP3: PM: fix save secure RAM to restore MPU power state
@ 2011-01-26 20:48     ` Kevin Hilman
  0 siblings, 0 replies; 6+ messages in thread
From: Kevin Hilman @ 2011-01-26 20:48 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Tero,

<Tero.Kristo@nokia.com> writes:

>>Currently, on HS/EMU devices, MPU power state forced to on during PM
>>init by the save secure RAM code.  Rather than forcing the state of
>>MPU powerdomain to on, simply read the current value and restore it
>>after the ROM code has run.
>>
>>This only affects the !CPUidle case since when CPUidle is enabled, the
>>MPU power state is dynamically changed by CPUidle.  In the !CPUidle
>>case, MPU power state is initialized once at init and never touched.
>>
>>Cc: Tero Kristo <tero.kristo@nokia.com>
>>Signed-off-by: Kevin Hilman <khilman@ti.com>
>>---
>>If no objectsions, will be queued in my pm-fixes branch for 2.6.38-rc.
>
> Looks good to me. Ack, if you need one.
>  

Thanks, I was looking for your ack.

Kevin

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-01-26 20:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-26  0:50 [PATCH] OMAP3: PM: fix save secure RAM to restore MPU power state Kevin Hilman
2011-01-26  0:50 ` Kevin Hilman
2011-01-26  9:27 ` Tero.Kristo
2011-01-26  9:27   ` Tero.Kristo at nokia.com
2011-01-26 20:48   ` Kevin Hilman
2011-01-26 20:48     ` Kevin Hilman

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.