linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] ARM: OMAP3/4: cpuidle - misc fixes
@ 2012-05-04 17:18 Daniel Lezcano
  2012-05-04 17:18 ` [PATCH 1/2] ARM: OMAP3: cpuidle - check the powerdomain lookup Daniel Lezcano
  2012-05-04 17:18 ` [PATCH 2/2] ARM: OMAP3/4: consolidate cpuidle Makefile Daniel Lezcano
  0 siblings, 2 replies; 8+ messages in thread
From: Daniel Lezcano @ 2012-05-04 17:18 UTC (permalink / raw)
  To: linux-arm-kernel

These two patches are coming from the series I previously
sent for the cpuidle OMAP3/4 cleanups.

The first one, move the powerdomain lookup check in the init
function, the second one fix the linkage error, when the
CONFIG_PM is not set while CONFIG_CPU_IDLE is. Omap's Kconfig
has been modified to select CONFIG_PM when CONFIG_CPU_IDLE is
set.

I compiled with different options but I was not able to boot
my board because the kernel panics for another reason.

Daniel Lezcano (2):
  ARM: OMAP3: cpuidle - check the powerdomain lookup
  ARM: OMAP3/4: consolidate cpuidle Makefile

 arch/arm/mach-omap2/Kconfig       |    2 ++
 arch/arm/mach-omap2/Makefile      |   11 +++++++----
 arch/arm/mach-omap2/cpuidle34xx.c |   11 +++--------
 arch/arm/mach-omap2/cpuidle44xx.c |    8 --------
 arch/arm/mach-omap2/pm.h          |   17 +++++++++++++++--
 5 files changed, 27 insertions(+), 22 deletions(-)

-- 
1.7.5.4

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

* [PATCH 1/2] ARM: OMAP3: cpuidle - check the powerdomain lookup
  2012-05-04 17:18 [PATCH 0/2] ARM: OMAP3/4: cpuidle - misc fixes Daniel Lezcano
@ 2012-05-04 17:18 ` Daniel Lezcano
  2012-05-04 21:23   ` Kevin Hilman
  2012-05-04 17:18 ` [PATCH 2/2] ARM: OMAP3/4: consolidate cpuidle Makefile Daniel Lezcano
  1 sibling, 1 reply; 8+ messages in thread
From: Daniel Lezcano @ 2012-05-04 17:18 UTC (permalink / raw)
  To: linux-arm-kernel

At init time, check the powerdomains lookup is successful otherwise
exit the cpuidle driver init function with -ENODEV like what is done for the
omap3 cpuidle driver.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Jean Pihet <j-pihet@ti.com>
---
 arch/arm/mach-omap2/cpuidle34xx.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
index f682e17..207bc1c 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -363,6 +363,9 @@ int __init omap3_idle_init(void)
 	per_pd = pwrdm_lookup("per_pwrdm");
 	cam_pd = pwrdm_lookup("cam_pwrdm");
 
+	if (!mpu_pd || !core_pd || !per_pd || !cam_pd)
+		return -ENODEV;
+
 	cpuidle_register_driver(&omap3_idle_driver);
 
 	dev = &per_cpu(omap3_idle_dev, smp_processor_id());
-- 
1.7.5.4

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

* [PATCH 2/2] ARM: OMAP3/4: consolidate cpuidle Makefile
  2012-05-04 17:18 [PATCH 0/2] ARM: OMAP3/4: cpuidle - misc fixes Daniel Lezcano
  2012-05-04 17:18 ` [PATCH 1/2] ARM: OMAP3: cpuidle - check the powerdomain lookup Daniel Lezcano
@ 2012-05-04 17:18 ` Daniel Lezcano
  2012-05-08 20:25   ` Daniel Lezcano
  2012-05-08 20:44   ` Kevin Hilman
  1 sibling, 2 replies; 8+ messages in thread
From: Daniel Lezcano @ 2012-05-04 17:18 UTC (permalink / raw)
  To: linux-arm-kernel

Define a CPU_IDLE section in the makefile, declare the functions in
the header files conforming to the kernel coding rules and remove the
'define's in the C files.

CONFIG_PM is enabled when CPU_IDLE is enabled because the cpuidle drivers
use some functions from the pm subsystem.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Jean Pihet <j-pihet@ti.com>
---
 arch/arm/mach-omap2/Kconfig       |    2 ++
 arch/arm/mach-omap2/Makefile      |   11 +++++++----
 arch/arm/mach-omap2/cpuidle34xx.c |    8 --------
 arch/arm/mach-omap2/cpuidle44xx.c |    8 --------
 arch/arm/mach-omap2/pm.h          |   17 +++++++++++++++--
 5 files changed, 24 insertions(+), 22 deletions(-)

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 8141b76..42f6b89 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -34,6 +34,7 @@ config ARCH_OMAP3
 	select CPU_V7
 	select USB_ARCH_HAS_EHCI if USB_SUPPORT
 	select ARCH_HAS_OPP
+	select PM if CPU_IDLE
 	select PM_OPP if PM
 	select ARM_CPU_SUSPEND if PM
 	select MULTI_IRQ_HANDLER
@@ -51,6 +52,7 @@ config ARCH_OMAP4
 	select PL310_ERRATA_727915
 	select ARM_ERRATA_720789
 	select ARCH_HAS_OPP
+	select PM if CPU_IDLE
 	select PM_OPP if PM
 	select USB_ARCH_HAS_EHCI if USB_SUPPORT
 	select ARM_CPU_SUSPEND if PM
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 49f92bc..f46c735 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -64,10 +64,8 @@ endif
 ifeq ($(CONFIG_PM),y)
 obj-$(CONFIG_ARCH_OMAP2)		+= pm24xx.o
 obj-$(CONFIG_ARCH_OMAP2)		+= sleep24xx.o
-obj-$(CONFIG_ARCH_OMAP3)		+= pm34xx.o sleep34xx.o \
-					   cpuidle34xx.o
-obj-$(CONFIG_ARCH_OMAP4)		+= pm44xx.o omap-mpuss-lowpower.o \
-					   cpuidle44xx.o
+obj-$(CONFIG_ARCH_OMAP3)		+= pm34xx.o sleep34xx.o
+obj-$(CONFIG_ARCH_OMAP4)		+= pm44xx.o omap-mpuss-lowpower.o
 obj-$(CONFIG_PM_DEBUG)			+= pm-debug.o
 obj-$(CONFIG_OMAP_SMARTREFLEX)          += sr_device.o smartreflex.o
 obj-$(CONFIG_OMAP_SMARTREFLEX_CLASS3)	+= smartreflex-class3.o
@@ -81,6 +79,11 @@ endif
 
 endif
 
+ifeq ($(CONFIG_CPU_IDLE),y)
+obj-$(CONFIG_ARCH_OMAP3)                += cpuidle34xx.o
+obj-$(CONFIG_ARCH_OMAP4)                += cpuidle44xx.o
+endif
+
 # PRCM
 obj-y					+= prm_common.o
 obj-$(CONFIG_ARCH_OMAP2)		+= prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o
diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
index 207bc1c..3134452 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -36,8 +36,6 @@
 #include "control.h"
 #include "common.h"
 
-#ifdef CONFIG_CPU_IDLE
-
 /* Mach specific information to be recorded in the C-state driver_data */
 struct omap3_idle_statedata {
 	u32 mpu_state;
@@ -379,9 +377,3 @@ int __init omap3_idle_init(void)
 
 	return 0;
 }
-#else
-int __init omap3_idle_init(void)
-{
-	return 0;
-}
-#endif /* CONFIG_CPU_IDLE */
diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c
index be1617c..02d15bb 100644
--- a/arch/arm/mach-omap2/cpuidle44xx.c
+++ b/arch/arm/mach-omap2/cpuidle44xx.c
@@ -22,8 +22,6 @@
 #include "pm.h"
 #include "prm.h"
 
-#ifdef CONFIG_CPU_IDLE
-
 /* Machine specific information */
 struct omap4_idle_statedata {
 	u32 cpu_state;
@@ -199,9 +197,3 @@ int __init omap4_idle_init(void)
 
 	return 0;
 }
-#else
-int __init omap4_idle_init(void)
-{
-	return 0;
-}
-#endif /* CONFIG_CPU_IDLE */
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index 7856489..ab04d3b 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -15,12 +15,25 @@
 
 #include "powerdomain.h"
 
+#ifdef CONFIG_CPU_IDLE
+extern int __init omap3_idle_init(void);
+extern int __init omap4_idle_init(void);
+#else
+static inline int omap3_idle_init(void)
+{
+	return 0;
+}
+
+static inline int omap4_idle_init(void)
+{
+	return 0;
+}
+#endif
+
 extern void *omap3_secure_ram_storage;
 extern void omap3_pm_off_mode_enable(int);
 extern void omap_sram_idle(void);
 extern int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state);
-extern int omap3_idle_init(void);
-extern int omap4_idle_init(void);
 extern int omap_pm_clkdms_setup(struct clockdomain *clkdm, void *unused);
 extern int (*omap_pm_suspend)(void);
 
-- 
1.7.5.4

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

* [PATCH 1/2] ARM: OMAP3: cpuidle - check the powerdomain lookup
  2012-05-04 17:18 ` [PATCH 1/2] ARM: OMAP3: cpuidle - check the powerdomain lookup Daniel Lezcano
@ 2012-05-04 21:23   ` Kevin Hilman
  0 siblings, 0 replies; 8+ messages in thread
From: Kevin Hilman @ 2012-05-04 21:23 UTC (permalink / raw)
  To: linux-arm-kernel

Daniel Lezcano <daniel.lezcano@linaro.org> writes:

> At init time, check the powerdomains lookup is successful otherwise
> exit the cpuidle driver init function with -ENODEV like what is done for the
> omap3 cpuidle driver.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> Reviewed-by: Jean Pihet <j-pihet@ti.com>

Thanks, applying to my for_3.5/cleanup/omap-cpuidle branch.

Kevin

> ---
>  arch/arm/mach-omap2/cpuidle34xx.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
> index f682e17..207bc1c 100644
> --- a/arch/arm/mach-omap2/cpuidle34xx.c
> +++ b/arch/arm/mach-omap2/cpuidle34xx.c
> @@ -363,6 +363,9 @@ int __init omap3_idle_init(void)
>  	per_pd = pwrdm_lookup("per_pwrdm");
>  	cam_pd = pwrdm_lookup("cam_pwrdm");
>  
> +	if (!mpu_pd || !core_pd || !per_pd || !cam_pd)
> +		return -ENODEV;
> +
>  	cpuidle_register_driver(&omap3_idle_driver);
>  
>  	dev = &per_cpu(omap3_idle_dev, smp_processor_id());

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

* [PATCH 2/2] ARM: OMAP3/4: consolidate cpuidle Makefile
  2012-05-04 17:18 ` [PATCH 2/2] ARM: OMAP3/4: consolidate cpuidle Makefile Daniel Lezcano
@ 2012-05-08 20:25   ` Daniel Lezcano
  2012-05-08 20:45     ` Kevin Hilman
  2012-05-08 20:44   ` Kevin Hilman
  1 sibling, 1 reply; 8+ messages in thread
From: Daniel Lezcano @ 2012-05-08 20:25 UTC (permalink / raw)
  To: linux-arm-kernel

On 05/04/2012 07:18 PM, Daniel Lezcano wrote:
> Define a CPU_IDLE section in the makefile, declare the functions in
> the header files conforming to the kernel coding rules and remove the
> 'define's in the C files.
>
> CONFIG_PM is enabled when CPU_IDLE is enabled because the cpuidle drivers
> use some functions from the pm subsystem.
>
> Signed-off-by: Daniel Lezcano<daniel.lezcano@linaro.org>
> Reviewed-by: Jean Pihet<j-pihet@ti.com>
> ---

Hi Kevin,

you did not apply this patch. Is it something wrong with it ?

Thanks
-- Daniel



-- 
  <http://www.linaro.org/>  Linaro.org ? Open source software for ARM SoCs

Follow Linaro:<http://www.facebook.com/pages/Linaro>  Facebook |
<http://twitter.com/#!/linaroorg>  Twitter |
<http://www.linaro.org/linaro-blog/>  Blog

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

* [PATCH 2/2] ARM: OMAP3/4: consolidate cpuidle Makefile
  2012-05-04 17:18 ` [PATCH 2/2] ARM: OMAP3/4: consolidate cpuidle Makefile Daniel Lezcano
  2012-05-08 20:25   ` Daniel Lezcano
@ 2012-05-08 20:44   ` Kevin Hilman
  2012-05-08 21:02     ` Daniel Lezcano
  1 sibling, 1 reply; 8+ messages in thread
From: Kevin Hilman @ 2012-05-08 20:44 UTC (permalink / raw)
  To: linux-arm-kernel

Daniel Lezcano <daniel.lezcano@linaro.org> writes:

> Define a CPU_IDLE section in the makefile, declare the functions in
> the header files conforming to the kernel coding rules and remove the
> 'define's in the C files.
>
> CONFIG_PM is enabled when CPU_IDLE is enabled because the cpuidle drivers
> use some functions from the pm subsystem.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> Reviewed-by: Jean Pihet <j-pihet@ti.com>

The changelog doesn't really answer "why" this change is needed.  IOW, I
don't understand from the changelog exactly what problem this patch is
trying to solve.

AFAICT, it's just shuffling around the dependencies, and changes the
omap*_idle_init() calls into inline nops instead of function call nops.

Kevin

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

* [PATCH 2/2] ARM: OMAP3/4: consolidate cpuidle Makefile
  2012-05-08 20:25   ` Daniel Lezcano
@ 2012-05-08 20:45     ` Kevin Hilman
  0 siblings, 0 replies; 8+ messages in thread
From: Kevin Hilman @ 2012-05-08 20:45 UTC (permalink / raw)
  To: linux-arm-kernel

Daniel Lezcano <daniel.lezcano@linaro.org> writes:

> On 05/04/2012 07:18 PM, Daniel Lezcano wrote:
>> Define a CPU_IDLE section in the makefile, declare the functions in
>> the header files conforming to the kernel coding rules and remove the
>> 'define's in the C files.
>>
>> CONFIG_PM is enabled when CPU_IDLE is enabled because the cpuidle drivers
>> use some functions from the pm subsystem.
>>
>> Signed-off-by: Daniel Lezcano<daniel.lezcano@linaro.org>
>> Reviewed-by: Jean Pihet<j-pihet@ti.com>
>> ---
>
> Hi Kevin,
>
> you did not apply this patch. Is it something wrong with it ?
>

oops, the reply was still in my drafts folder... just sent.

Kevin

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

* [PATCH 2/2] ARM: OMAP3/4: consolidate cpuidle Makefile
  2012-05-08 20:44   ` Kevin Hilman
@ 2012-05-08 21:02     ` Daniel Lezcano
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Lezcano @ 2012-05-08 21:02 UTC (permalink / raw)
  To: linux-arm-kernel

On 05/08/2012 10:44 PM, Kevin Hilman wrote:
> Daniel Lezcano<daniel.lezcano@linaro.org>  writes:
>
>> Define a CPU_IDLE section in the makefile, declare the functions in
>> the header files conforming to the kernel coding rules and remove the
>> 'define's in the C files.
>>
>> CONFIG_PM is enabled when CPU_IDLE is enabled because the cpuidle drivers
>> use some functions from the pm subsystem.
>>
>> Signed-off-by: Daniel Lezcano<daniel.lezcano@linaro.org>
>> Reviewed-by: Jean Pihet<j-pihet@ti.com>
>
> The changelog doesn't really answer "why" this change is needed.  IOW, I
> don't understand from the changelog exactly what problem this patch is
> trying to solve.
>
> AFAICT, it's just shuffling around the dependencies, and changes the
> omap*_idle_init() calls into inline nops instead of function call nops.

Ok, I will modify the changelog. I'm always bad with the changelogs, 
this is something I have to improve :) I'm the first one to be happy 
when I find a nice description in the patches log.

Thanks.

   -- Daniel

-- 
  <http://www.linaro.org/> Linaro.org ? Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

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

end of thread, other threads:[~2012-05-08 21:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-04 17:18 [PATCH 0/2] ARM: OMAP3/4: cpuidle - misc fixes Daniel Lezcano
2012-05-04 17:18 ` [PATCH 1/2] ARM: OMAP3: cpuidle - check the powerdomain lookup Daniel Lezcano
2012-05-04 21:23   ` Kevin Hilman
2012-05-04 17:18 ` [PATCH 2/2] ARM: OMAP3/4: consolidate cpuidle Makefile Daniel Lezcano
2012-05-08 20:25   ` Daniel Lezcano
2012-05-08 20:45     ` Kevin Hilman
2012-05-08 20:44   ` Kevin Hilman
2012-05-08 21:02     ` Daniel Lezcano

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).