Skip to contentSkip to conversation

ARM: automatically select OMAP3_PMU if we try to use perf on OMAP3

PATCH New Bryan Wu 3 participants 5 messages Jun 28, 2011 – Jun 30, 2011 Arm (32-bit)

lore
Share & tools
lore

Bryan Wu

author
#0 lore raw

PATCH 1/1 ARM: automatically select OMAP3_PMU if we try to use perf on OMAP3

For our Ubuntu kernel on OMAP4 machine, we need to enable OMAP3 as well as OMAP4. OMAP3_EMU has to be enabled manully to make CPU_HAS_PMU=y, which is required by perf.

So this patch will select the OMAP3_EMU if ARCH_OMAP3 is enabled.

---
 arch/arm/Kconfig |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/Kconfig +2 -2
index 2fd0911..53d0eba 100644
@@ -1084,10 +1084,10 @@ config XSCALE_PMU
 	default y
 
 config CPU_HAS_PMU
-	depends on (CPU_V6 || CPU_V6K || CPU_V7 || XSCALE_PMU) && \
-		   (!ARCH_OMAP3 || OMAP3_EMU)
+	depends on CPU_V6 || CPU_V6K || CPU_V7 || XSCALE_PMU
 	default y
 	bool
+	select OMAP3_EMU if ARCH_OMAP3
 
 config MULTI_IRQ_HANDLER
 	bool
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 1/1 ARM: automatically select OMAP3_PMU if we try to use perf on OMAP3

Hi Bryan,

Quoted 19 lines · Bryan Wu

For our Ubuntu kernel on OMAP4 machine, we need to enable OMAP3 as well as OMAP4. OMAP3_EMU has to be enabled manully to make CPU_HAS_PMU=y, which is required by perf.

So this patch will select the OMAP3_EMU if ARCH_OMAP3 is enabled.

---
 arch/arm/Kconfig |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/Kconfig +0 -0
index 2fd0911..53d0eba 100644
@@ -1084,10 +1084,10 @@ config XSCALE_PMU
 	default y
 

arch/arm/Kconfig config XSCALE_PMU · line 1093

Quoted 10 lines
arch/arm/Kconfig +2 -2
 config CPU_HAS_PMU
-	depends on (CPU_V6 || CPU_V6K || CPU_V7 || XSCALE_PMU) && \
-		   (!ARCH_OMAP3 || OMAP3_EMU)
+	depends on CPU_V6 || CPU_V6K || CPU_V7 || XSCALE_PMU
 	default y
 	bool
+	select OMAP3_EMU if ARCH_OMAP3
 
 config MULTI_IRQ_HANDLER
 	bool

This issue has been discussed on the list in the past and I still think that it would be better for your config to select OMAP3_EMU explicitly. If we do that here unconditionally then we end up also bringing in OC_ETM which isn't something that sounds like a good idea (may have implications for power consumption in production hardware?).

Will

author
#2 lore raw

PATCH 1/1 ARM: automatically select OMAP3_PMU if we try to use perf on OMAP3

Quoted 31 lines · Will Deacon

Hi Bryan,

Quoted 27 lines · Bryan Wu

For our Ubuntu kernel on OMAP4 machine, we need to enable OMAP3 as well as OMAP4. OMAP3_EMU has to be enabled manully to make CPU_HAS_PMU=y, which is required by perf.

So this patch will select the OMAP3_EMU if ARCH_OMAP3 is enabled.

---
?arch/arm/Kconfig | ? ?4 ++--
?1 files changed, 2 insertions(+), 2 deletions(-)

arch/arm/Kconfig +0 -0
index 2fd0911..53d0eba 100644
@@ -1084,10 +1084,10 @@ config XSCALE_PMU

? ? ? default y

?config CPU_HAS_PMU
- ? ? depends on (CPU_V6 || CPU_V6K || CPU_V7 || XSCALE_PMU) && \
- ? ? ? ? ? ? ? ?(!ARCH_OMAP3 || OMAP3_EMU)
+ ? ? depends on CPU_V6 || CPU_V6K || CPU_V7 || XSCALE_PMU ? ? ? default y
? ? ? bool
+ ? ? select OMAP3_EMU if ARCH_OMAP3

Quoted 9 lines
Quoted 2 lines

?config MULTI_IRQ_HANDLER
? ? ? bool

This issue has been discussed on the list in the past and I still think that it would be better for your config to select OMAP3_EMU explicitly. If we do that here unconditionally then we end up also bringing in OC_ETM which isn't something that sounds like a good idea (may have implications for power consumption in production hardware?).

Will,

I quite understand your concern. How about this one?
----

arch/arm/Kconfig +2 -2
index 2fd0911..e53f9e4 100644
@@ -1084,10 +1084,10 @@ config XSCALE_PMU
        default y
 
 config CPU_HAS_PMU
-       depends on (CPU_V6 || CPU_V6K || CPU_V7 || XSCALE_PMU) && \
-                  (!ARCH_OMAP3 || OMAP3_EMU)
+       depends on CPU_V6 || CPU_V6K || CPU_V7 || XSCALE_PMU
        default y
        bool
+       select OMAP3_EMU if (PERF_EVENTS && ARCH_OMAP3)
 
 config MULTI_IRQ_HANDLER
        bool

----

I think it is quite logically clear.
1. if the CPU is V6, V6K, V7, then CPU_HAS_PMU supported
2. if the CPU is OMAP3, we need select OMAP3_EMU built-in
3. if we don't use PERF at all, we don't need built-in OMAP3_EMU

Thanks,

Signature · 5 lines
Bryan Wu <[email protected]>
Kernel Developer ? ?+86.138-1617-6545 Mobile
Ubuntu Kernel Team
Canonical Ltd. ? ? ?www.canonical.com
Ubuntu - Linux for human beings | www.ubuntu.com
#3 lore raw

PATCH 1/1 ARM: automatically select OMAP3_PMU if we try to use perf on OMAP3

Quoted 19 lines · Bryan Wu
Quoted 7 lines · Will Deacon

This issue has been discussed on the list in the past and I still think that it would be better for your config to select OMAP3_EMU explicitly. If we do that here unconditionally then we end up also bringing in OC_ETM which isn't something that sounds like a good idea (may have implications for power consumption in production hardware?).

I quite understand your concern. How about this one?
----

arch/arm/Kconfig +0 -0
index 2fd0911..e53f9e4 100644
@@ -1084,10 +1084,10 @@ config XSCALE_PMU
        default y
 

arch/arm/Kconfig config XSCALE_PMU · line 1093

Quoted 10 lines
arch/arm/Kconfig +2 -2
 config CPU_HAS_PMU
-       depends on (CPU_V6 || CPU_V6K || CPU_V7 || XSCALE_PMU) && \
-                  (!ARCH_OMAP3 || OMAP3_EMU)
+       depends on CPU_V6 || CPU_V6K || CPU_V7 || XSCALE_PMU
        default y
        bool
+       select OMAP3_EMU if (PERF_EVENTS && ARCH_OMAP3)
 
 config MULTI_IRQ_HANDLER
        bool

As far as I can tell, it still has the same issue. I think the existing code is better. If you want to support HW_PERF_EVENTS on OMAP3, just turn on OMAP3_EMU. Where's the problem with that?

In general, specifying clear dependencies is preferred over 'select' statements, which are the equivalent to the 'comefrom' statement in programming languages [1].

Arnd

[1] http://en.wikipedia.org/wiki/COMEFROM

#4 lore raw

PATCH 1/1 ARM: automatically select OMAP3_PMU if we try to use perf on OMAP3

Quoted 27 lines · Arnd Bergmann
Quoted 26 lines · Bryan Wu
Quoted 7 lines · Will Deacon

This issue has been discussed on the list in the past and I still think that it would be better for your config to select OMAP3_EMU explicitly. If we do that here unconditionally then we end up also bringing in OC_ETM which isn't something that sounds like a good idea (may have implications for power consumption in production hardware?).

I quite understand your concern. How about this one?
----

arch/arm/Kconfig +2 -2
index 2fd0911..e53f9e4 100644
@@ -1084,10 +1084,10 @@ config XSCALE_PMU
        default y
 
 config CPU_HAS_PMU
-       depends on (CPU_V6 || CPU_V6K || CPU_V7 || XSCALE_PMU) && \
-                  (!ARCH_OMAP3 || OMAP3_EMU)
+       depends on CPU_V6 || CPU_V6K || CPU_V7 || XSCALE_PMU
        default y
        bool
+       select OMAP3_EMU if (PERF_EVENTS && ARCH_OMAP3)
 
Quoted 7 lines

arch/arm/Kconfig config XSCALE_PMU · line 1093

Quoted 3 lines
arch/arm/Kconfig +0 -0
 config MULTI_IRQ_HANDLER
        bool

As far as I can tell, it still has the same issue. I think the existing code is better. If you want to support HW_PERF_EVENTS on OMAP3, just turn on OMAP3_EMU. Where's the problem with that?

Yup. Although the new patch does address my previous technical concerns, I'm still not happy with it. Just select OMAP3_EMU!

Quoted 1 line

[1] http://en.wikipedia.org/wiki/COMEFROM

Ha, that really is horrible!

Will