samsung: cpupm: Change cluster disable condition
authorYoungtae Lee <yt0729.lee@samsung.com>
Wed, 9 May 2018 11:36:07 +0000 (20:36 +0900)
committerlakkyung.jung <lakkyung.jung@samsung.com>
Mon, 23 Jul 2018 05:59:15 +0000 (14:59 +0900)
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 <yt0729.lee@samsung.com>
drivers/soc/samsung/exynos-cpupm.c
include/soc/samsung/exynos-cpupm.h

index c76c27d2f12a1263d54760a26646231d4214200d..561e45c0f622f032ffd7b3e8e7ca03c15fd38790 100644 (file)
@@ -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);
index 06292fc19ee19029f0082f8c8c9211a11d2ee0b8..34bb02f3b80a046924a6776643b665226ce620dc 100644 (file)
@@ -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);