linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jane Li <jiel@marvell.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: "rjw@rjwysocki.net" <rjw@rjwysocki.net>,
	"viresh.kumar@linaro.org" <viresh.kumar@linaro.org>,
	"cpufreq@vger.kernel.org" <cpufreq@vger.kernel.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] cpufreq: Fix timer/workqueue corruption by protecting reading governor_enabled
Date: Fri, 3 Jan 2014 14:44:31 +0800	[thread overview]
Message-ID: <52C65C4F.1060804@marvell.com> (raw)
In-Reply-To: <20140102232638.GA21548@core.coreip.homeip.net>


On 01/03/2014 07:26 AM, Dmitry Torokhov wrote
> Unlocking in different branches is not the best practice IMO, I'd
> recommend doing:
>
> 	mutex_lock(&cpufreq_governor_lock);
>
> 	if (!policy->governor_enabled)
> 		goto out_unlock;
>
> 	...
>
> out_unlock:
> 	mutex_unlock(&cpufreq_governor_lock);
>
> Thanks!
>
OK. I have pushed PATCH v3. Please review again.

Besides, I use checkpatch.pl to check this patch, and find there is warning. PATCH v3 also move cpufreq_governor_lock declaration to cpufreq.h.

WARNING: externs should be avoided in .c files
#106: FILE: drivers/cpufreq/cpufreq_governor.c:25:
+extern struct mutex cpufreq_governor_lock;

Thanks!

      reply	other threads:[~2014-01-03  6:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-02  3:14 [PATCH v2] cpufreq: Fix timer/workqueue corruption by protecting reading governor_enabled jiel
2014-01-02  5:34 ` Viresh Kumar
2014-01-02 23:26 ` Dmitry Torokhov
2014-01-03  6:44   ` Jane Li [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=52C65C4F.1060804@marvell.com \
    --to=jiel@marvell.com \
    --cc=cpufreq@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --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).