cpufreq: qcom-cpufreq-hw: Update offline CPUs per-cpu thermal pressure
authorLukasz Luba <lukasz.luba@arm.com>
Tue, 9 Nov 2021 19:57:12 +0000 (19:57 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:03:15 +0000 (11:03 +0100)
commit929205dc3a0f18c1f9178db245ffb6bdbf235fbb
tree2782f0a65f67a3a07c37b3983251198c1ae9e888
parent5d39cd2059ba8a554538b734c359a9b51ca9897b
cpufreq: qcom-cpufreq-hw: Update offline CPUs per-cpu thermal pressure

[ Upstream commit 93d9e6f93e1586fcc97498c764be2e8c8401f4bd ]

The thermal pressure signal gives information to the scheduler about
reduced CPU capacity due to thermal. It is based on a value stored in
a per-cpu 'thermal_pressure' variable. The online CPUs will get the
new value there, while the offline won't. Unfortunately, when the CPU
is back online, the value read from per-cpu variable might be wrong
(stale data).  This might affect the scheduler decisions, since it
sees the CPU capacity differently than what is actually available.

Fix it by making sure that all online+offline CPUs would get the
proper value in their per-cpu variable when there is throttling
or throttling is removed.

Fixes: 275157b367f479 ("cpufreq: qcom-cpufreq-hw: Add dcvs interrupt support")
Reviewed-by: Thara Gopinath <thara.gopinath@linaro.org>
Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/cpufreq/qcom-cpufreq-hw.c