]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
cpufreq: qcom-cpufreq-hw: Revert adding cpufreq qos
authorBjorn Andersson <quic_bjorande@quicinc.com>
Thu, 23 Mar 2023 22:33:43 +0000 (15:33 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 7 Jul 2023 10:16:50 +0000 (12:16 +0200)
commit1e75faba816a5e4922f7b82acb5b6eccd636836d
tree842c04c78a201f1884c6d4074d1ab75c4dfb6480
parentf0e487585d0297995061b25bece27438d3a99690
cpufreq: qcom-cpufreq-hw: Revert adding cpufreq qos

BugLink: https://bugs.launchpad.net/bugs/2025067
[ Upstream commit e2b47e585931a988c856fd4ba31e1296f749aee3 ]

The OSM/EPSS hardware controls the frequency of each CPU cluster based
on requests from the OS and various throttling events in the system.
While throttling is in effect the related dcvs interrupt will be kept
high. The purpose of the code handling this interrupt is to
continuously report the thermal pressure based on the throttled
frequency.

The reasoning for adding QoS control to this mechanism is not entirely
clear, but the introduction of commit 'c4c0efb06f17 ("cpufreq:
qcom-cpufreq-hw: Add cpufreq qos for LMh")' causes the
scaling_max_frequncy to be set to the throttled frequency. On the next
iteration of polling, the throttled frequency is above or equal to the
newly requested frequency, so the polling is stopped.

With cpufreq limiting the max frequency, the hardware no longer report a
throttling state and no further updates to thermal pressure or qos
state are made.

The result of this is that scaling_max_frequency can only go down, and
the system becomes slower and slower every time a thermal throttling
event is reported by the hardware.

Even if the logic could be improved, there is no reason for software to
limit the max freqency in response to the hardware limiting the max
frequency. At best software will follow the reported hardware state, but
typically it will cause slower backoff of the throttling.

This reverts commit c4c0efb06f17fa4a37ad99e7752b18a5405c76dc.

Fixes: c4c0efb06f17 ("cpufreq: qcom-cpufreq-hw: Add cpufreq qos for LMh")
Reported-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/cpufreq/qcom-cpufreq-hw.c