Skip to contentSkip to conversation

CPUFreq Kconfig fixes

PATCH In review Viresh Kumar 9 participants 25 messages Jun 12, 2013 – Jun 17, 2013

Subsystems (6)
lore
Share & tools
lore

Viresh Kumar

author maintainer
#0 lore raw

cover CPUFreq Kconfig fixes

Hi Rafael,

Recently Arnd sent few fixes where drivers were using APIs from freq_table.c but haven't selected CPU_FREQ_TABLE. Based on that, I just crossed checked all the places where it should be selected and where it shouldn't be. These are fixes around that.

I have applied these in my cpufreq-kconfig-fixes branch. Will send you a pull request separately once I get some Acks (will wait for few days).

Viresh Kumar (11):
cpufreq: blackfin: enable driver for CONFIG_BFIN_CPU_FREQ
cpufreq: cris: select CPU_FREQ_TABLE
cpufreq: davinci: select CPU_FREQ_TABLE
cpufreq: exynos: select CPU_FREQ_TABLE
cpufreq: highbank: remove select CPU_FREQ_TABLE
cpufreq: imx: select CPU_FREQ_TABLE
cpufreq: powerpc: CBE_RAS: select CPU_FREQ_TABLE
cpufreq: pxa: select CPU_FREQ_TABLE
cpufreq: S3C2416/S3C64XX: select CPU_FREQ_TABLE
cpufreq: tegra: select CPU_FREQ_TABLE for ARCH_TEGRA
cpufreq: X86_AMD_FREQ_SENSITIVITY: select CPU_FREQ_TABLE

 arch/arm/mach-davinci/Kconfig   | 1 +
 arch/arm/mach-pxa/Kconfig       | 3 +++
 arch/arm/mach-tegra/Kconfig     | 4 +---
 arch/cris/Kconfig               | 2 ++
 drivers/cpufreq/Kconfig.arm     | 6 +++++-
 drivers/cpufreq/Kconfig.powerpc | 1 +
 drivers/cpufreq/Kconfig.x86     | 1 +
 drivers/cpufreq/Makefile        | 2 +-
 8 files changed, 15 insertions(+), 5 deletions(-)
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#1 lore raw

PATCH 1/11 cpufreq: blackfin: enable driver for CONFIG_BFIN_CPU_FREQ

By mistake blackfin's cpufreq driver is enabled when CONFIG_BLACKFIN was present, whereas it should have been enabled only when CONFIG_BFIN_CPU_FREQ is present.

Fix it.

---
 drivers/cpufreq/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/Makefile +1 -1
index 315b923..13c3f83 100644
@@ -83,7 +83,7 @@ obj-$(CONFIG_CPU_FREQ_MAPLE)		+= maple-cpufreq.o
 ##################################################################################
 # Other platform drivers
 obj-$(CONFIG_AVR32_AT32AP_CPUFREQ)	+= at32ap-cpufreq.o
-obj-$(CONFIG_BLACKFIN)			+= blackfin-cpufreq.o
+obj-$(CONFIG_BFIN_CPU_FREQ)		+= blackfin-cpufreq.o
 obj-$(CONFIG_CRIS_MACH_ARTPEC3)		+= cris-artpec3-cpufreq.o
 obj-$(CONFIG_ETRAXFS)			+= cris-etraxfs-cpufreq.o
 obj-$(CONFIG_IA64_ACPI_CPUFREQ)		+= ia64-acpi-cpufreq.o
Signature · 1 line
1.7.12.rc2.18.g61b472e
Acked-by on v1 1/11
#2 lore raw

Re: [uclinux-dist-devel] [PATCH 01/11] cpufreq: blackfin: enable driver for CONFIG_BFIN_CPU_FREQ

Quoted 3 lines · On Wednesday 12 June 2013 04:15:08 Viresh Kumar wrote:

By mistake blackfin's cpufreq driver is enabled when CONFIG_BLACKFIN was present, whereas it should have been enabled only when CONFIG_BFIN_CPU_FREQ is present.

-mike

author maintainer
#3 lore raw

PATCH 2/11 cpufreq: cris: select CPU_FREQ_TABLE

In reply to Viresh Kumar

CPUFreq driver of this platform uses APIs from freq_table.c and so must select CPU_FREQ_TABLE.

---
 arch/cris/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
arch/cris/Kconfig +2 -0
index 8769a90..5f7530c 100644
@@ -134,11 +134,13 @@ config SVINTO_SIM
 
 config ETRAXFS
 	bool "ETRAX-FS-V32"
+	select CPU_FREQ_TABLE if CPU_FREQ
 	help
 	  Support CRIS V32.
 
 config CRIS_MACH_ARTPEC3
         bool "ARTPEC-3"
+	select CPU_FREQ_TABLE if CPU_FREQ
         help
           Support Axis ARTPEC-3.
 
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#4 lore raw

PATCH 3/11 cpufreq: davinci: select CPU_FREQ_TABLE

In reply to Viresh Kumar

CPUFreq driver of this platform uses APIs from freq_table.c and so must select CPU_FREQ_TABLE.

---
 arch/arm/mach-davinci/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-davinci/Kconfig +1 -0
index a075b3e..e026b19 100644
@@ -40,6 +40,7 @@ config ARCH_DAVINCI_DA850
 	bool "DA850/OMAP-L138/AM18x based system"
 	select ARCH_DAVINCI_DA8XX
 	select ARCH_HAS_CPUFREQ
+	select CPU_FREQ_TABLE
 	select CP_INTC
 
 config ARCH_DAVINCI_DA8XX
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#5 lore raw

PATCH 4/11 cpufreq: exynos: select CPU_FREQ_TABLE

In reply to Viresh Kumar

CPUFreq driver of this platform uses APIs from freq_table.c and so must select CPU_FREQ_TABLE.

---
 drivers/cpufreq/Kconfig.arm | 2 ++
 1 file changed, 2 insertions(+)
drivers/cpufreq/Kconfig.arm +2 -0
index 6e57543..9d7e209 100644
@@ -18,6 +18,7 @@ config ARM_DT_BL_CPUFREQ
 config ARM_EXYNOS_CPUFREQ
 	bool "SAMSUNG EXYNOS SoCs"
 	depends on ARCH_EXYNOS
+	select CPU_FREQ_TABLE
 	default y
 	help
 	  This adds the CPUFreq driver common part for Samsung
@@ -46,6 +47,7 @@ config ARM_EXYNOS5250_CPUFREQ
 config ARM_EXYNOS5440_CPUFREQ
 	def_bool SOC_EXYNOS5440
 	depends on HAVE_CLK && PM_OPP && OF
+	select CPU_FREQ_TABLE
 	help
 	  This adds the CPUFreq driver for Samsung EXYNOS5440
 	  SoC. The nature of exynos5440 clock controller is
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#6 lore raw

PATCH 5/11 cpufreq: highbank: remove select CPU_FREQ_TABLE

In reply to Viresh Kumar

Highbank cpufreq driver doesn't use any APIs from freq_table.c and so must not select CPU_FREQ_TABLE.

Cc Mark Langsdorf <[email protected]>
---
 drivers/cpufreq/Kconfig.arm | 1 -
 1 file changed, 1 deletion(-)
drivers/cpufreq/Kconfig.arm +0 -1
index 9d7e209..891dd1c 100644
@@ -57,7 +57,6 @@ config ARM_EXYNOS5440_CPUFREQ
 config ARM_HIGHBANK_CPUFREQ
 	tristate "Calxeda Highbank-based"
 	depends on ARCH_HIGHBANK
-	select CPU_FREQ_TABLE
 	select GENERIC_CPUFREQ_CPU0
 	select PM_OPP
 	select REGULATOR
Signature · 1 line
1.7.12.rc2.18.g61b472e
Acked-by on v1 5/11
#7 lore raw

Re: [PATCH 05/11] cpufreq: highbank: remove select CPU_FREQ_TABLE

Quoted 5 lines · Viresh Kumar

Highbank cpufreq driver doesn't use any APIs from freq_table.c and so must not select CPU_FREQ_TABLE.

Cc Mark Langsdorf <[email protected]>

Thanks for catching this.

Quoted 17 lines
---
 drivers/cpufreq/Kconfig.arm | 1 -
 1 file changed, 1 deletion(-)
drivers/cpufreq/Kconfig.arm +0 -1
index 9d7e209..891dd1c 100644
@@ -57,7 +57,6 @@ config ARM_EXYNOS5440_CPUFREQ
 config ARM_HIGHBANK_CPUFREQ
 	tristate "Calxeda Highbank-based"
 	depends on ARCH_HIGHBANK
-	select CPU_FREQ_TABLE
 	select GENERIC_CPUFREQ_CPU0
 	select PM_OPP
 	select REGULATOR
author maintainer
#8 lore raw

PATCH 6/11 cpufreq: imx: select CPU_FREQ_TABLE

In reply to Viresh Kumar

CPUFreq driver of this platform uses APIs from freq_table.c and so must select CPU_FREQ_TABLE.

---
 drivers/cpufreq/Kconfig.arm | 1 +
 1 file changed, 1 insertion(+)
drivers/cpufreq/Kconfig.arm +1 -0
index 891dd1c..dc26303 100644
@@ -72,6 +72,7 @@ config ARM_IMX6Q_CPUFREQ
 	tristate "Freescale i.MX6Q cpufreq support"
 	depends on SOC_IMX6Q
 	depends on REGULATOR_ANATOP
+	select CPU_FREQ_TABLE
 	help
 	  This adds cpufreq driver support for Freescale i.MX6Q SOC.
 
Signature · 1 line
1.7.12.rc2.18.g61b472e
Acked-by on v1 6/11
#9 lore raw

Re: [PATCH 06/11] cpufreq: imx: select CPU_FREQ_TABLE

Quoted 5 lines · Viresh Kumar

CPUFreq driver of this platform uses APIs from freq_table.c and so must select CPU_FREQ_TABLE.

Quoted 19 lines
---
 drivers/cpufreq/Kconfig.arm | 1 +
 1 file changed, 1 insertion(+)
drivers/cpufreq/Kconfig.arm +1 -0
index 891dd1c..dc26303 100644
@@ -72,6 +72,7 @@ config ARM_IMX6Q_CPUFREQ
 	tristate "Freescale i.MX6Q cpufreq support"
 	depends on SOC_IMX6Q
 	depends on REGULATOR_ANATOP
+	select CPU_FREQ_TABLE
 	help
 	  This adds cpufreq driver support for Freescale i.MX6Q SOC.
 
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#10 lore raw

PATCH 7/11 cpufreq: powerpc: CBE_RAS: select CPU_FREQ_TABLE

In reply to Viresh Kumar

CPUFreq driver of this platform uses APIs from freq_table.c and so must select CPU_FREQ_TABLE.

---
 drivers/cpufreq/Kconfig.powerpc | 1 +
 1 file changed, 1 insertion(+)
drivers/cpufreq/Kconfig.powerpc +1 -0
index 9c926ca..68c1abc 100644
@@ -1,6 +1,7 @@
 config CPU_FREQ_CBE
 	tristate "CBE frequency scaling"
 	depends on CBE_RAS && PPC_CELL
+	select CPU_FREQ_TABLE
 	default m
 	help
 	  This adds the cpufreq driver for Cell BE processors.
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#11 lore raw

PATCH 8/11 cpufreq: pxa: select CPU_FREQ_TABLE

In reply to Viresh Kumar

CPUFreq driver of this platform uses APIs from freq_table.c and so must select CPU_FREQ_TABLE.

---
 arch/arm/mach-pxa/Kconfig | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach-pxa/Kconfig +3 -0
index 96100db..a842711 100644
@@ -615,12 +615,14 @@ endmenu
 config PXA25x
 	bool
 	select CPU_XSCALE
+	select CPU_FREQ_TABLE if CPU_FREQ
 	help
 	  Select code specific to PXA21x/25x/26x variants
 
 config PXA27x
 	bool
 	select CPU_XSCALE
+	select CPU_FREQ_TABLE if CPU_FREQ
 	help
 	  Select code specific to PXA27x variants
 
@@ -633,6 +635,7 @@ config CPU_PXA26x
 config PXA3xx
 	bool
 	select CPU_XSC3
+	select CPU_FREQ_TABLE if CPU_FREQ
 	help
 	  Select code specific to PXA3xx variants
 
Signature · 1 line
1.7.12.rc2.18.g61b472e
author maintainer
#12 lore raw

PATCH 9/11 cpufreq: S3C2416/S3C64XX: select CPU_FREQ_TABLE

In reply to Viresh Kumar

CPUFreq driver of this platform uses APIs from freq_table.c and so must select CPU_FREQ_TABLE.

Cc Heiko Stuebner <[email protected]>
---
 drivers/cpufreq/Kconfig.arm | 2 ++
 1 file changed, 2 insertions(+)
drivers/cpufreq/Kconfig.arm +2 -0
index dc26303..d52261b 100644
@@ -101,6 +101,7 @@ config ARM_OMAP2PLUS_CPUFREQ
 config ARM_S3C2416_CPUFREQ
 	bool "S3C2416 CPU Frequency scaling support"
 	depends on CPU_S3C2416
+	select CPU_FREQ_TABLE
 	help
 	  This adds the CPUFreq driver for the Samsung S3C2416 and
 	  S3C2450 SoC. The S3C2416 supports changing the rate of the
@@ -123,6 +124,7 @@ config ARM_S3C2416_CPUFREQ_VCORESCALE
 config ARM_S3C64XX_CPUFREQ
 	bool "Samsung S3C64XX"
 	depends on CPU_S3C6410
+	select CPU_FREQ_TABLE
 	default y
 	help
 	  This adds the CPUFreq driver for Samsung S3C6410 SoC.
Signature · 1 line
1.7.12.rc2.18.g61b472e
Acked-by on v1 9/11
#13 lore raw

Re: [PATCH 09/11] cpufreq: S3C2416/S3C64XX: select CPU_FREQ_TABLE

Am Mittwoch, 12. Juni 2013, 10:15:16 schrieb Viresh Kumar:

Quoted 4 lines

CPUFreq driver of this platform uses APIs from freq_table.c and so must select CPU_FREQ_TABLE.

Cc Heiko Stuebner <[email protected]>

For the s3c2416-part

Quoted 25 lines
---
 drivers/cpufreq/Kconfig.arm | 2 ++
 1 file changed, 2 insertions(+)
drivers/cpufreq/Kconfig.arm +2 -0
index dc26303..d52261b 100644
@@ -101,6 +101,7 @@ config ARM_OMAP2PLUS_CPUFREQ
 config ARM_S3C2416_CPUFREQ
 	bool "S3C2416 CPU Frequency scaling support"
 	depends on CPU_S3C2416
+	select CPU_FREQ_TABLE
 	help
 	  This adds the CPUFreq driver for the Samsung S3C2416 and
 	  S3C2450 SoC. The S3C2416 supports changing the rate of the
@@ -123,6 +124,7 @@ config ARM_S3C2416_CPUFREQ_VCORESCALE
 config ARM_S3C64XX_CPUFREQ
 	bool "Samsung S3C64XX"
 	depends on CPU_S3C6410
+	select CPU_FREQ_TABLE
 	default y
 	help
 	  This adds the CPUFreq driver for Samsung S3C6410 SoC.
author maintainer
#14 lore raw

PATCH 10/11 cpufreq: tegra: select CPU_FREQ_TABLE for ARCH_TEGRA

In reply to Viresh Kumar

ARCH_TEGRA selects ARCH_HAS_CPUFREQ, so CPUFREQ will be enabled for all variants of TEGRA. CPUFreq driver for tegra is enabled if ARCH_TEGRA is selected. Driver uses APIs from freq_table.c and so we must select CPU_FREQ_TABLE for ARCH_TEGRA.

This also removes select CPU_FREQ_TABLE from individual tegra variants.

Cc Stephen Warren <[email protected]>
---
 arch/arm/mach-tegra/Kconfig | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/arm/mach-tegra/Kconfig +1 -3
index 84d72fc..3636b6c 100644
@@ -6,6 +6,7 @@ config ARCH_TEGRA
 	select CLKSRC_MMIO
 	select CLKSRC_OF
 	select COMMON_CLK
+	select CPU_FREQ_TABLE
 	select GENERIC_CLOCKEVENTS
 	select HAVE_ARM_SCU if SMP
 	select HAVE_ARM_TWD if LOCAL_TIMERS
@@ -28,7 +29,6 @@ config ARCH_TEGRA_2x_SOC
 	select ARM_ERRATA_754327 if SMP
 	select ARM_ERRATA_764369 if SMP
 	select ARM_GIC
-	select CPU_FREQ_TABLE if CPU_FREQ
 	select CPU_V7
 	select PINCTRL
 	select PINCTRL_TEGRA20
@@ -46,7 +46,6 @@ config ARCH_TEGRA_3x_SOC
 	select ARM_ERRATA_754322
 	select ARM_ERRATA_764369 if SMP
 	select ARM_GIC
-	select CPU_FREQ_TABLE if CPU_FREQ
 	select CPU_V7
 	select PINCTRL
 	select PINCTRL_TEGRA30
@@ -63,7 +62,6 @@ config ARCH_TEGRA_114_SOC
 	select ARM_ARCH_TIMER
 	select ARM_GIC
 	select ARM_L1_CACHE_SHIFT_6
-	select CPU_FREQ_TABLE if CPU_FREQ
 	select CPU_V7
 	select PINCTRL
 	select PINCTRL_TEGRA114
Signature · 1 line
1.7.12.rc2.18.g61b472e
#15 lore raw

Re: [PATCH 10/11] cpufreq: tegra: select CPU_FREQ_TABLE for ARCH_TEGRA

Quoted 5 lines · Viresh Kumar

ARCH_TEGRA selects ARCH_HAS_CPUFREQ, so CPUFREQ will be enabled for all variants of TEGRA. CPUFreq driver for tegra is enabled if ARCH_TEGRA is selected. Driver uses APIs from freq_table.c and so we must select CPU_FREQ_TABLE for ARCH_TEGRA.

This also removes select CPU_FREQ_TABLE from individual tegra variants.

I guess the real issue here is that drivers/cpufreq/tegra-cpufreq.c gets built based on ARCH_TEGRA, which doesn't depend on nor select CPU_FREQ itself, so:

select CPU_FREQ_TABLE if CPU_FREQ

... isn't guaranteed to fire.

The correct solution seems to be:

* Add CONFIG_ARM_TEGRA_CPUFREQ to drivers/cpufreq/Kconfig.arm.
* Make that Kconfig option selct CPU_FREQ_TABLE.
* Make that Kconfig option be def_bool ARCH_TEGRA.
* Modify drivers/cpufreq/Makefile to build tegra-cpufreq.c based on that.
* Remove all the cpufreq-related stuff from arch/arm/mach-tegra/Kconfig.

That way, tegra-cpufreq.c can't be built if !CPU_FREQ, and Tegra's cpufreq works the same way as all the other cpufreq drivers.

author maintainer Acked-by Arnd Bergmann Acked-by Arnd Bergmann
#16 lore raw

Re: [PATCH 10/11] cpufreq: tegra: select CPU_FREQ_TABLE for ARCH_TEGRA

Quoted 17 lines · Stephen Warren
Quoted 5 lines · Viresh Kumar

ARCH_TEGRA selects ARCH_HAS_CPUFREQ, so CPUFREQ will be enabled for all variants of TEGRA. CPUFreq driver for tegra is enabled if ARCH_TEGRA is selected. Driver uses APIs from freq_table.c and so we must select CPU_FREQ_TABLE for ARCH_TEGRA.

This also removes select CPU_FREQ_TABLE from individual tegra variants.

I guess the real issue here is that drivers/cpufreq/tegra-cpufreq.c gets built based on ARCH_TEGRA, which doesn't depend on nor select CPU_FREQ itself, so:

select CPU_FREQ_TABLE if CPU_FREQ

... isn't guaranteed to fire.

The correct solution seems to be:

Quoted 8 lines

* Add CONFIG_ARM_TEGRA_CPUFREQ to drivers/cpufreq/Kconfig.arm.
* Make that Kconfig option selct CPU_FREQ_TABLE.
* Make that Kconfig option be def_bool ARCH_TEGRA.
* Modify drivers/cpufreq/Makefile to build tegra-cpufreq.c based on that.
* Remove all the cpufreq-related stuff from arch/arm/mach-tegra/Kconfig.

That way, tegra-cpufreq.c can't be built if !CPU_FREQ, and Tegra's cpufreq works the same way as all the other cpufreq drivers.

Hmmm. check this out (attached too for you to test):

----------x---------------x------------

From: Viresh Kumar <[email protected]>
Date: Wed, 12 Jun 2013 12:05:48 +0530
Subject: [PATCH] cpufreq: tegra: create CONFIG_ARM_TEGRA_CPUFREQ

currently Tegra cpufreq driver gets built based on ARCH_TEGRA, which doesn't depend on nor select CPU_FREQ itself, so:

select CPU_FREQ_TABLE if CPU_FREQ

... isn't guaranteed to fire.

The correct solution seems to be:

* Add CONFIG_ARM_TEGRA_CPUFREQ to drivers/cpufreq/Kconfig.arm.
* Make that Kconfig option selct CPU_FREQ_TABLE.
* Make that Kconfig option be def_bool ARCH_TEGRA.
* Modify drivers/cpufreq/Makefile to build tegra-cpufreq.c based on that.
* Remove all the cpufreq-related stuff from arch/arm/mach-tegra/Kconfig.

That way, tegra-cpufreq.c can't be built if !CPU_FREQ, and Tegra's cpufreq works the same way as all the other cpufreq drivers.

This patch does it.

---
 arch/arm/mach-tegra/Kconfig | 3 ---
 drivers/cpufreq/Kconfig.arm | 8 ++++++++
 drivers/cpufreq/Makefile    | 2 +-
 3 files changed, 9 insertions(+), 4 deletions(-)
arch/arm/mach-tegra/Kconfig +0 -3
index 84d72fc..5c0db06 100644
@@ -28,7 +28,6 @@ config ARCH_TEGRA_2x_SOC
 	select ARM_ERRATA_754327 if SMP
 	select ARM_ERRATA_764369 if SMP
 	select ARM_GIC
-	select CPU_FREQ_TABLE if CPU_FREQ
 	select CPU_V7
 	select PINCTRL
 	select PINCTRL_TEGRA20
@@ -46,7 +45,6 @@ config ARCH_TEGRA_3x_SOC
 	select ARM_ERRATA_754322
 	select ARM_ERRATA_764369 if SMP
 	select ARM_GIC
-	select CPU_FREQ_TABLE if CPU_FREQ
 	select CPU_V7
 	select PINCTRL
 	select PINCTRL_TEGRA30
@@ -63,7 +61,6 @@ config ARCH_TEGRA_114_SOC
 	select ARM_ARCH_TIMER
 	select ARM_GIC
 	select ARM_L1_CACHE_SHIFT_6
-	select CPU_FREQ_TABLE if CPU_FREQ
 	select CPU_V7
 	select PINCTRL
 	select PINCTRL_TEGRA114
drivers/cpufreq/Kconfig.arm +8 -0
index d52261b..5085427 100644
@@ -154,3 +154,11 @@ config ARM_SPEAR_CPUFREQ
 	default y
 	help
 	  This adds the CPUFreq driver support for SPEAr SOCs.
+
+config ARM_TEGRA_CPUFREQ
+	bool "TEGRA CPUFreq support"
+	depends on ARCH_TEGRA
+	select CPU_FREQ_TABLE
+	default y
+	help
+	  This adds the CPUFreq driver support for TEGRA SOCs.
drivers/cpufreq/Makefile +1 -1
index 13c3f83..9c873e7 100644
@@ -71,7 +71,7 @@ obj-$(CONFIG_ARM_S5PV210_CPUFREQ)	+= s5pv210-cpufreq.o
 obj-$(CONFIG_ARM_SA1100_CPUFREQ)	+= sa1100-cpufreq.o
 obj-$(CONFIG_ARM_SA1110_CPUFREQ)	+= sa1110-cpufreq.o
 obj-$(CONFIG_ARM_SPEAR_CPUFREQ)		+= spear-cpufreq.o
-obj-$(CONFIG_ARCH_TEGRA)		+= tegra-cpufreq.o
+obj-$(CONFIG_ARM_TEGRA_CPUFREQ)		+= tegra-cpufreq.o
 
 ##################################################################################
 # PowerPC platform drivers

From 389d76878ec1d6eb5383cb6accf5933f35e1bb1a Mon Sep 17 00:00:00 2001
Message-Id: <389d76878ec1d6eb5383cb6accf5933f35e1bb1a.1371097396.git.viresh.kumar@linaro.org>
From: Viresh Kumar <[email protected]>
Date: Wed, 12 Jun 2013 12:05:48 +0530
Subject: [PATCH] cpufreq: tegra: create CONFIG_ARM_TEGRA_CPUFREQ

currently Tegra cpufreq driver gets built based on ARCH_TEGRA, which doesn't depend on nor select CPU_FREQ itself, so:

select CPU_FREQ_TABLE if CPU_FREQ

... isn't guaranteed to fire.

The correct solution seems to be:

* Add CONFIG_ARM_TEGRA_CPUFREQ to drivers/cpufreq/Kconfig.arm.
* Make that Kconfig option selct CPU_FREQ_TABLE.
* Make that Kconfig option be def_bool ARCH_TEGRA.
* Modify drivers/cpufreq/Makefile to build tegra-cpufreq.c based on that.
* Remove all the cpufreq-related stuff from arch/arm/mach-tegra/Kconfig.

That way, tegra-cpufreq.c can't be built if !CPU_FREQ, and Tegra's cpufreq works the same way as all the other cpufreq drivers.

This patch does it.

---
 arch/arm/mach-tegra/Kconfig | 3 ---
 drivers/cpufreq/Kconfig.arm | 8 ++++++++
 drivers/cpufreq/Makefile    | 2 +-
 3 files changed, 9 insertions(+), 4 deletions(-)
arch/arm/mach-tegra/Kconfig +0 -3
index 84d72fc..5c0db06 100644
@@ -28,7 +28,6 @@ config ARCH_TEGRA_2x_SOC
 	select ARM_ERRATA_754327 if SMP
 	select ARM_ERRATA_764369 if SMP
 	select ARM_GIC
-	select CPU_FREQ_TABLE if CPU_FREQ
 	select CPU_V7
 	select PINCTRL
 	select PINCTRL_TEGRA20
@@ -46,7 +45,6 @@ config ARCH_TEGRA_3x_SOC
 	select ARM_ERRATA_754322
 	select ARM_ERRATA_764369 if SMP
 	select ARM_GIC
-	select CPU_FREQ_TABLE if CPU_FREQ
 	select CPU_V7
 	select PINCTRL
 	select PINCTRL_TEGRA30
@@ -63,7 +61,6 @@ config ARCH_TEGRA_114_SOC
 	select ARM_ARCH_TIMER
 	select ARM_GIC
 	select ARM_L1_CACHE_SHIFT_6
-	select CPU_FREQ_TABLE if CPU_FREQ
 	select CPU_V7
 	select PINCTRL
 	select PINCTRL_TEGRA114
drivers/cpufreq/Kconfig.arm +8 -0
index d52261b..5085427 100644
@@ -154,3 +154,11 @@ config ARM_SPEAR_CPUFREQ
 	default y
 	help
 	  This adds the CPUFreq driver support for SPEAr SOCs.
+
+config ARM_TEGRA_CPUFREQ
+	bool "TEGRA CPUFreq support"
+	depends on ARCH_TEGRA
+	select CPU_FREQ_TABLE
+	default y
+	help
+	  This adds the CPUFreq driver support for TEGRA SOCs.
drivers/cpufreq/Makefile +1 -1
index 13c3f83..9c873e7 100644
@@ -71,7 +71,7 @@ obj-$(CONFIG_ARM_S5PV210_CPUFREQ)	+= s5pv210-cpufreq.o
 obj-$(CONFIG_ARM_SA1100_CPUFREQ)	+= sa1100-cpufreq.o
 obj-$(CONFIG_ARM_SA1110_CPUFREQ)	+= sa1110-cpufreq.o
 obj-$(CONFIG_ARM_SPEAR_CPUFREQ)		+= spear-cpufreq.o
-obj-$(CONFIG_ARCH_TEGRA)		+= tegra-cpufreq.o
+obj-$(CONFIG_ARM_TEGRA_CPUFREQ)		+= tegra-cpufreq.o
 
 ##################################################################################
 # PowerPC platform drivers
Signature · 1 line
1.7.12.rc2.18.g61b472e
Tested-by Acked-by
#17 lore raw

Re: [PATCH 10/11] cpufreq: tegra: select CPU_FREQ_TABLE for ARCH_TEGRA

Quoted 24 lines · Viresh Kumar
Quoted 23 lines · Stephen Warren
Quoted 5 lines · Viresh Kumar

ARCH_TEGRA selects ARCH_HAS_CPUFREQ, so CPUFREQ will be enabled for all variants of TEGRA. CPUFreq driver for tegra is enabled if ARCH_TEGRA is selected. Driver uses APIs from freq_table.c and so we must select CPU_FREQ_TABLE for ARCH_TEGRA.

This also removes select CPU_FREQ_TABLE from individual tegra variants.

I guess the real issue here is that drivers/cpufreq/tegra-cpufreq.c gets built based on ARCH_TEGRA, which doesn't depend on nor select CPU_FREQ itself, so:

select CPU_FREQ_TABLE if CPU_FREQ

... isn't guaranteed to fire.

The correct solution seems to be:

* Add CONFIG_ARM_TEGRA_CPUFREQ to drivers/cpufreq/Kconfig.arm.
* Make that Kconfig option selct CPU_FREQ_TABLE.
* Make that Kconfig option be def_bool ARCH_TEGRA.
* Modify drivers/cpufreq/Makefile to build tegra-cpufreq.c based on that.
* Remove all the cpufreq-related stuff from arch/arm/mach-tegra/Kconfig.

Quoted 4 lines
Quoted 2 lines

That way, tegra-cpufreq.c can't be built if !CPU_FREQ, and Tegra's cpufreq works the same way as all the other cpufreq drivers.

Hmmm. check this out (attached too for you to test):

This certainly generates the correct .config when I "make tegra_defconfig" after applying it, and a build after disabling CPU_FREQ links OK, so,

(I assume this patch would go through the cpufreq tree?)

author maintainer
#18 lore raw

Re: [PATCH 10/11] cpufreq: tegra: select CPU_FREQ_TABLE for ARCH_TEGRA

Quoted 25 lines · Stephen Warren
Quoted 24 lines · Viresh Kumar
Quoted 23 lines · Stephen Warren
Quoted 5 lines · Viresh Kumar

ARCH_TEGRA selects ARCH_HAS_CPUFREQ, so CPUFREQ will be enabled for all variants of TEGRA. CPUFreq driver for tegra is enabled if ARCH_TEGRA is selected. Driver uses APIs from freq_table.c and so we must select CPU_FREQ_TABLE for ARCH_TEGRA.

This also removes select CPU_FREQ_TABLE from individual tegra variants.

I guess the real issue here is that drivers/cpufreq/tegra-cpufreq.c gets built based on ARCH_TEGRA, which doesn't depend on nor select CPU_FREQ itself, so:

select CPU_FREQ_TABLE if CPU_FREQ

... isn't guaranteed to fire.

The correct solution seems to be:

* Add CONFIG_ARM_TEGRA_CPUFREQ to drivers/cpufreq/Kconfig.arm.
* Make that Kconfig option selct CPU_FREQ_TABLE.
* Make that Kconfig option be def_bool ARCH_TEGRA.
* Modify drivers/cpufreq/Makefile to build tegra-cpufreq.c based on that.
* Remove all the cpufreq-related stuff from arch/arm/mach-tegra/Kconfig.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

That way, tegra-cpufreq.c can't be built if !CPU_FREQ, and Tegra's cpufreq works the same way as all the other cpufreq drivers.

Hmmm. check this out (attached too for you to test):

This certainly generates the correct .config when I "make tegra_defconfig" after applying it, and a build after disabling CPU_FREQ links OK, so,

Yeah, I also compile tested it.

Quoted 4 lines

(I assume this patch would go through the cpufreq tree?)

Yes. Via my ARM cpufreq tree.

author maintainer
#19 lore raw

PATCH 11/11 cpufreq: X86_AMD_FREQ_SENSITIVITY: select CPU_FREQ_TABLE

In reply to Viresh Kumar

This CPUFreq driver uses APIs from freq_table.c and so must select CPU_FREQ_TABLE.

---
 drivers/cpufreq/Kconfig.x86 | 1 +
 1 file changed, 1 insertion(+)
drivers/cpufreq/Kconfig.x86 +1 -0
index 6bd63d6..e2b6eab 100644
@@ -132,6 +132,7 @@ config X86_POWERNOW_K8
 config X86_AMD_FREQ_SENSITIVITY
 	tristate "AMD frequency sensitivity feedback powersave bias"
 	depends on CPU_FREQ_GOV_ONDEMAND && X86_ACPI_CPUFREQ && CPU_SUP_AMD
+	select CPU_FREQ_TABLE
 	help
 	  This adds AMD-specific powersave bias function to the ondemand
 	  governor, which allows it to make more power-conscious frequency
Signature · 1 line
1.7.12.rc2.18.g61b472e
Acked-by on v1 11/11
#20 lore raw

Re: [PATCH 11/11] cpufreq: X86_AMD_FREQ_SENSITIVITY: select CPU_FREQ_TABLE

Quoted 3 lines · Viresh Kumar

This CPUFreq driver uses APIs from freq_table.c and so must select CPU_FREQ_TABLE.

Ah, thanks for cathcing this!

Quoted 2 lines
Quoted 20 lines
---
 drivers/cpufreq/Kconfig.x86 | 1 +
 1 file changed, 1 insertion(+)
drivers/cpufreq/Kconfig.x86 +1 -0
index 6bd63d6..e2b6eab 100644
@@ -132,6 +132,7 @@ config X86_POWERNOW_K8
 config X86_AMD_FREQ_SENSITIVITY
 	tristate "AMD frequency sensitivity feedback powersave bias"
 	depends on CPU_FREQ_GOV_ONDEMAND && X86_ACPI_CPUFREQ && CPU_SUP_AMD
+	select CPU_FREQ_TABLE
 	help
 	  This adds AMD-specific powersave bias function to the ondemand
 	  governor, which allows it to make more power-conscious frequency
Signature · 1 line
1.7.12.rc2.18.g61b472e
Acked-by on the v1 series
#21 lore raw
In reply to Viresh Kumar
Quoted 7 lines · Viresh Kumar

Recently Arnd sent few fixes where drivers were using APIs from freq_table.c but haven't selected CPU_FREQ_TABLE. Based on that, I just crossed checked all the places where it should be selected and where it shouldn't be. These are fixes around that.

I have applied these in my cpufreq-kconfig-fixes branch. Will send you a pull request separately once I get some Acks (will wait for few days).

I don't see a patch for big.LITTLE in either linux-next or this series. Did you miss that or has it just not made into linux-next yet?

Arnd

author maintainer
#22 lore raw
Quoted 6 lines · Arnd Bergmann
Quoted 5 lines · Viresh Kumar

Recently Arnd sent few fixes where drivers were using APIs from freq_table.c but haven't selected CPU_FREQ_TABLE. Based on that, I just crossed checked all the places where it should be selected and where it shouldn't be. These are fixes around that.

Quoted 7 lines
Quoted 2 lines

I have applied these in my cpufreq-kconfig-fixes branch. Will send you a pull request separately once I get some Acks (will wait for few days).

I don't see a patch for big.LITTLE in either linux-next or this series. Did you miss that or has it just not made into linux-next yet?

My ARM branch was pulled in by Rafael, 2 days back. Don't know why didn't you saw that.

#23 lore raw
Quoted 11 lines · Viresh Kumar
Quoted 9 lines · Arnd Bergmann
Quoted 7 lines · Viresh Kumar

Recently Arnd sent few fixes where drivers were using APIs from freq_table.c but haven't selected CPU_FREQ_TABLE. Based on that, I just crossed checked all the places where it should be selected and where it shouldn't be. These are fixes around that.

I have applied these in my cpufreq-kconfig-fixes branch. Will send you a pull request separately once I get some Acks (will wait for few days).

Quoted 7 lines
Quoted 4 lines

I don't see a patch for big.LITTLE in either linux-next or this series. Did you miss that or has it just not made into linux-next yet?

My ARM branch was pulled in by Rafael, 2 days back. Don't know why didn't you saw that.

Ah, it seems we haven't had a new linux-next since friday.

Arnd

#24 lore raw
Quoted 14 lines · Arnd Bergmann
Quoted 13 lines · Viresh Kumar
Quoted 11 lines · Arnd Bergmann
Quoted 7 lines · Viresh Kumar

Recently Arnd sent few fixes where drivers were using APIs from freq_table.c but haven't selected CPU_FREQ_TABLE. Based on that, I just crossed checked all the places where it should be selected and where it shouldn't be. These are fixes around that.

I have applied these in my cpufreq-kconfig-fixes branch. Will send you a pull request separately once I get some Acks (will wait for few days).

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

I don't see a patch for big.LITTLE in either linux-next or this series. Did you miss that or has it just not made into linux-next yet?

My ARM branch was pulled in by Rafael, 2 days back. Don't know why didn't you saw that.

Ah, it seems we haven't had a new linux-next since friday.

Yup, no linux-next this week.

Rafael

Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.