samsung: cpupm: Disable idle during hotplug in-out
authorYoungtae Lee <yt0729.lee@samsung.com>
Mon, 23 Apr 2018 07:29:22 +0000 (16:29 +0900)
committerlakkyung.jung <lakkyung.jung@samsung.com>
Mon, 23 Jul 2018 05:59:03 +0000 (14:59 +0900)
Change-Id: I4eaff38545bf584b3867da9078b16bebaf42499d
Signed-off-by: Youngtae Lee <yt0729.lee@samsung.com>
drivers/soc/samsung/exynos-cpupm.c
include/linux/cpuhotplug.h

index 4c7e34024251acde293ccdab71369ae7034f664b..9588f912058a8154ec025290cf7123de2c5b1f01 100644 (file)
@@ -914,8 +914,28 @@ static int __init exynos_cpupm_init(void)
 arch_initcall(exynos_cpupm_init);
 #endif
 
+static int cpuhp_cpupm_enable_idle(unsigned int cpu)
+{
+       struct cpuidle_device *dev = per_cpu(cpuidle_devices, cpu);
+       cpuidle_enable_device(dev);
+
+       return 0;
+}
+static int cpuhp_cpupm_disable_idle(unsigned int cpu)
+{
+       struct cpuidle_device *dev = per_cpu(cpuidle_devices, cpu);
+       cpuidle_disable_device(dev);
+
+       return 0;
+}
+
 static int __init exynos_cpupm_early_init(void)
 {
+       cpuhp_setup_state(CPUHP_AP_EXYNOS_IDLE_CTRL,
+                               "AP_EXYNOS_IDLE_CTROL",
+                               cpuhp_cpupm_enable_idle,
+                               cpuhp_cpupm_disable_idle);
+
        cpuhp_setup_state(CPUHP_AP_EXYNOS_CPU_UP_POWER_CONTROL,
                                "AP_EXYNOS_CPU_UP_POWER_CONTROL",
                                cpuhp_cpupm_online, NULL);
index b31a421f1be2a1e82737307cd27b554c5d409eb4..9e5782073ad7f65f0e515eca168854c65bb8f465 100644 (file)
@@ -170,6 +170,7 @@ enum cpuhp_state {
        CPUHP_AP_EXYNOS_ACME,
        CPUHP_AP_X86_HPET_ONLINE,
        CPUHP_AP_X86_KVM_CLK_ONLINE,
+       CPUHP_AP_EXYNOS_IDLE_CTRL,
        CPUHP_AP_ACTIVE,
        CPUHP_ONLINE,
 };