linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Igor Dmitriev <ext-dmitriev.igor@nokia.com>
To: ext Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: l-o <linux-omap@vger.kernel.org>, Kevin Hilman <khilman@ti.com>
Subject: Re: [PATCH] OMAP2+: CPUfreq: Allow the CPU scaling when secondary CPUs are offline.
Date: Fri, 03 Jun 2011 13:07:41 +0300	[thread overview]
Message-ID: <1307095661.11365.1216.camel@digor-desktop.nmp.nokia.com> (raw)
In-Reply-To: <4DE7A405.9030602@ti.com>

Hi,

On Thu, 2011-06-02 at 20:23 +0530, ext Santosh Shilimkar wrote:
> Missed Kevin in cc. :(
> Sorry about that.
> 
> -------- Original Message --------
> Subject: [PATCH] OMAP2+: CPUfreq: Allow the CPU scaling when secondary 
> CPUs are offline.
> Date: Thu, 2 Jun 2011 20:21:10 +0530
> From: Santosh Shilimkar <santosh.shilimkar@ti.com>
> To: <linux-omap@vger.kernel.org>
> CC: Santosh Shilimkar <santosh.shilimkar@ti.com>
> 
> Current OMAP2PLUS CPUfreq tagret() functions returns when all
> the CPU's are not online. This will break DVFS when secondary
> CPUs are offlined.
> 
> The intention of that check was just avoid CPU frequency change
> during the window when CPU becomes online but it's cpufreq_init is
> not done yet.
> 
> Fix the check accordingly.
> 
> Thanks for Nishant Menon <nm@ti.com> for reporting it.
> 
> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> Reported-by: Nishanth Menon <nm@ti.com>
> Tested-by: Vishwanath BS <vishwanath.bs@ti.com>
> ---
> There were some question of making the variable atomic etc
> in an internal discussion. After some thinking, I realised
> there is no need of that since this is just a counter which
> maintains the count for online_cpus = cpufreq_init_cpus.
> 
>   arch/arm/mach-omap2/omap2plus-cpufreq.c |    9 ++++++++-
>   1 files changed, 8 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/omap2plus-cpufreq.c 
> b/arch/arm/mach-omap2/omap2plus-cpufreq.c
> index 33a91ec..909bfcb 100644
> --- a/arch/arm/mach-omap2/omap2plus-cpufreq.c
> +++ b/arch/arm/mach-omap2/omap2plus-cpufreq.c
> @@ -44,6 +44,7 @@ static struct cpufreq_frequency_table *freq_table;
>   static struct clk *mpu_clk;
>   static char *mpu_clk_name;
>   static struct device *mpu_dev;
> +static int cpus_initialized;
> 
>   static int omap_verify_speed(struct cpufreq_policy *policy)
>   {
> @@ -82,7 +83,7 @@ static int omap_target(struct cpufreq_policy *policy,
>   	struct cpufreq_freqs freqs;
> 
>   	/* Changes not allowed until all CPUs are online */

This comment are no more relevant and should be changed also...

> -	if (is_smp() && (num_online_cpus() < NR_CPUS))
> +	if (is_smp() && (cpus_initialized < num_online_cpus()))
>   		return ret;
> 
>   	/* Ensure desired rate is within allowed range.  Some govenors
> @@ -194,6 +195,8 @@ static int __cpuinit omap_cpu_init(struct 
> cpufreq_policy *policy)
>   		policy->shared_type = CPUFREQ_SHARED_TYPE_ANY;
>   		cpumask_or(cpumask, cpumask_of(policy->cpu), cpumask);
>   		cpumask_copy(policy->cpus, cpumask);
> +		cpus_initialized++;
> +		smp_wmb();
>   	}
> 
>   	/* FIXME: what's the actual transition time? */
> @@ -206,6 +209,10 @@ static int omap_cpu_exit(struct cpufreq_policy *policy)
>   {
>   	clk_exit_cpufreq_table(&freq_table);
>   	clk_put(mpu_clk);
> +	if (is_smp()) {
> +		cpus_initialized--;
> +		smp_wmb();
> +	}
>   	return 0;
>   }
> 

Best Regards,
Igor Dmitriev


  reply	other threads:[~2011-06-03 10:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-02 14:53 [PATCH] OMAP2+: CPUfreq: Allow the CPU scaling when secondary CPUs are offline Santosh Shilimkar
2011-06-03 10:07 ` Igor Dmitriev [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-06-02 14:51 Santosh Shilimkar
2011-06-02 23:10 ` Kevin Hilman
2011-06-03  6:26   ` Santosh Shilimkar
2011-06-03  8:31     ` Santosh Shilimkar
2011-06-03 12:05       ` Santosh Shilimkar
2011-06-03  2:44 ` Menon, Nishanth
2011-06-03  6:39   ` Santosh Shilimkar
2011-06-03 12:04     ` Santosh Shilimkar

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=1307095661.11365.1216.camel@digor-desktop.nmp.nokia.com \
    --to=ext-dmitriev.igor@nokia.com \
    --cc=khilman@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=santosh.shilimkar@ti.com \
    /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).