From 2c33504bfe06e4bd98967704bd2c9cd97d8cfabf Mon Sep 17 00:00:00 2001 From: Youngtae Lee Date: Wed, 9 May 2018 20:36:07 +0900 Subject: [PATCH] samsung: cpupm: Change cluster disable condition 1. reference cluster_mask instead of coregroup_mask because coregroup_mask no more couldn't show h/w clsuter information. 2. To support fast_hotplug, add function to confirm last cpu in the cluster. If many cpus power off at the sametime, cpu_online_mask couldn't guarantee last cpu of cluster. Change-Id: Ic08fbdfa6ab981cf48d6c3f5e294f10d1f1a907a Signed-off-by: Youngtae Lee --- drivers/soc/samsung/exynos-cpupm.c | 6 +++--- include/soc/samsung/exynos-cpupm.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/soc/samsung/exynos-cpupm.c b/drivers/soc/samsung/exynos-cpupm.c index c76c27d2f12a..561e45c0f622 100644 --- a/drivers/soc/samsung/exynos-cpupm.c +++ b/drivers/soc/samsung/exynos-cpupm.c @@ -310,7 +310,7 @@ static int cpuhp_cpupm_online(unsigned int cpu) { struct cpumask mask; - cpumask_and(&mask, cpu_coregroup_mask(cpu), cpu_online_mask); + cpumask_and(&mask, cpu_cluster_mask(cpu), cpu_online_mask); if (cpumask_weight(&mask) == 0) { cluster_enable(cpu); /* clear cpus of this cluster from cpuhp_last_cpu */ @@ -329,8 +329,8 @@ static int cpuhp_cpupm_offline(unsigned int cpu) cpu_disable(cpu); - cpumask_and(&mask, cpu_coregroup_mask(cpu), cpu_online_mask); - if (cpumask_weight(&mask) == 0) { + cpumask_and(&mask, cpu_cluster_mask(cpu), cpu_online_mask); + if ((cpumask_weight(&mask) == 0) && cpuhp_last_fastcpu(cpu)) { /* set cpu cpuhp_last_cpu */ cpumask_set_cpu(cpu, &cpuhp_last_cpu); cluster_disable(cpu); diff --git a/include/soc/samsung/exynos-cpupm.h b/include/soc/samsung/exynos-cpupm.h index 06292fc19ee1..34bb02f3b80a 100644 --- a/include/soc/samsung/exynos-cpupm.h +++ b/include/soc/samsung/exynos-cpupm.h @@ -20,6 +20,7 @@ enum { extern void disable_power_mode(int cpu, int type); extern void enable_power_mode(int cpu, int type); extern bool exynos_cpuhp_last_cpu(unsigned int cpu); +extern bool cpuhp_last_fastcpu(unsigned int cpu); #ifdef CONFIG_CPU_IDLE void exynos_update_ip_idle_status(int index, int idle); -- 2.20.1