From b1ff9aa85bf218c24f59dd6619849664e097fb2f Mon Sep 17 00:00:00 2001 From: Youngtae Lee Date: Mon, 23 Apr 2018 16:29:22 +0900 Subject: [PATCH] samsung: cpupm: Disable idle during hotplug in-out Change-Id: I4eaff38545bf584b3867da9078b16bebaf42499d Signed-off-by: Youngtae Lee --- drivers/soc/samsung/exynos-cpupm.c | 20 ++++++++++++++++++++ include/linux/cpuhotplug.h | 1 + 2 files changed, 21 insertions(+) diff --git a/drivers/soc/samsung/exynos-cpupm.c b/drivers/soc/samsung/exynos-cpupm.c index 4c7e34024251..9588f912058a 100644 --- a/drivers/soc/samsung/exynos-cpupm.c +++ b/drivers/soc/samsung/exynos-cpupm.c @@ -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); diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h index b31a421f1be2..9e5782073ad7 100644 --- a/include/linux/cpuhotplug.h +++ b/include/linux/cpuhotplug.h @@ -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, }; -- 2.20.1