Skip to contentSkip to conversation

ARM: Drop fixed 200 Hz timer requirement from Exynos platforms

PATCH Superseded Krzysztof Kozlowski 3 participants 4 messages Nov 14, 2016 – Nov 18, 2016

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Krzysztof Kozlowski

author maintainer
#0 lore raw

PATCH 1/1 ARM: Drop fixed 200 Hz timer requirement from Exynos platforms

All Samsung platforms, including the Exynos, are selecting HZ_FIXED with 200 Hz. Unfortunately in case of multiplatform image this affects also other platforms when Exynos is selected.

This looks like an very old legacy code, dating back to initial upstreaming of S3C24xx. Probably it was required for s3c24xx timer driver, which was removed in commit ad38bdd15d5b ("ARM: SAMSUNG: Remove unused plat-samsung/time.c").

Since then, this fixed 200 Hz spread everywhere, including out-of-tree Samsung kernels (SoC vendor's and Tizen's). I believe this choice was rather an effect of coincidence instead of conscious choice. In fact Exynos can work with different timers.

Few perf mem and sched tests on Odroid XU3 board (Exynos5422, 4x Cortex A7, 4x Cortex A15) show no regressions when switching from 200 Hz to other values.

---

Testing on other Exynos platforms would be appreciated.

---
 arch/arm/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/Kconfig +1 -1
index b5d529fdffab..0d10e45f9175 100644
@@ -1497,7 +1497,7 @@ source kernel/Kconfig.preempt
 config HZ_FIXED
 	int
 	default 200 if ARCH_EBSA110 || ARCH_S3C24XX || \
-		ARCH_S5PV210 || ARCH_EXYNOS4
+		ARCH_S5PV210
 	default 128 if SOC_AT91RM9200
 	default 0
 
Signature · 1 line
2.7.4
#1 lore raw

arch/arm/Kconfig source kernel/Kconfig.preempt · line 1502

Quoted 8 lines · CET Krzysztof Kozlowski
arch/arm/Kconfig +1 -1
@@ -1497,7 +1497,7 @@ source kernel/Kconfig.preempt
 config HZ_FIXED
        int
        default 200 if ARCH_EBSA110 || ARCH_S3C24XX || \
-               ARCH_S5PV210 || ARCH_EXYNOS4
+               ARCH_S5PV210
        default 128 if SOC_AT91RM9200
        default 0

After further research, I've concluded that we should also drop the settings for ARCH_S5PV210 and ARCH_S3C24XX here.

ARCH_S5PV210 behaves exactly like EXYNOS here, it has 32-bit timers so there won't be any overflow with 100Hz.

For ARCH_S3C24XX, it the requirement was that HZ_100 could not be used with the old arch/arm/plat-samsung/time.c code that would overflow its 16-bit counter.
However, the new drivers/clocksource/samsung_pwm_timer.c configures the clock divider to '50' instead of '6', so there is no longer a 16-bit overflow before the 100Hz tick, it now overflows every 3.7ms for the typical 12MHz clock.

Arnd

author maintainer
#2 lore raw
Quoted 16 lines · Arnd Bergmann

arch/arm/Kconfig source kernel/Kconfig.preempt · line 1502

Quoted 8 lines · CET Krzysztof Kozlowski
arch/arm/Kconfig +1 -1
@@ -1497,7 +1497,7 @@ source kernel/Kconfig.preempt
 config HZ_FIXED
        int
        default 200 if ARCH_EBSA110 || ARCH_S3C24XX || \
-               ARCH_S5PV210 || ARCH_EXYNOS4
+               ARCH_S5PV210
        default 128 if SOC_AT91RM9200
        default 0

After further research, I've concluded that we should also drop the settings for ARCH_S5PV210 and ARCH_S3C24XX here.

ARCH_S5PV210 behaves exactly like EXYNOS here, it has 32-bit timers so there won't be any overflow with 100Hz.

Quoted 7 lines

For ARCH_S3C24XX, it the requirement was that HZ_100 could not be used with the old arch/arm/plat-samsung/time.c code that would overflow its 16-bit counter.
However, the new drivers/clocksource/samsung_pwm_timer.c configures the clock divider to '50' instead of '6', so there is no longer a 16-bit overflow before the 100Hz tick, it now overflows every 3.7ms for the typical 12MHz clock.

I can send an updated version however testing would be nice... I know Sylwester has a S3C6410 platform running, maybe S3C24xx as well.

Best regards,
Krzysztof

Tested-by on v1 1/1
#3 lore raw
In reply to Krzysztof Kozlowski

Hello Krzysztof,

Quoted 18 lines · Krzysztof Kozlowski

All Samsung platforms, including the Exynos, are selecting HZ_FIXED with 200 Hz. Unfortunately in case of multiplatform image this affects also other platforms when Exynos is selected.

This looks like an very old legacy code, dating back to initial upstreaming of S3C24xx. Probably it was required for s3c24xx timer driver, which was removed in commit ad38bdd15d5b ("ARM: SAMSUNG: Remove unused plat-samsung/time.c").

Since then, this fixed 200 Hz spread everywhere, including out-of-tree Samsung kernels (SoC vendor's and Tizen's). I believe this choice was rather an effect of coincidence instead of conscious choice. In fact Exynos can work with different timers.

Few perf mem and sched tests on Odroid XU3 board (Exynos5422, 4x Cortex A7, 4x Cortex A15) show no regressions when switching from 200 Hz to other values.

Quoted 7 lines

---

Testing on other Exynos platforms would be appreciated.

I tested this patch on an Exynos5800 Peach Pi Chromebook with different HZ values (100/200/250/300/500/1000), and found no issues.

Best regards,

Signature · 3 lines
Javier Martinez Canillas
Open Source Group
Samsung Research America