All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Rafael Wysocki <rjw@rjwysocki.net>,
	mturquette@baylibre.com, linaro-kernel@lists.linaro.org,
	linux-pm@vger.kernel.org,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Dmitry Torokhov <dtor@chromium.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Len Brown <len.brown@intel.com>,
	open list <linux-kernel@vger.kernel.org>,
	Nishanth Menon <nm@ti.com>, Pavel Machek <pavel@ucw.cz>,
	Stephen Boyd <sboyd@codeaurora.org>
Subject: Re: [PATCH] PM / OPP: Protect updates to list_dev with mutex
Date: Fri, 30 Oct 2015 15:04:50 +0300	[thread overview]
Message-ID: <20151030120450.GH7289@mwanda> (raw)
In-Reply-To: <5f8fac4ad84716ef68fc50ab0b78e11ad2837524.1446205160.git.viresh.kumar@linaro.org>

On Fri, Oct 30, 2015 at 05:26:06PM +0530, Viresh Kumar wrote:
> --- a/drivers/base/power/opp/cpu.c
> +++ b/drivers/base/power/opp/cpu.c
> @@ -124,12 +124,12 @@ int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask)
>  	struct device *dev;
>  	int cpu, ret = 0;
>  
> -	rcu_read_lock();
> +	mutex_lock(&dev_opp_list_lock);
>  
>  	dev_opp = _find_device_opp(cpu_dev);
>  	if (IS_ERR(dev_opp)) {
>  		ret = -EINVAL;
> -		goto out_rcu_read_unlock;
> +		goto unlock;
>  	}
>  
>  	for_each_cpu(cpu, cpumask) {
> @@ -150,8 +150,8 @@ int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask)
>  			continue;
>  		}
>  	}
> -out_rcu_read_unlock:
> -	rcu_read_unlock();
> +unlock:
> +	mutex_unlock(&dev_opp_list_lock);
>  
>  	return 0;

Not introduced by your patch, but this should be "return ret;"

regards,
dan carpenter

  reply	other threads:[~2015-10-30 12:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-30 11:56 [PATCH] PM / OPP: Protect updates to list_dev with mutex Viresh Kumar
2015-10-30 11:56 ` Viresh Kumar
2015-10-30 12:04 ` Dan Carpenter [this message]
2015-10-30 12:40   ` [PATCH] PM / OPP: Propagate error properly from dev_pm_opp_set_sharing_cpus() Viresh Kumar
2015-10-30 12:40     ` Viresh Kumar
2015-10-30 20:59     ` Stephen Boyd
2015-10-30 17:06 ` [PATCH] PM / OPP: Protect updates to list_dev with mutex Stephen Boyd
2015-10-31  2:14   ` Viresh Kumar
2015-11-02 19:14     ` Stephen Boyd
2015-11-04  2:19       ` Viresh Kumar
2015-11-05  8:42       ` Viresh Kumar
2015-11-04 10:22     ` Michael Turquette
2015-11-04 10:25       ` Viresh Kumar
2015-11-04 22:11 ` Stephen Boyd

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=20151030120450.GH7289@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=dtor@chromium.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=len.brown@intel.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=nm@ti.com \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    --cc=sboyd@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.