[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190108000214.GR261387@google.com>
Date: Mon, 7 Jan 2019 16:02:14 -0800
From: Matthias Kaehlcke <mka@...omium.org>
To: Taniya Das <tdas@...eaurora.org>
Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>,
Viresh Kumar <viresh.kumar@...aro.org>,
linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
Stephen Boyd <sboyd@...nel.org>,
Rajendra Nayak <rnayak@...eaurora.org>,
devicetree@...r.kernel.org, robh@...nel.org,
skannan@...eaurora.org, linux-arm-msm@...r.kernel.org,
amit.kucheria@...aro.org, evgreen@...gle.com
Subject: Re: [PATCH v1] cpufreq: qcom: Read voltage LUT and populate OPP
Hi Taniya.
On Mon, Dec 24, 2018 at 12:29:18AM +0530, Taniya Das wrote:
> Could you help validating with the patch below?
...
> diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c
> b/drivers/cpufreq/qcom-cpufreq-hw.c
> index 7559b87..23338b2 100644
> --- a/drivers/cpufreq/qcom-cpufreq-hw.c
> +++ b/drivers/cpufreq/qcom-cpufreq-hw.c
> @@ -81,7 +81,6 @@ static int qcom_cpufreq_hw_read_lut(struct device *dev,
> u32 volt;
> unsigned int max_cores = cpumask_weight(policy->cpus);
> struct cpufreq_frequency_table *table;
> - unsigned long cpu_r;
>
> table = kcalloc(LUT_MAX_ENTRIES + 1, sizeof(*table), GFP_KERNEL);
> if (!table)
> @@ -110,6 +109,8 @@ static int qcom_cpufreq_hw_read_lut(struct device *dev,
> table[i].frequency = freq;
> dev_dbg(dev, "index=%d freq=%d, core_count %d\n", i,
> freq, core_count);
> + dev_pm_opp_add(get_cpu_device(policy->cpu),
> + freq * 1000, volt);
> }
>
> /*
> @@ -126,6 +127,8 @@ static int qcom_cpufreq_hw_read_lut(struct device *dev,
> if (prev_cc != max_cores) {
> prev->frequency = prev_freq;
> prev->flags = CPUFREQ_BOOST_FREQ;
> + dev_pm_opp_add(get_cpu_device(policy->cpu),
> + prev_freq * 1000, volt);
> }
>
> break;
> @@ -133,12 +136,9 @@ static int qcom_cpufreq_hw_read_lut(struct device *dev,
>
> prev_cc = core_count;
> prev_freq = freq;
> -
> - freq *= 1000;
> - for_each_cpu(cpu_r, policy->cpus)
> - dev_pm_opp_add(get_cpu_device(cpu_r), freq, volt);
> }
>
> + dev_pm_opp_set_sharing_cpus(get_cpu_device(policy->cpu),
> policy->cpus);
> table[i].frequency = CPUFREQ_TABLE_END;
> policy->freq_table = table;
>
> @@ -245,6 +245,7 @@ static int qcom_cpufreq_hw_cpu_exit(struct
> cpufreq_policy *policy)
> {
> void __iomem *base = policy->driver_data - REG_PERF_STATE;
>
> + dev_pm_opp_cpumask_remove_table(policy->cpus);
Evan found that this doesn't actually remove dynamically added
OPPs. You'll have to use the shiny new dev_pm_opp_remove_all_dynamic()
(https://lore.kernel.org/patchwork/patch/1028942/) instead.
Cheers
Matthias
Powered by blists - more mailing lists