LOCAL / clocksource: arm_arch_timer: Don't register clockevent for Per-CPU
authorChanwoo Choi <cw00.choi@samsung.com>
Tue, 19 Sep 2017 09:12:52 +0000 (18:12 +0900)
committerLukasz Luba <l.luba@partner.samsung.com>
Wed, 26 Sep 2018 10:34:26 +0000 (12:34 +0200)
The arm64 architecture enabled the arm_arch_timer always
even if arm_arch_timer is not stable. When Exynos5433 uses the
arm_arch_timer, it fails to enable/disble the secondary cpu.

To fix the hotplug issue of secondary cpu, if Exynos's MCT timer
is enabled, arm_arch_timer doesn't register the clockevent for Per-CPU.

Change-Id: Ia41f9c13889c4637391168dbc828a0bdbc7cdfff
Reported-by: Wook Song <wook16.song@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
drivers/clocksource/arm_arch_timer.c

index d142109157d5b7d7517b5a44de85ec073247a4e0..e5b0ae20add6e8db29612731b7be01d1082deec4 100644 (file)
@@ -79,6 +79,7 @@ static bool vdso_default = true;
 
 static cpumask_t evtstrm_available = CPU_MASK_NONE;
 static bool evtstrm_enable = IS_ENABLED(CONFIG_ARM_ARCH_TIMER_EVTSTREAM);
+static bool mct_enable = IS_ENABLED(CONFIG_CLKSRC_EXYNOS_MCT);
 
 static int __init early_evtstrm_cfg(char *buf)
 {
@@ -1063,12 +1064,25 @@ static int __init arch_timer_register(void)
        if (err)
                goto out_unreg_notify;
 
-       /* Register and immediately configure the timer on the boot CPU */
-       err = cpuhp_setup_state(CPUHP_AP_ARM_ARCH_TIMER_STARTING,
-                               "clockevents/arm/arch_timer:starting",
-                               arch_timer_starting_cpu, arch_timer_dying_cpu);
-       if (err)
-               goto out_unreg_cpupm;
+       if (mct_enable) {
+               /*
+                * FIXME: The arm64 architecture enables the arm_arch_timer always
+                * even if arm_arch_timer is not stable. When Exynos5433 uses the
+                * arm_arch_timer, it fails to enable/disble the secondary cpu.
+                * To fix the hotplug issue of secondary cpu, if Exynos's MCT timer
+                * is enabled, arm_arch_timer doesn't register the clockevent
+                * for Per-CPU.
+                */
+               return 0;
+       } else {
+               /* Register and immediately configure the timer on the boot CPU */
+               err = cpuhp_setup_state(CPUHP_AP_ARM_ARCH_TIMER_STARTING,
+                                       "clockevents/arm/arch_timer:starting",
+                                       arch_timer_starting_cpu, arch_timer_dying_cpu);
+               if (err)
+                       goto out_unreg_cpupm;
+       }
+
        return 0;
 
 out_unreg_cpupm: