[PATCH] cpufreq: qcom-hw: Don't add duplicate OPPs

From: Matthias Kaehlcke
Date: Mon Jan 14 2019 - 18:54:54 EST


Signed-off-by: Matthias Kaehlcke <mka@xxxxxxxxxxxx>
---
drivers/cpufreq/qcom-cpufreq-hw.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c
index 41557329777e5a..314c8d29276b5e 100644
--- a/drivers/cpufreq/qcom-cpufreq-hw.c
+++ b/drivers/cpufreq/qcom-cpufreq-hw.c
@@ -103,15 +103,14 @@ static int qcom_cpufreq_hw_read_lut(struct device *dev,
else
freq = cpu_hw_rate / 1000;

- /* Ignore boosts in the middle of the table */
- if (core_count != max_cores) {
- table[i].frequency = CPUFREQ_ENTRY_INVALID;
- } else {
+ if ((freq != prev_freq) && (core_count == max_cores)) {
table[i].frequency = freq;
dev_pm_opp_add(get_cpu_device(policy->cpu),
- freq * 1000, volt);
+ freq * 1000, volt);
dev_dbg(dev, "index=%d freq=%d, core_count %d\n", i,
freq, core_count);
+ } else {
+ table[i].frequency = CPUFREQ_ENTRY_INVALID;
}

/*