linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthias Kaehlcke <mka@chromium.org>
To: Taniya Das <tdas@codeaurora.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
	Stephen Boyd <sboyd@kernel.org>,
	Rajendra Nayak <rnayak@codeaurora.org>,
	devicetree@vger.kernel.org, robh@kernel.org,
	skannan@codeaurora.org, linux-arm-msm@vger.kernel.org,
	amit.kucheria@linaro.org, evgreen@google.com
Subject: Re: [PATCH v1] cpufreq: qcom: Read voltage LUT and populate OPP
Date: Mon, 7 Jan 2019 16:02:14 -0800	[thread overview]
Message-ID: <20190108000214.GR261387@google.com> (raw)
In-Reply-To: <2977f340-cd4e-86bc-da3a-8845676e39ed@codeaurora.org>

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

  parent reply	other threads:[~2019-01-08  0:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-21 18:06 [PATCH v1] cpufreq: qcom: Read voltage LUT and populate OPP Taniya Das
2018-12-21 20:57 ` Matthias Kaehlcke
2018-12-23 18:59   ` Taniya Das
2018-12-26 19:32     ` Matthias Kaehlcke
2019-01-07  7:18       ` Taniya Das
2019-01-08  0:02     ` Matthias Kaehlcke [this message]
2019-01-09  8:08       ` Taniya Das
2018-12-21 21:45 ` Stephen Boyd
2019-01-07  7:37   ` Taniya Das

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190108000214.GR261387@google.com \
    --to=mka@chromium.org \
    --cc=amit.kucheria@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=evgreen@google.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=rnayak@codeaurora.org \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=skannan@codeaurora.org \
    --cc=tdas@codeaurora.org \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).