From: akpm@linux-foundation.org
To: mm-commits@vger.kernel.org
Cc: andrej.gelenberg@udo.edu, ashok.raj@intel.com, davej@redhat.com,
linux@dominikbrodowski.net, trenn@suse.de,
xiyou.wangcong@gmail.com
Subject: + cpufreq-fix-race-condition-in-store_scaling_governor.patch added to -mm tree
Date: Wed, 12 May 2010 15:00:45 -0700 [thread overview]
Message-ID: <201005122200.o4CM0jrI023217@imap1.linux-foundation.org> (raw)
The patch titled
cpufreq: fix race condition in store_scaling_governor
has been added to the -mm tree. Its filename is
cpufreq-fix-race-condition-in-store_scaling_governor.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/SubmitChecklist when testing your code ***
See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this
The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/
------------------------------------------------------
Subject: cpufreq: fix race condition in store_scaling_governor
From: Andrej Gelenberg <andrej.gelenberg@udo.edu>
Wrap store_scaling_governor() with mutex lock cpufreq_governor_mutex().
Fix kernel panic when switching the scaling governor very quickly.
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=15948
Signed-off-by: Andrej Gelenberg <andrej.gelenberg@udo.edu>
Cc: Americo Wang <xiyou.wangcong@gmail.com>
Cc: Dave Jones <davej@redhat.com>
Cc: Thomas Renninger <trenn@suse.de>
Cc: Ashok Raj <ashok.raj@intel.com>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/cpufreq/cpufreq.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff -puN drivers/cpufreq/cpufreq.c~cpufreq-fix-race-condition-in-store_scaling_governor drivers/cpufreq/cpufreq.c
--- a/drivers/cpufreq/cpufreq.c~cpufreq-fix-race-condition-in-store_scaling_governor
+++ a/drivers/cpufreq/cpufreq.c
@@ -399,8 +399,6 @@ static int cpufreq_parse_governor(char *
} else if (cpufreq_driver->target) {
struct cpufreq_governor *t;
- mutex_lock(&cpufreq_governor_mutex);
-
t = __find_governor(str_governor);
if (t == NULL) {
@@ -425,8 +423,6 @@ static int cpufreq_parse_governor(char *
*governor = t;
err = 0;
}
-
- mutex_unlock(&cpufreq_governor_mutex);
}
out:
return err;
@@ -517,7 +513,7 @@ static ssize_t show_scaling_governor(str
/**
* store_scaling_governor - store policy for the specified CPU
*/
-static ssize_t store_scaling_governor(struct cpufreq_policy *policy,
+static ssize_t _store_scaling_governor(struct cpufreq_policy *policy,
const char *buf, size_t count)
{
unsigned int ret = -EINVAL;
@@ -549,6 +545,16 @@ static ssize_t store_scaling_governor(st
return count;
}
+static ssize_t store_scaling_governor(struct cpufreq_policy *policy,
+ const char *buf, size_t count)
+{
+ ssize_t ret;
+ mutex_lock(&cpufreq_governor_mutex);
+ ret = _store_scaling_governor(policy, buf, count);
+ mutex_unlock(&cpufreq_governor_mutex);
+ return ret;
+}
+
/**
* show_scaling_driver - show the cpufreq driver currently loaded
*/
_
Patches currently in -mm which might be from andrej.gelenberg@udo.edu are
origin.patch
cpufreq-fix-race-condition-in-store_scaling_governor.patch
cpufreq-fix-race-condition-in-store_scaling_governor-fix.patch
reply other threads:[~2010-05-12 22:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=201005122200.o4CM0jrI023217@imap1.linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=andrej.gelenberg@udo.edu \
--cc=ashok.raj@intel.com \
--cc=davej@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@dominikbrodowski.net \
--cc=mm-commits@vger.kernel.org \
--cc=trenn@suse.de \
--cc=xiyou.wangcong@gmail.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