linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gautham R Shenoy <ego@linux.vnet.ibm.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: rjw@rjwysocki.net, linaro-kernel@lists.linaro.org,
	cpufreq@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org, srivatsa.bhat@linux.vnet.ibm.com,
	ego@linux.vnet.ibm.com, svaidy@linux.vnet.ibm.com,
	l.majewski@samsung.com
Subject: Re: [PATCH] cpufreq: create another field .flags in cpufreq_frequency_table
Date: Fri, 28 Mar 2014 16:13:06 +0530	[thread overview]
Message-ID: <20140328104306.GA28960@in.ibm.com> (raw)
In-Reply-To: <b5bc276cdd34b039de2aa640ec0bb5dff195f832.1395996386.git.viresh.kumar@linaro.org>

On Fri, Mar 28, 2014 at 02:23:20PM +0530, Viresh Kumar wrote:
> Currently cpufreq frequency table has two fields: frequency and driver_data.
> driver_data is only for driver's internal use and cpufreq core shouldn't use it
> at all. But with the introduction of BOOST frequencies, this assumption was
> broken and we started using it as a flag instead.
> 
> There are two problems due to this:
> - It is against the description of this field, as driver's data is used by core
>   now.
> - if drivers fill it with -3 for any frequency, then those frequencies are never
>   considered by cpufreq core as it is exactly same as value of
>   CPUFREQ_BOOST_FREQ, i.e. ~2.
> 
> The best way to get this fixed is by creating another field flags which will be
> used for such flags. This patch does that. Along with that various drivers need
> modifications due to the change of struct cpufreq_frequency_table.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

Thanks for this patch. A minor comment below:

> diff --git a/drivers/cpufreq/exynos4x12-cpufreq.c b/drivers/cpufreq/exynos4x12-cpufreq.c
> index 7c11ace..8c4c6a5 100644
> --- a/drivers/cpufreq/exynos4x12-cpufreq.c
> +++ b/drivers/cpufreq/exynos4x12-cpufreq.c
> @@ -30,21 +30,21 @@ static unsigned int exynos4x12_volt_table[] = {
>  };
> 
>  static struct cpufreq_frequency_table exynos4x12_freq_table[] = {
> -	{CPUFREQ_BOOST_FREQ, 1500 * 1000},
> -	{L1, 1400 * 1000},
> -	{L2, 1300 * 1000},
> -	{L3, 1200 * 1000},
> -	{L4, 1100 * 1000},
> -	{L5, 1000 * 1000},
> -	{L6,  900 * 1000},
> -	{L7,  800 * 1000},
> -	{L8,  700 * 1000},
> -	{L9,  600 * 1000},
> -	{L10, 500 * 1000},
> -	{L11, 400 * 1000},
> -	{L12, 300 * 1000},
> -	{L13, 200 * 1000},
> -	{0, CPUFREQ_TABLE_END},
> +	{CPUFREQ_BOOST_FREQ, 0, 1500 * 1000},
                            ^^^
Functionally it might make no difference, but may be this line can be
rewritten as:
	  {CPUFREQ_BOOST_FREQ, L0, 1500 * 1000}
in order to be consistent with the subsequent entries of the table
which use the .driver_data field to record the indices. And L0 has
been defined in exynos-cpufreq.h 

But I shall leave it to you and Lukasz to decide if it is worth the
while.

> +	{0, L1, 1400 * 1000},
> +	{0, L2, 1300 * 1000},
> +	{0, L3, 1200 * 1000},
> +	{0, L4, 1100 * 1000},
> +	{0, L5, 1000 * 1000},
> +	{0, L6,  900 * 1000},
> +	{0, L7,  800 * 1000},
> +	{0, L8,  700 * 1000},
> +	{0, L9,  600 * 1000},
> +	{0, L10, 500 * 1000},
> +	{0, L11, 400 * 1000},
> +	{0, L12, 300 * 1000},
> +	{0, L13, 200 * 1000},
> +	{0, 0, CPUFREQ_TABLE_END},
>  };
> 

Reviewed-by: Gautham R Shenoy <ego@linux.vnet.ibm.com>

--
Thanks and Regards
gautham.

  parent reply	other threads:[~2014-03-28 10:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-24  6:48 [PATCH] cpufreq: set value of CPUFREQ_BOOST_FREQ to 0xABABABAB Viresh Kumar
2014-03-24  8:21 ` Lukasz Majewski
2014-03-24  8:33   ` Viresh Kumar
2014-03-24  8:52 ` Gautham R Shenoy
2014-03-28  8:53 ` [PATCH] cpufreq: create another field .flags in cpufreq_frequency_table Viresh Kumar
2014-03-28 10:14   ` [PATCH] cpufreq: use kzalloc() to allocate memory for cpufreq_frequency_table Viresh Kumar
2014-03-28 10:44     ` Gautham R Shenoy
2014-03-28 13:29     ` Joe Perches
2014-03-28 13:32       ` Viresh Kumar
2014-03-28 10:19   ` [PATCH] cpufreq: create another field .flags in cpufreq_frequency_table Lukasz Majewski
2014-03-28 10:33     ` Viresh Kumar
2014-03-28 10:43   ` Gautham R Shenoy [this message]
2014-03-28  8:55 ` [PATCH] cpufreq: set value of CPUFREQ_BOOST_FREQ to 0xABABABAB Viresh Kumar

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=20140328104306.GA28960@in.ibm.com \
    --to=ego@linux.vnet.ibm.com \
    --cc=cpufreq@vger.kernel.org \
    --cc=l.majewski@samsung.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=svaidy@linux.vnet.ibm.com \
    --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).