Skip to contentSkip to conversation

ARM: OMAP2+: PM: Fix the dt return condition in pm_late_init()

PATCH New Santosh Shilimkar 5 participants 15 messages Feb 8, 2013 – Mar 4, 2013

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: OMAP2+: PM: Fix the dt return condition in pm_late_init()

Commit 1416408d {ARM: OMAP2+: PM: share some suspend-related functions across OMAP2, 3, 4} moved suspend code to common place but now with that change, for DT build on OMAP4, suspend hooks are not getting registered which results in no suspend support.

The DT return condition is limited to PMIC and smartreflex initialization and hence restrict it so that suspend ops gets registered.

Cc Paul Walmsley <[email protected]>
Cc Kevin Hilman <[email protected]>
---
 arch/arm/mach-omap2/pm.c |   20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
arch/arm/mach-omap2/pm.c +10 -10
index f4b3143..1ec4299 100644
@@ -345,19 +345,19 @@ int __init omap2_common_pm_late_init(void)
 	 * a completely different mechanism.
 	 * Disable this part if a DT blob is available.
 	 */
-	if (of_have_populated_dt())
-		return 0;
+	if (!of_have_populated_dt()) {
 
-	/* Init the voltage layer */
-	omap_pmic_late_init();
-	omap_voltage_late_init();
+		/* Init the voltage layer */
+		omap_pmic_late_init();
+		omap_voltage_late_init();
 
-	/* Initialize the voltages */
-	omap3_init_voltages();
-	omap4_init_voltages();
+		/* Initialize the voltages */
+		omap3_init_voltages();
+		omap4_init_voltages();
 
-	/* Smartreflex device init */
-	omap_devinit_smartreflex();
+		/* Smartreflex device init */
+		omap_devinit_smartreflex();
+	}
 
 #ifdef CONFIG_SUSPEND
 	suspend_set_ops(&omap_pm_ops);
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 ARM: OMAP2+: Remove duplicate omap4430_init_late() declaration

Commit bbd707ac {ARM: omap2: use machine specific hook for late init} accidentally added two declarations for omap4430_init_late().

Remove the duplicate declaration.

Cc Shawn Guo <[email protected]>
Cc Tony Lindgren <[email protected]>
---
 arch/arm/mach-omap2/common.h |    1 -
 1 file changed, 1 deletion(-)
arch/arm/mach-omap2/common.h +0 -1
index 948bcaa..e0f9ea7 100644
@@ -108,7 +108,6 @@ void omap35xx_init_late(void);
 void omap3630_init_late(void);
 void am35xx_init_late(void);
 void ti81xx_init_late(void);
-void omap4430_init_late(void);
 int omap2_common_pm_late_init(void);
 
 #if defined(CONFIG_SOC_OMAP2420) || defined(CONFIG_SOC_OMAP2430)
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 1/1 ARM: OMAP2+: Remove duplicate omap4430_init_late() declaration

Quoted 9 lines · Santosh Shilimkar

Commit bbd707ac {ARM: omap2: use machine specific hook for late init} accidentally added two declarations for omap4430_init_late().

Remove the duplicate declaration.

Cc Shawn Guo <[email protected]>
Cc Tony Lindgren <[email protected]>

nice catch

Quoted 23 lines
---
 arch/arm/mach-omap2/common.h |    1 -
 1 file changed, 1 deletion(-)
arch/arm/mach-omap2/common.h +0 -1
index 948bcaa..e0f9ea7 100644
@@ -108,7 +108,6 @@ void omap35xx_init_late(void);
 void omap3630_init_late(void);
 void am35xx_init_late(void);
 void ti81xx_init_late(void);
-void omap4430_init_late(void);
 int omap2_common_pm_late_init(void);
 
 #if defined(CONFIG_SOC_OMAP2420) || defined(CONFIG_SOC_OMAP2430)
Signature · 6 lines
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130208/faaeef3e/attachment-0001.sig>
#3 lore raw

PATCH 1/1 ARM: OMAP2+: Remove duplicate omap4430_init_late() declaration

In reply to Santosh Shilimkar

Tony,

Quoted 19 lines · Santosh Shilimkar

Commit bbd707ac {ARM: omap2: use machine specific hook for late init} accidentally added two declarations for omap4430_init_late().

Remove the duplicate declaration.

Cc Shawn Guo <[email protected]>
Cc Tony Lindgren <[email protected]>
---
  arch/arm/mach-omap2/common.h |    1 -
  1 file changed, 1 deletion(-)
arch/arm/mach-omap2/common.h +0 -0
index 948bcaa..e0f9ea7 100644

arch/arm/mach-omap2/common.h void omap35xx_init_late(void); · line 113

Quoted 7 lines
arch/arm/mach-omap2/common.h +0 -1
@@ -108,7 +108,6 @@ void omap35xx_init_late(void);
  void omap3630_init_late(void);
  void am35xx_init_late(void);
  void ti81xx_init_late(void);
-void omap4430_init_late(void);
  int omap2_common_pm_late_init(void);
 
  #if defined(CONFIG_SOC_OMAP2420) || defined(CONFIG_SOC_OMAP2430)

Can you pick this up ?

Regards,
Santosh

maintainer
#4 lore raw

PATCH 1/1 ARM: OMAP2+: Remove duplicate omap4430_init_late() declaration

Quoted 27 lines · Santosh Shilimkar

Tony,

Quoted 24 lines · Santosh Shilimkar

Commit bbd707ac {ARM: omap2: use machine specific hook for late init} accidentally added two declarations for omap4430_init_late().

Remove the duplicate declaration.

Cc Shawn Guo <[email protected]>
Cc Tony Lindgren <[email protected]>
---
 arch/arm/mach-omap2/common.h |    1 -
 1 file changed, 1 deletion(-)
arch/arm/mach-omap2/common.h +0 -1
index 948bcaa..e0f9ea7 100644
@@ -108,7 +108,6 @@ void omap35xx_init_late(void);
 void omap3630_init_late(void);
 void am35xx_init_late(void);
 void ti81xx_init_late(void);
-void omap4430_init_late(void);
 int omap2_common_pm_late_init(void);
 
Quoted 3 lines

arch/arm/mach-omap2/common.h void omap35xx_init_late(void); · line 113

Quoted 2 lines
arch/arm/mach-omap2/common.h +0 -0
 #if defined(CONFIG_SOC_OMAP2420) || defined(CONFIG_SOC_OMAP2430)

Can you pick this up ?

Thanks applying into omap-for-v3.9-rc1/fixes.

Regards,

Tony

#5 lore raw

PATCH 1/1 ARM: OMAP4: PM: Avoid expensive cpu_suspend() path for all CPU power states except off

In reply to Santosh Shilimkar

Current CPU PM code code make use of common cpu_suspend() path for all the CPU power states which is not optimal. In fact cpu_suspend() path is needed only when we put CPU power domain to off state where the CPU context is lost.

Update the code accordingly so that the expensive cpu_suspend() path can be avoided for the shallow CPU power states like CPU PD INA/CSWR.

Cc Kevin Hilman <[email protected]>
---
 arch/arm/mach-omap2/omap-mpuss-lowpower.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
arch/arm/mach-omap2/omap-mpuss-lowpower.c +4 -1
index aac46bf..abdd0f6 100644
@@ -276,7 +276,10 @@ int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state)
 	/*
 	 * Call low level function  with targeted low power state.
 	 */
-	cpu_suspend(save_state, omap4_finish_suspend);
+	if (save_state)
+		cpu_suspend(save_state, omap4_finish_suspend);
+	else
+		omap4_finish_suspend(save_state);
 
 	/*
 	 * Restore the CPUx power state to ON otherwise CPUx
Signature · 1 line
1.7.9.5
#6 lore raw

PATCH 1/1 ARM: OMAP4: PM: Avoid expensive cpu_suspend() path for all CPU power states except off

Quoted 11 lines · Santosh Shilimkar

Current CPU PM code code make use of common cpu_suspend() path for all the CPU power states which is not optimal. In fact cpu_suspend() path is needed only when we put CPU power domain to off state where the CPU context is lost.

Update the code accordingly so that the expensive cpu_suspend() path can be avoided for the shallow CPU power states like CPU PD INA/CSWR.

Cc Kevin Hilman <[email protected]>

some numbers showing the benefit would be cool...

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130208/e0a56f93/attachment.sig>
#7 lore raw

PATCH 1/1 ARM: OMAP4: PM: Avoid expensive cpu_suspend() path for all CPU power states except off

Quoted 8 lines · Felipe Balbi
Quoted 7 lines · Santosh Shilimkar

Current CPU PM code code make use of common cpu_suspend() path for all the CPU power states which is not optimal. In fact cpu_suspend() path is needed only when we put CPU power domain to off state where the CPU context is lost.

Update the code accordingly so that the expensive cpu_suspend() path can be avoided for the shallow CPU power states like CPU PD INA/CSWR.

Quoted 7 lines
Quoted 4 lines
Cc Kevin Hilman <[email protected]>

some numbers showing the benefit would be cool...

The numbers depends on CPU clock you are running generally. The main issue is, for the shallow power states where we were not loosing CPU context or Caches, we were doing all the book keeping. States like INA are of 6-8 uS and above overhead is quite significant their.

Regards
Santosh

#8 lore raw

PATCH 1/1 ARM: OMAP4: PM: Avoid expensive cpu_suspend() path for all CPU power states except off

In reply to Santosh Shilimkar
Quoted 11 lines · Santosh Shilimkar

Current CPU PM code code make use of common cpu_suspend() path for all the CPU power states which is not optimal. In fact cpu_suspend() path is needed only when we put CPU power domain to off state where the CPU context is lost.

Update the code accordingly so that the expensive cpu_suspend() path can be avoided for the shallow CPU power states like CPU PD INA/CSWR.

Cc Kevin Hilman <[email protected]>

Looks OK at first glance, but are you sure this is right for the various ways both clusters might idle using coupled CPUidle?

Some description of the testing would be helpful here.

Thanks,

Kevin

Quoted 20 lines
---
 arch/arm/mach-omap2/omap-mpuss-lowpower.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
arch/arm/mach-omap2/omap-mpuss-lowpower.c +4 -1
index aac46bf..abdd0f6 100644
@@ -276,7 +276,10 @@ int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state)
 	/*
 	 * Call low level function  with targeted low power state.
 	 */
-	cpu_suspend(save_state, omap4_finish_suspend);
+	if (save_state)
+		cpu_suspend(save_state, omap4_finish_suspend);
+	else
+		omap4_finish_suspend(save_state);
 
 	/*
 	 * Restore the CPUx power state to ON otherwise CPUx
#9 lore raw

PATCH 1/1 ARM: OMAP4: PM: Avoid expensive cpu_suspend() path for all CPU power states except off

Quoted 9 lines · Kevin Hilman
Quoted 7 lines · Santosh Shilimkar

Current CPU PM code code make use of common cpu_suspend() path for all the CPU power states which is not optimal. In fact cpu_suspend() path is needed only when we put CPU power domain to off state where the CPU context is lost.

Update the code accordingly so that the expensive cpu_suspend() path can be avoided for the shallow CPU power states like CPU PD INA/CSWR.

Quoted 8 lines
Quoted 4 lines
Cc Kevin Hilman <[email protected]>

Looks OK at first glance, but are you sure this is right for the various ways both clusters might idle using coupled CPUidle?

Yes it is perfectly safe from all C-states. This patch has been part of the OMAP4/OMAP5 product port for some time. I forgot to send it upstream some how :(

Quoted 2 lines

Some description of the testing would be helpful here.

Sorry. Should have mentioned it in first place.
Patch is being tested on OMAP4430 (idle/suspend) and OMAP5 with few out of tree patches.

Regards,
Santosh

#10 lore raw

PATCH 1/1 ARM: OMAP4: PM: Avoid expensive cpu_suspend() path for all CPU power states except off

Quoted 22 lines · Santosh Shilimkar
Quoted 9 lines · Kevin Hilman
Quoted 7 lines · Santosh Shilimkar

Current CPU PM code code make use of common cpu_suspend() path for all the CPU power states which is not optimal. In fact cpu_suspend() path is needed only when we put CPU power domain to off state where the CPU context is lost.

Update the code accordingly so that the expensive cpu_suspend() path can be avoided for the shallow CPU power states like CPU PD INA/CSWR.

Quoted 8 lines
Quoted 4 lines
Cc Kevin Hilman <[email protected]>

Looks OK at first glance, but are you sure this is right for the various ways both clusters might idle using coupled CPUidle?

Yes it is perfectly safe from all C-states. This patch has been part of the OMAP4/OMAP5 product port for some time. I forgot to send it upstream some how :(

Quoted 5 lines
Quoted 2 lines

Some description of the testing would be helpful here.

Sorry. Should have mentioned it in first place.
Patch is being tested on OMAP4430 (idle/suspend) and OMAP5 with few out of tree patches.

OK, please update changelog with a brief description of how it was tested, and on which platforms.

Thanks,

Kevin

#11 lore raw

PATCH 1/1 ARM: OMAP4: PM: Avoid expensive cpu_suspend() path for all CPU power states except off

Quoted 24 lines · Kevin Hilman
Quoted 22 lines · Santosh Shilimkar
Quoted 9 lines · Kevin Hilman
Quoted 7 lines · Santosh Shilimkar

Current CPU PM code code make use of common cpu_suspend() path for all the CPU power states which is not optimal. In fact cpu_suspend() path is needed only when we put CPU power domain to off state where the CPU context is lost.

Update the code accordingly so that the expensive cpu_suspend() path can be avoided for the shallow CPU power states like CPU PD INA/CSWR.

Quoted 8 lines
Quoted 4 lines
Cc Kevin Hilman <[email protected]>

Looks OK at first glance, but are you sure this is right for the various ways both clusters might idle using coupled CPUidle?

Yes it is perfectly safe from all C-states. This patch has been part of the OMAP4/OMAP5 product port for some time. I forgot to send it upstream some how :(

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

Some description of the testing would be helpful here.

Sorry. Should have mentioned it in first place.
Patch is being tested on OMAP4430 (idle/suspend) and OMAP5 with few out of tree patches.

OK, please update changelog with a brief description of how it was tested, and on which platforms.

Will update the changelog and post it

Regards,
Santosh

#12 lore raw

PATCH 1/1 ARM: OMAP2+: PM: Fix the dt return condition in pm_late_init()

In reply to Santosh Shilimkar
Quoted 5 lines · Santosh Shilimkar

Commit 1416408d {ARM: OMAP2+: PM: share some suspend-related functions across OMAP2, 3, 4} moved suspend code to common place but now with that change, for DT build on OMAP4, suspend hooks are not getting registered which results in no suspend support.

Quoted 8 lines

The DT return condition is limited to PMIC and smartreflex initialization and hence restrict it so that suspend ops gets registered.

Cc Paul Walmsley <[email protected]>
Cc Kevin Hilman <[email protected]>

makes sense to me, we still need to set the global suspend_ops pointer to something valid in DT boots:

Quoted 45 lines
---
 arch/arm/mach-omap2/pm.c |   20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
arch/arm/mach-omap2/pm.c +10 -10
index f4b3143..1ec4299 100644
@@ -345,19 +345,19 @@ int __init omap2_common_pm_late_init(void)
 	 * a completely different mechanism.
 	 * Disable this part if a DT blob is available.
 	 */
-	if (of_have_populated_dt())
-		return 0;
+	if (!of_have_populated_dt()) {
 
-	/* Init the voltage layer */
-	omap_pmic_late_init();
-	omap_voltage_late_init();
+		/* Init the voltage layer */
+		omap_pmic_late_init();
+		omap_voltage_late_init();
 
-	/* Initialize the voltages */
-	omap3_init_voltages();
-	omap4_init_voltages();
+		/* Initialize the voltages */
+		omap3_init_voltages();
+		omap4_init_voltages();
 
-	/* Smartreflex device init */
-	omap_devinit_smartreflex();
+		/* Smartreflex device init */
+		omap_devinit_smartreflex();
+	}
 
 #ifdef CONFIG_SUSPEND
 	suspend_set_ops(&omap_pm_ops);
Signature · 6 lines
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130208/f9d23752/attachment.sig>
#13 lore raw

PATCH 1/1 ARM: OMAP2+: PM: Fix the dt return condition in pm_late_init()

In reply to Santosh Shilimkar
Quoted 5 lines · Santosh Shilimkar

Commit 1416408d {ARM: OMAP2+: PM: share some suspend-related functions across OMAP2, 3, 4} moved suspend code to common place but now with that change, for DT build on OMAP4, suspend hooks are not getting registered which results in no suspend support.

Quoted 8 lines

The DT return condition is limited to PMIC and smartreflex initialization and hence restrict it so that suspend ops gets registered.

Cc Paul Walmsley <[email protected]>
Cc Kevin Hilman <[email protected]>

Thanks, queued here with Felipe's Reviewed-by: along with the other OMAP4 PM fixes.

- Paul

#14 lore raw

PATCH 1/1 ARM: OMAP2+: PM: Fix the dt return condition in pm_late_init()

Quoted 11 lines · Paul Walmsley
Quoted 9 lines · Santosh Shilimkar

Commit 1416408d {ARM: OMAP2+: PM: share some suspend-related functions across OMAP2, 3, 4} moved suspend code to common place but now with that change, for DT build on OMAP4, suspend hooks are not getting registered which results in no suspend support.

The DT return condition is limited to PMIC and smartreflex initialization and hence restrict it so that suspend ops gets registered.

Quoted 8 lines
Quoted 4 lines
Cc Paul Walmsley <[email protected]>
Cc Kevin Hilman <[email protected]>

Thanks, queued here with Felipe's Reviewed-by: along with the other OMAP4 PM fixes.

Thanks Paul !!

Regards,
Santosh