diff options
author | Jubeom Kim <jubeomk@nvidia.com> | 2013-11-29 16:37:28 +0900 |
---|---|---|
committer | Diwakar Tundlam <dtundlam@nvidia.com> | 2013-12-04 10:45:17 -0800 |
commit | bcad4287c6b3848bb92a50b54a198359134cc4d1 (patch) | |
tree | 1c4cb4e0a3b8c454ba665748e5edce7c46fd17e9 /drivers/cpuquiet | |
parent | 55b0aeeff154d2dc3b3da4cd325dccd7ed9146e2 (diff) |
cpuquiet: move back cpuquiet_lock
Moved cpuquiet_lock to the back of cpuquiet_switch_governor().
cpuquiet_switch_governor() has to be protected by cpuquiet_lock.
In the runnable cpuquiet_governor case, it can occur a kernel panic or BUG_ON
because schedule_work() and INIT_WORK() can be performed at the same time.
Bug 1410816
Change-Id: I6d3d69bd8896e5425a762cbc4a58343a319edf29
Signed-off-by: Jubeom Kim <jubeomk@nvidia.com>
(cherry picked from commit 8502d0b7c057f96b7cd0495b49e37fc968d4bf8a)
Reviewed-on: http://git-master/r/337335
Reviewed-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Tested-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
Diffstat (limited to 'drivers/cpuquiet')
-rw-r--r-- | drivers/cpuquiet/sysfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/cpuquiet/sysfs.c b/drivers/cpuquiet/sysfs.c index c3ae097bd56d..3c1422680bbe 100644 --- a/drivers/cpuquiet/sysfs.c +++ b/drivers/cpuquiet/sysfs.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2012-2013 NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -70,10 +70,10 @@ static ssize_t store_current_governor(const char *buf, size_t count) mutex_lock(&cpuquiet_lock); gov = cpuquiet_find_governor(name); - mutex_unlock(&cpuquiet_lock); if (gov) ret = cpuquiet_switch_governor(gov); + mutex_unlock(&cpuquiet_lock); if (ret) return ret; |