Skip to content

Commit e2b47e5

Browse files
quic-bjorandevireshk
authored andcommitted
cpufreq: qcom-cpufreq-hw: Revert adding cpufreq qos
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 c4c0efb. Fixes: c4c0efb ("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>
1 parent e690032 commit e2b47e5

1 file changed

Lines changed: 0 additions & 14 deletions

File tree

drivers/cpufreq/qcom-cpufreq-hw.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include <linux/of_address.h>
1515
#include <linux/of_platform.h>
1616
#include <linux/pm_opp.h>
17-
#include <linux/pm_qos.h>
1817
#include <linux/slab.h>
1918
#include <linux/spinlock.h>
2019
#include <linux/units.h>
@@ -59,8 +58,6 @@ struct qcom_cpufreq_data {
5958
struct clk_hw cpu_clk;
6059

6160
bool per_core_dcvs;
62-
63-
struct freq_qos_request throttle_freq_req;
6461
};
6562

6663
static struct {
@@ -350,8 +347,6 @@ static void qcom_lmh_dcvs_notify(struct qcom_cpufreq_data *data)
350347

351348
throttled_freq = freq_hz / HZ_PER_KHZ;
352349

353-
freq_qos_update_request(&data->throttle_freq_req, throttled_freq);
354-
355350
/* Update thermal pressure (the boost frequencies are accepted) */
356351
arch_update_thermal_pressure(policy->related_cpus, throttled_freq);
357352

@@ -444,14 +439,6 @@ static int qcom_cpufreq_hw_lmh_init(struct cpufreq_policy *policy, int index)
444439
if (data->throttle_irq < 0)
445440
return data->throttle_irq;
446441

447-
ret = freq_qos_add_request(&policy->constraints,
448-
&data->throttle_freq_req, FREQ_QOS_MAX,
449-
FREQ_QOS_MAX_DEFAULT_VALUE);
450-
if (ret < 0) {
451-
dev_err(&pdev->dev, "Failed to add freq constraint (%d)\n", ret);
452-
return ret;
453-
}
454-
455442
data->cancel_throttle = false;
456443
data->policy = policy;
457444

@@ -518,7 +505,6 @@ static void qcom_cpufreq_hw_lmh_exit(struct qcom_cpufreq_data *data)
518505
if (data->throttle_irq <= 0)
519506
return;
520507

521-
freq_qos_remove_request(&data->throttle_freq_req);
522508
free_irq(data->throttle_irq, data);
523509
}
524510

0 commit comments

Comments
 (0)