Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 317878b5 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

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

parents abf5f21e 158fa23c
Loading
Loading
Loading
Loading
+25 −3
Original line number Diff line number Diff line
@@ -3407,7 +3407,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));
@@ -3418,11 +3419,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);