public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Amit Daniel Kachhap <amit.daniel@samsung.com>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-samsung-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Kukjin Kim <kgene.kim@samsung.com>,
	cpufreq@vger.kernel.org, Nishanth Menon <nm@ti.com>
Subject: Re: [PATCH] cpufreq: exynos5440: Protect opp search calls with rcu lock
Date: Mon, 22 Apr 2013 01:32:17 +0200	[thread overview]
Message-ID: <27334831.finUCxlqRS@vostro.rjw.lan> (raw)
In-Reply-To: <1366007087-12090-1-git-send-email-amit.daniel@samsung.com>

On Monday, April 15, 2013 11:54:47 AM Amit Daniel Kachhap wrote:
> As per the OPP library documentation(Documentation/power/opp.txt) all
> opp find/get calls should be protected by rcu locks.
> 
> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
> ---
> 
> This patch is created against linux-next tree and is suggested by
> Nishanth Menon. (https://lkml.org/lkml/2013/4/12/119)

Applied.

Thanks,
Rafael


>  drivers/cpufreq/exynos5440-cpufreq.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/cpufreq/exynos5440-cpufreq.c b/drivers/cpufreq/exynos5440-cpufreq.c
> index ead7ed4..0c74018 100644
> --- a/drivers/cpufreq/exynos5440-cpufreq.c
> +++ b/drivers/cpufreq/exynos5440-cpufreq.c
> @@ -120,11 +120,13 @@ static int init_div_table(void)
>  	int i = 0;
>  	struct opp *opp;
>  
> +	rcu_read_lock();
>  	for (i = 0; freq_tbl[i].frequency != CPUFREQ_TABLE_END; i++) {
>  
>  		opp = opp_find_freq_exact(dvfs_info->dev,
>  					freq_tbl[i].frequency * 1000, true);
>  		if (IS_ERR(opp)) {
> +			rcu_read_unlock();
>  			dev_err(dvfs_info->dev,
>  				"failed to find valid OPP for %u KHZ\n",
>  				freq_tbl[i].frequency);
> @@ -159,6 +161,7 @@ static int init_div_table(void)
>  		__raw_writel(tmp, dvfs_info->base + XMU_PMU_P0_7 + 4 * i);
>  	}
>  
> +	rcu_read_unlock();
>  	return 0;
>  }
>  
> 
-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

      parent reply	other threads:[~2013-04-21 23:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-15  6:24 [PATCH] cpufreq: exynos5440: Protect opp search calls with rcu lock Amit Daniel Kachhap
2013-04-15 14:10 ` Nishanth Menon
2013-04-16  6:51   ` amit daniel kachhap
2013-04-21 23:32 ` 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=27334831.finUCxlqRS@vostro.rjw.lan \
    --to=rjw@sisk.pl \
    --cc=amit.daniel@samsung.com \
    --cc=cpufreq@vger.kernel.org \
    --cc=kgene.kim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=nm@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