mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-01 02:21:16 +00:00
Merge "msm: thermal: Re-evaluate hotplug for unexpected cpu online"
This commit is contained in:
commit
bf9e61ab19
1 changed files with 25 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue