summaryrefslogtreecommitdiff
path: root/drivers/thermal
diff options
context:
space:
mode:
authorJoonyoung Shim <jy0922.shim@samsung.com>2015-09-07 16:42:31 +0900
committerSeung-Woo Kim <sw0312.kim@samsung.com>2016-12-14 13:48:19 +0900
commitadb9a35c1fcf94ebf654e1499b98d8cbbeca5b67 (patch)
tree3b147b235e186c60628b00449ada0e974d581625 /drivers/thermal
parentda8b30eb0a160ce696b7f5828ac79aa847fcf5f0 (diff)
LOCAL / PM / devfreq: rollback mutex locking for update_devfreq()
Userspace, performance and powersave governers call update_devfreq() with mutex locking. It causes nested mutex locking error. I'm not sure that i should make a choice which reverting change that includes mutex locking in update_devfreq() or removing mutex locking before update_devfreq() is called on each governers. IMHO, the upstream codes don't include mutex locking in update_devfreq() so first option is better. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/devfreq_cooling.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/thermal/devfreq_cooling.c b/drivers/thermal/devfreq_cooling.c
index fb2c0654fa7d..abbbcad9776d 100644
--- a/drivers/thermal/devfreq_cooling.c
+++ b/drivers/thermal/devfreq_cooling.c
@@ -123,6 +123,7 @@ static int devfreq_set_cur_state(struct thermal_cooling_device *cdev,
{
struct devfreq_cooling_device *devfreq_dev = cdev->devdata;
unsigned int limited_freq;
+ int ret;
/* Request state should be less than max_level */
if (WARN_ON(state > devfreq_dev->max_state))
@@ -138,9 +139,11 @@ static int devfreq_set_cur_state(struct thermal_cooling_device *cdev,
/* Set the limited frequency to maximum frequency of devfreq */
devfreq_dev->devfreq->max_freq = limited_freq;
- update_devfreq(devfreq_dev->devfreq);
+ mutex_lock(&devfreq_dev->devfreq->lock);
+ ret = update_devfreq(devfreq_dev->devfreq);
+ mutex_unlock(&devfreq_dev->devfreq->lock);
- return 0;
+ return ret;
}
/* Bind devfreq callbacks to thermal cooling device ops */