Merge "msm: thermal: Re-evaluate hotplug for unexpected cpu online"

This commit is contained in:
Linux Build Service Account 2016-07-05 06:41:44 -07:00 committed by Gerrit - the friendly Code Review server
commit bf9e61ab19

View file

@ -3380,7 +3380,8 @@ static int __ref msm_thermal_cpu_callback(struct notifier_block *nfb,
{
uint32_t cpu = (uintptr_t)hcpu;
if (action == CPU_UP_PREPARE || action == CPU_UP_PREPARE_FROZEN) {
switch (action & ~CPU_TASKS_FROZEN) {
case CPU_UP_PREPARE:
if (!cpumask_test_and_set_cpu(cpu, cpus_previously_online))
pr_debug("Total prev cores online tracked %u\n",
cpumask_weight(cpus_previously_online));
@ -3391,11 +3392,32 @@ static int __ref msm_thermal_cpu_callback(struct notifier_block *nfb,
cpu);
return NOTIFY_BAD;
}
} else if (action == CPU_DOWN_PREPARE ||
action == CPU_DOWN_PREPARE_FROZEN) {
break;
case CPU_DOWN_PREPARE:
if (!cpumask_test_and_set_cpu(cpu, cpus_previously_online))
pr_debug("Total prev cores online tracked %u\n",
cpumask_weight(cpus_previously_online));
break;
case CPU_ONLINE:
if (core_control_enabled &&
(msm_thermal_info.core_control_mask & BIT(cpu)) &&
(cpus_offlined & BIT(cpu))) {
if (hotplug_task) {
pr_debug("Re-evaluate and hotplug CPU%d\n",
cpu);
complete(&hotplug_notify_complete);
} else {
/*
* This will be auto-corrected next time
* do_core_control() is called
*/
pr_err("CPU%d online, after thermal veto\n",
cpu);
}
}
break;
default:
break;
}
pr_debug("voting for CPU%d to be online\n", cpu);