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

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

Merge "sched: Update cur_freq for offline CPUs in notifier callback"

parents f0de5057 13e853e9
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -2462,18 +2462,24 @@ static int cpufreq_notifier_trans(struct notifier_block *nb,
{
	struct cpufreq_freqs *freq = (struct cpufreq_freqs *)data;
	unsigned int cpu = freq->cpu, new_freq = freq->new;
	struct rq *rq = cpu_rq(cpu);
	unsigned long flags;
	int i;

	if (val != CPUFREQ_POSTCHANGE)
		return 0;

	BUG_ON(!new_freq);

	if (cpu_rq(cpu)->cur_freq == new_freq)
		return 0;

	for_each_cpu(i, &cpu_rq(cpu)->freq_domain_cpumask) {
		struct rq *rq = cpu_rq(i);
		raw_spin_lock_irqsave(&rq->lock, flags);
		update_task_ravg(rq->curr, rq, TASK_UPDATE, sched_clock(), 0);
	cpu_rq(cpu)->cur_freq = new_freq;
		rq->cur_freq = new_freq;
		raw_spin_unlock_irqrestore(&rq->lock, flags);
	}

	return 0;
}