[withdrawn] cpufreq-fix-race-condition-in-store_scaling_governor.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     cpufreq: fix race condition in store_scaling_governor
has been removed from the -mm tree.  Its filename was
     cpufreq-fix-race-condition-in-store_scaling_governor.patch

This patch was dropped because it was withdrawn

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@xxxxxxx>

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@xxxxxxx>
Cc: Americo Wang <xiyou.wangcong@xxxxxxxxx>
Cc: Dave Jones <davej@xxxxxxxxxx>
Cc: Thomas Renninger <trenn@xxxxxxx>
Cc: Ashok Raj <ashok.raj@xxxxxxxxx>
Cc: Dominik Brodowski <linux@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 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@xxxxxxx are

origin.patch
cpufreq-fix-race-condition-in-store_scaling_governor.patch
cpufreq-fix-race-condition-in-store_scaling_governor-fix.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux