/******************************************************************************
* CPU HOTPLUG *
******************************************************************************/
+/* cpumask for indecating last cpu of a cluster */
+struct cpumask cpuhp_last_cpu;
+
+bool exynos_cpuhp_last_cpu(unsigned int cpu)
+{
+ return cpumask_test_cpu(cpu, &cpuhp_last_cpu);
+}
+
static int cpuhp_cpupm_online(unsigned int cpu)
{
struct cpumask mask;
cpumask_and(&mask, cpu_coregroup_mask(cpu), cpu_online_mask);
- if (cpumask_weight(&mask) == 0)
+ if (cpumask_weight(&mask) == 0) {
cluster_enable(cpu);
+ /* clear cpus of this cluster from cpuhp_last_cpu */
+ cpumask_andnot(&cpuhp_last_cpu,
+ &cpuhp_last_cpu, cpu_coregroup_mask(cpu));
+ }
cpu_enable(cpu);
cpu_disable(cpu);
cpumask_and(&mask, cpu_coregroup_mask(cpu), cpu_online_mask);
- if (cpumask_weight(&mask) == 0)
+ if (cpumask_weight(&mask) == 0) {
+ /* set cpu cpuhp_last_cpu */
+ cpumask_set_cpu(cpu, &cpuhp_last_cpu);
cluster_disable(cpu);
+ }
return 0;
}
POWERMODE_TYPE_SYSTEM,
};
+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);
+
#ifdef CONFIG_CPU_IDLE
void exynos_update_ip_idle_status(int index, int idle);
int exynos_get_idle_ip_index(const char *name);