From: Youngtae Lee Date: Fri, 15 Jun 2018 10:11:52 +0000 (+0900) Subject: samsung: emc: Fix emc_enabled/disabled bug X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9ed8cd6ca00a32a82a0eb4ecff7eba10758baf0b;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git samsung: emc: Fix emc_enabled/disabled bug Change-Id: Ie6fd186d2932367b1cfc5f2305d6248cc67eebe7 Signed-off-by: Youngtae Lee --- diff --git a/drivers/soc/samsung/exynos-emc.c b/drivers/soc/samsung/exynos-emc.c index 19ba035a96aa..89aed239a942 100644 --- a/drivers/soc/samsung/exynos-emc.c +++ b/drivers/soc/samsung/exynos-emc.c @@ -960,32 +960,37 @@ static ssize_t store_enabled(struct kobject *kobj, return ret ? ret : count; } -static void __emc_set_enable(void) +static void __emc_set_disable(void) { struct emc_mode *base_mode = emc_get_base_mode(); - exynos_cpuhp_request("EMC", base_mode->cpus, emc.ctrl_type); + spin_lock(&emc_lock); + emc.enabled = false; + emc.user_mode = 0; emc.cur_mode = emc.req_mode = base_mode; emc.event = 0; + smp_wmb(); + spin_unlock(&emc_lock); - if (emc.task) - kthread_unpark(emc.task); + exynos_cpuhp_request("EMC", + base_mode->cpus, emc.ctrl_type); - pr_info("EMC: Start hotplug governor\n"); + pr_info("EMC: Stop hotplug governor\n"); } -static void __emc_set_disable(void) +static void __emc_set_enable(void) { struct emc_mode *base_mode = emc_get_base_mode(); - if (emc.task) - kthread_park(emc.task); - - exynos_cpuhp_request("EMC", base_mode->cpus, emc.ctrl_type); + spin_lock(&emc_lock); + emc.user_mode = 0; emc.cur_mode = emc.req_mode = base_mode; emc.event = 0; + emc.enabled = true; + smp_wmb(); + spin_unlock(&emc_lock); - pr_info("EMC: Stop hotplug governor\n"); + pr_info("EMC: Start hotplug governor\n"); } static int emc_set_enable(bool enable) @@ -1011,8 +1016,6 @@ static int emc_set_enable(bool enable) goto skip; } - emc.enabled = enable; - smp_wmb(); spin_unlock(&emc_lock); if (start)