mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: tianyu.lan@intel.com
Cc: viresh.kumar@linaro.org, srivatsa.bhat@linux.vnet.ibm.com,
	cpufreq@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Cpufreq: Acquire read lock in the cpufreq_policy_restore() rather than write lock
Date: Thu, 12 Sep 2013 00:56:03 +0200	[thread overview]
Message-ID: <2039668.8La2a0cgXT@vostro.rjw.lan> (raw)
In-Reply-To: <1378883105-1411-1-git-send-email-tianyu.lan@intel.com>

On Wednesday, September 11, 2013 03:05:05 PM tianyu.lan@intel.com wrote:
> From: Lan Tianyu <tianyu.lan@intel.com>
> 
> In the cpufreq_policy_restore(), policy before system suspend is read from
> from percpu's cpufreq_cpu_data_fallback. It's read operation rather than
> write operation. So convert write lock to read lock
> 
> Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>

Applied, thanks Tianyu!

> ---
>  drivers/cpufreq/cpufreq.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 81ceea6..b762f9b 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -912,11 +912,11 @@ static struct cpufreq_policy *cpufreq_policy_restore(unsigned int cpu)
>  	struct cpufreq_policy *policy;
>  	unsigned long flags;
>  
> -	write_lock_irqsave(&cpufreq_driver_lock, flags);
> +	read_lock_irqsave(&cpufreq_driver_lock, flags);
>  
>  	policy = per_cpu(cpufreq_cpu_data_fallback, cpu);
>  
> -	write_unlock_irqrestore(&cpufreq_driver_lock, flags);
> +	read_unlock_irqrestore(&cpufreq_driver_lock, flags);
>  
>  	return policy;
>  }
> 
-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

      parent reply	other threads:[~2013-09-11 22:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-11  7:05 tianyu.lan
2013-09-11  8:09 ` Srivatsa S. Bhat
2013-09-11  8:44 ` Viresh Kumar
2013-09-11 22:56 ` Rafael J. Wysocki [this message]

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=2039668.8La2a0cgXT@vostro.rjw.lan \
    --to=rjw@sisk.pl \
    --cc=cpufreq@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=tianyu.lan@intel.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

all inboxes | Powered by JetHome®