Skip to contentSkip to conversation

cpufreq: exynos: allow disabling cpufreq drivers

PATCH In review Arnd Bergmann 4 participants 9 messages Apr 19, 2013

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

PATCH 1/1 cpufreq: exynos: allow disabling cpufreq drivers

Commit 6e6aac7590 "ARM: EXYNOS: Migrate clock support to common clock framework" broke support for the exynos cpufreq drivers. While we're waiting for a fix for this, let's get back to a state where the kernel builds again with the cpufreq subsystem enabled but ARM_EXYNOS_CPUFREQ disabled. I assume that this was the intention behind this Kconfig symbol anyway.

Cc Sylwester Nawrocki <[email protected]>
Cc Tomasz Figa <[email protected]>
Cc Thomas Abraham <[email protected]>
Cc Kukjin Kim <[email protected]>
Cc Rafael J. Wysocki <[email protected]>

---
Rafael, I'm putting this patch into the arm-soc tree now to avoid a bug based on a patch that I got from Kukjin. If you have any objections, please let me know so I can revert it again.

Everyone else: Why does 6e6aac7590 have your "Tested-by" and "Signed-off-by" tags on it when it's obviously broken? Who is fixing this? Having no working exynos cpufreq support in 3.10 would be a serious regression.

drivers/cpufreq/Kconfig.arm +3 -0
index 030ddf6..2b8862d 100644
@@ -61,18 +61,21 @@ config ARM_EXYNOS_CPUFREQ
 
 config ARM_EXYNOS4210_CPUFREQ
 	def_bool CPU_EXYNOS4210
+	depends on ARM_EXYNOS_CPUFREQ
 	help
 	  This adds the CPUFreq driver for Samsung EXYNOS4210
 	  SoC (S5PV310 or S5PC210).
 
 config ARM_EXYNOS4X12_CPUFREQ
 	def_bool (SOC_EXYNOS4212 || SOC_EXYNOS4412)
+	depends on ARM_EXYNOS_CPUFREQ
 	help
 	  This adds the CPUFreq driver for Samsung EXYNOS4X12
 	  SoC (EXYNOS4212 or EXYNOS4412).
 
 config ARM_EXYNOS5250_CPUFREQ
 	def_bool SOC_EXYNOS5250
+	depends on ARM_EXYNOS_CPUFREQ
 	help
 	  This adds the CPUFreq driver for Samsung EXYNOS5250
 	  SoC.
#1 lore raw
Quoted 7 lines · Arnd Bergmann

Commit 6e6aac7590 "ARM: EXYNOS: Migrate clock support to common clock framework" broke support for the exynos cpufreq drivers. While we're waiting for a fix for this, let's get back to a state where the kernel builds again with the cpufreq subsystem enabled but ARM_EXYNOS_CPUFREQ disabled. I assume that this was the intention behind this Kconfig symbol anyway.

Quoted 7 lines
Cc Sylwester Nawrocki <[email protected]>
Cc Tomasz Figa <[email protected]>
Cc Thomas Abraham <[email protected]>
Cc Kukjin Kim <[email protected]>
Cc Rafael J. Wysocki <[email protected]>

Hmm, actually this conflicts heavily with the other Kconfig changes in the cpufreq tree. Any other idea how to resolve this?

Arnd

Quoted 9 lines

---
Rafael, I'm putting this patch into the arm-soc tree now to avoid a bug based on a patch that I got from Kukjin. If you have any objections, please let me know so I can revert it again.

Everyone else: Why does 6e6aac7590 have your "Tested-by" and "Signed-off-by" tags on it when it's obviously broken? Who is fixing this? Having no working exynos cpufreq support in 3.10 would be a serious regression.

#2 lore raw
In reply to Arnd Bergmann
Quoted 19 lines · Arnd Bergmann

Commit 6e6aac7590 "ARM: EXYNOS: Migrate clock support to common clock framework" broke support for the exynos cpufreq drivers. While we're waiting for a fix for this, let's get back to a state where the kernel builds again with the cpufreq subsystem enabled but ARM_EXYNOS_CPUFREQ disabled. I assume that this was the intention behind this Kconfig symbol anyway.

Cc Sylwester Nawrocki <[email protected]>
Cc Tomasz Figa <[email protected]>
Cc Thomas Abraham <[email protected]>
Cc Kukjin Kim <[email protected]>
Cc Rafael J. Wysocki <[email protected]>

---
Rafael, I'm putting this patch into the arm-soc tree now to avoid a bug based on a patch that I got from Kukjin. If you have any objections, please let me know so I can revert it again.

Quoted 4 lines

Everyone else: Why does 6e6aac7590 have your "Tested-by" and "Signed-off-by" tags on it when it's obviously broken? Who is fixing this? Having no working exynos cpufreq support in 3.10 would be a serious regression.

Not sure what happened here, but my and Tomasz's Tested-by were given for v5 of the patch series including 6e6aac7590, while it seems v6 has been applied. And the patch is not same in both series.

There could be some differences in the base tree I used when testing this [1] series, as it was hard to determine against what tag it was created exactly. Also I didn't test in on all platforms, only Exynos4412.

And the cpufreq really needs to get fixed, as it now modifies registers which belong to the clock driver...

[1] http://www.spinics.net/lists/arm-kernel/msg214149.html

Thanks,
Sylwester

#3 lore raw
Quoted 3 lines · Sylwester Nawrocki

Not sure what happened here, but my and Tomasz's Tested-by were given for v5 of the patch series including 6e6aac7590, while it seems v6 has been applied. And the patch is not same in both series.

I see.

Quoted 4 lines

There could be some differences in the base tree I used when testing this [1] series, as it was hard to determine against what tag it was created exactly. Also I didn't test in on all platforms, only Exynos4412.

Maybe you just didn't have CPUFREQ enabled? I also didn't notice this bug at first because it is turned off in the defconfigs.

It could also be working by chance on EXYNOS4, since the register definitions were not actually removed from the regs-clk.h header for those.

Arnd

#4 lore raw
Quoted 2 lines · Arnd Bergmann

Maybe you just didn't have CPUFREQ enabled? I also didn't notice this bug at first because it is turned off in the defconfigs.

I certainly had it enabled. Since I remember I needed to turn it off temporarily after someone has introduced an incorrect change to the clock tree definition and cpufreq was unexpectedly switching parents of one of the root clocks at run time, which was causing malfunction of the camera image processing chain.

Anyway this wasn't a clean mainline kernel, as there have been recently lot of stuff pending upstream needed to have complete system with dt support. I assume after 3.10 release the situation is going to be much better.

Quoted 3 lines

It could also be working by chance on EXYNOS4, since the register definitions were not actually removed from the regs-clk.h header for those.

That's most likely what happened.

Thanks,
Sylwester

#5 lore raw
Quoted 5 lines · Sylwester Nawrocki
Quoted 3 lines

It could also be working by chance on EXYNOS4, since the register definitions were not actually removed from the regs-clk.h header for those.

That's most likely what happened.

Ok. I think I see the bigger picture now. The EXYNOS5 cpufreq driver was actually just merged now, so I assume that by the time Thomas did the clock changes, the register definitions for EXYNOS5 were actually unused and he subsequently removed them from the kernel.

Since the driver now depends on them, I think the only way forward for 3.10 is to revert the change that removed the definitions and put them back in place.

We really should use the clock API from all the exynos cpufreq drivers, but it's too late for that change now in 3.10 and we will have to do it for 3.11 then.

This are not looking so good for exynos multiplatform support in 3.10 now, but if we get it in, that will mean we have to disable cpufreq when building multiplatform, but it can remain for the classic single-platform configurations.

Arnd

#6 lore raw
Quoted 7 lines · Arnd Bergmann
Quoted 5 lines · Sylwester Nawrocki
Quoted 3 lines

It could also be working by chance on EXYNOS4, since the register definitions were not actually removed from the regs-clk.h header for those.

That's most likely what happened.

Quoted 8 lines

Ok. I think I see the bigger picture now. The EXYNOS5 cpufreq driver was actually just merged now, so I assume that by the time Thomas did the clock changes, the register definitions for EXYNOS5 were actually unused and he subsequently removed them from the kernel.

Since the driver now depends on them, I think the only way forward for 3.10 is to revert the change that removed the definitions and put them back in place.

Yes, it sounds like a best thing to do. I was also considering that.

Quoted 2 lines

We really should use the clock API from all the exynos cpufreq drivers, but it's too late for that change now in 3.10 and we will have to do it for 3.11 then.

Yes, the changes required to make the cpufreq driver using the clocks API would be rather significant.

Quoted 3 lines

This are not looking so good for exynos multiplatform support in 3.10 now, but if we get it in, that will mean we have to disable cpufreq when building multiplatform, but it can remain for the classic single-platform configurations.

Alright, let's hope eventually we get at least a minimum booting system. ;)

Thanks,
Sylwester

#7 lore raw

PATCH 1/1 ARM: exynos: restore mach/regs-clock.h for exynos5

In reply to Sylwester Nawrocki

Commit 6e6aac75 "ARM: EXYNOS: Migrate clock support to common clock framework" from Thomas Abraham removed the Exynos5 specific register definitions as they were unused at the time, but the cpufreq driver actually still uses them.

Cc Sylwester Nawrocki <[email protected]>
Cc Tomasz Figa <[email protected]>
Cc Thomas Abraham <[email protected]>
Cc Kukjin Kim <[email protected]>

8<----

I'd apply this one on next/drivers to fix the build error, unless someone has concerns.

arch/arm/mach-exynos/include/mach/regs-clock.h +107 -0
index 20fbbdd..d36ad76 100644
@@ -256,6 +256,113 @@
 #define EXYNOS4_CLKDIV_CAM1_JPEG_SHIFT		(0)
 #define EXYNOS4_CLKDIV_CAM1_JPEG_MASK		(0xf << EXYNOS4_CLKDIV_CAM1_JPEG_SHIFT)
 
+/* For EXYNOS5250 */
+
+#define EXYNOS5_APLL_LOCK			EXYNOS_CLKREG(0x00000)
+#define EXYNOS5_APLL_CON0			EXYNOS_CLKREG(0x00100)
+#define EXYNOS5_CLKSRC_CPU			EXYNOS_CLKREG(0x00200)
+#define EXYNOS5_CLKMUX_STATCPU			EXYNOS_CLKREG(0x00400)
+#define EXYNOS5_CLKDIV_CPU0			EXYNOS_CLKREG(0x00500)
+#define EXYNOS5_CLKDIV_CPU1			EXYNOS_CLKREG(0x00504)
+#define EXYNOS5_CLKDIV_STATCPU0			EXYNOS_CLKREG(0x00600)
+#define EXYNOS5_CLKDIV_STATCPU1			EXYNOS_CLKREG(0x00604)
+
+#define EXYNOS5_PWR_CTRL1			EXYNOS_CLKREG(0x01020)
+#define EXYNOS5_PWR_CTRL2			EXYNOS_CLKREG(0x01024)
+
+#define EXYNOS5_MPLL_CON0			EXYNOS_CLKREG(0x04100)
+#define EXYNOS5_CLKSRC_CORE1			EXYNOS_CLKREG(0x04204)
+
+#define EXYNOS5_CLKGATE_IP_CORE			EXYNOS_CLKREG(0x04900)
+
+#define EXYNOS5_CLKDIV_ACP			EXYNOS_CLKREG(0x08500)
+
+#define EXYNOS5_EPLL_CON0			EXYNOS_CLKREG(0x10130)
+#define EXYNOS5_EPLL_CON1			EXYNOS_CLKREG(0x10134)
+#define EXYNOS5_EPLL_CON2			EXYNOS_CLKREG(0x10138)
+#define EXYNOS5_VPLL_CON0			EXYNOS_CLKREG(0x10140)
+#define EXYNOS5_VPLL_CON1			EXYNOS_CLKREG(0x10144)
+#define EXYNOS5_VPLL_CON2			EXYNOS_CLKREG(0x10148)
+#define EXYNOS5_CPLL_CON0			EXYNOS_CLKREG(0x10120)
+
+#define EXYNOS5_CLKSRC_TOP0			EXYNOS_CLKREG(0x10210)
+#define EXYNOS5_CLKSRC_TOP1			EXYNOS_CLKREG(0x10214)
+#define EXYNOS5_CLKSRC_TOP2			EXYNOS_CLKREG(0x10218)
+#define EXYNOS5_CLKSRC_TOP3			EXYNOS_CLKREG(0x1021C)
+#define EXYNOS5_CLKSRC_GSCL			EXYNOS_CLKREG(0x10220)
+#define EXYNOS5_CLKSRC_DISP1_0			EXYNOS_CLKREG(0x1022C)
+#define EXYNOS5_CLKSRC_MAUDIO			EXYNOS_CLKREG(0x10240)
+#define EXYNOS5_CLKSRC_FSYS			EXYNOS_CLKREG(0x10244)
+#define EXYNOS5_CLKSRC_PERIC0			EXYNOS_CLKREG(0x10250)
+#define EXYNOS5_CLKSRC_PERIC1			EXYNOS_CLKREG(0x10254)
+#define EXYNOS5_SCLK_SRC_ISP			EXYNOS_CLKREG(0x10270)
+
+#define EXYNOS5_CLKSRC_MASK_TOP			EXYNOS_CLKREG(0x10310)
+#define EXYNOS5_CLKSRC_MASK_GSCL		EXYNOS_CLKREG(0x10320)
+#define EXYNOS5_CLKSRC_MASK_DISP1_0		EXYNOS_CLKREG(0x1032C)
+#define EXYNOS5_CLKSRC_MASK_MAUDIO		EXYNOS_CLKREG(0x10334)
+#define EXYNOS5_CLKSRC_MASK_FSYS		EXYNOS_CLKREG(0x10340)
+#define EXYNOS5_CLKSRC_MASK_PERIC0		EXYNOS_CLKREG(0x10350)
+#define EXYNOS5_CLKSRC_MASK_PERIC1		EXYNOS_CLKREG(0x10354)
+
+#define EXYNOS5_CLKDIV_TOP0			EXYNOS_CLKREG(0x10510)
+#define EXYNOS5_CLKDIV_TOP1			EXYNOS_CLKREG(0x10514)
+#define EXYNOS5_CLKDIV_GSCL			EXYNOS_CLKREG(0x10520)
+#define EXYNOS5_CLKDIV_DISP1_0			EXYNOS_CLKREG(0x1052C)
+#define EXYNOS5_CLKDIV_GEN			EXYNOS_CLKREG(0x1053C)
+#define EXYNOS5_CLKDIV_MAUDIO			EXYNOS_CLKREG(0x10544)
+#define EXYNOS5_CLKDIV_FSYS0			EXYNOS_CLKREG(0x10548)
+#define EXYNOS5_CLKDIV_FSYS1			EXYNOS_CLKREG(0x1054C)
+#define EXYNOS5_CLKDIV_FSYS2			EXYNOS_CLKREG(0x10550)
+#define EXYNOS5_CLKDIV_FSYS3			EXYNOS_CLKREG(0x10554)
+#define EXYNOS5_CLKDIV_PERIC0			EXYNOS_CLKREG(0x10558)
+#define EXYNOS5_CLKDIV_PERIC1			EXYNOS_CLKREG(0x1055C)
+#define EXYNOS5_CLKDIV_PERIC2			EXYNOS_CLKREG(0x10560)
+#define EXYNOS5_CLKDIV_PERIC3			EXYNOS_CLKREG(0x10564)
+#define EXYNOS5_CLKDIV_PERIC4			EXYNOS_CLKREG(0x10568)
+#define EXYNOS5_CLKDIV_PERIC5			EXYNOS_CLKREG(0x1056C)
+#define EXYNOS5_SCLK_DIV_ISP			EXYNOS_CLKREG(0x10580)
+
+#define EXYNOS5_CLKGATE_IP_ACP			EXYNOS_CLKREG(0x08800)
+#define EXYNOS5_CLKGATE_IP_ISP0			EXYNOS_CLKREG(0x0C800)
+#define EXYNOS5_CLKGATE_IP_ISP1			EXYNOS_CLKREG(0x0C804)
+#define EXYNOS5_CLKGATE_IP_GSCL			EXYNOS_CLKREG(0x10920)
+#define EXYNOS5_CLKGATE_IP_DISP1		EXYNOS_CLKREG(0x10928)
+#define EXYNOS5_CLKGATE_IP_MFC			EXYNOS_CLKREG(0x1092C)
+#define EXYNOS5_CLKGATE_IP_G3D			EXYNOS_CLKREG(0x10930)
+#define EXYNOS5_CLKGATE_IP_GEN			EXYNOS_CLKREG(0x10934)
+#define EXYNOS5_CLKGATE_IP_FSYS			EXYNOS_CLKREG(0x10944)
+#define EXYNOS5_CLKGATE_IP_GPS			EXYNOS_CLKREG(0x1094C)
+#define EXYNOS5_CLKGATE_IP_PERIC		EXYNOS_CLKREG(0x10950)
+#define EXYNOS5_CLKGATE_IP_PERIS		EXYNOS_CLKREG(0x10960)
+#define EXYNOS5_CLKGATE_BLOCK			EXYNOS_CLKREG(0x10980)
+
+#define EXYNOS5_BPLL_CON0			EXYNOS_CLKREG(0x20110)
+#define EXYNOS5_CLKSRC_CDREX			EXYNOS_CLKREG(0x20200)
+#define EXYNOS5_CLKDIV_CDREX			EXYNOS_CLKREG(0x20500)
+
+#define EXYNOS5_PLL_DIV2_SEL			EXYNOS_CLKREG(0x20A24)
+
+#define EXYNOS5_EPLL_LOCK			EXYNOS_CLKREG(0x10030)
+
+#define EXYNOS5_EPLLCON0_LOCKED_SHIFT		(29)
+
+#define PWR_CTRL1_CORE2_DOWN_RATIO		(7 << 28)
+#define PWR_CTRL1_CORE1_DOWN_RATIO		(7 << 16)
+#define PWR_CTRL1_DIV2_DOWN_EN			(1 << 9)
+#define PWR_CTRL1_DIV1_DOWN_EN			(1 << 8)
+#define PWR_CTRL1_USE_CORE1_WFE			(1 << 5)
+#define PWR_CTRL1_USE_CORE0_WFE			(1 << 4)
+#define PWR_CTRL1_USE_CORE1_WFI			(1 << 1)
+#define PWR_CTRL1_USE_CORE0_WFI			(1 << 0)
+
+#define PWR_CTRL2_DIV2_UP_EN			(1 << 25)
+#define PWR_CTRL2_DIV1_UP_EN			(1 << 24)
+#define PWR_CTRL2_DUR_STANDBY2_VAL		(1 << 16)
+#define PWR_CTRL2_DUR_STANDBY1_VAL		(1 << 8)
+#define PWR_CTRL2_CORE2_UP_RATIO		(1 << 4)
+#define PWR_CTRL2_CORE1_UP_RATIO		(1 << 0)
+
 /* Compatibility defines and inclusion */
 
 #include <mach/regs-pmu.h>
Acked-by on v1 1/1
#8 lore raw

Re: [PATCH] ARM: exynos: restore mach/regs-clock.h for exynos5

Quoted 10 lines · Arnd Bergmann

Commit 6e6aac75 "ARM: EXYNOS: Migrate clock support to common clock framework" from Thomas Abraham removed the Exynos5 specific register definitions as they were unused at the time, but the cpufreq driver actually still uses them.

Cc Sylwester Nawrocki <[email protected]>
Cc Tomasz Figa <[email protected]>
Cc Thomas Abraham <[email protected]>
Cc Kukjin Kim <[email protected]>
Quoted 4 lines

8<----

I'd apply this one on next/drivers to fix the build error, unless someone has concerns.