summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@quicinc.com>2017-05-16 06:49:22 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-05-16 06:49:22 -0700
commit3a168d290babaa453c1e0fd8f5f2d417599ce044 (patch)
tree7429323b7765c998a66c2875670750f106197a79 /drivers
parent4939123c905820fa6f06b7d34e5df842e1cbb1dc (diff)
parent28aab0311cfcd9b279f41f2f4da0085a660d5ed5 (diff)
Merge "PM/devfreq: bw_hwmon: add mutex lock in polling interval case"
Diffstat (limited to 'drivers')
-rw-r--r--drivers/devfreq/governor_bw_hwmon.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/devfreq/governor_bw_hwmon.c b/drivers/devfreq/governor_bw_hwmon.c
index b997e79e3d73..972de02ca549 100644
--- a/drivers/devfreq/governor_bw_hwmon.c
+++ b/drivers/devfreq/governor_bw_hwmon.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2017, The Linux Foundation. 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 version 2 and
@@ -86,6 +86,8 @@ static DEFINE_SPINLOCK(irq_lock);
static LIST_HEAD(hwmon_list);
static DEFINE_MUTEX(list_lock);
+static DEFINE_MUTEX(sync_lock);
+
static int use_cnt;
static DEFINE_MUTEX(state_lock);
@@ -846,6 +848,7 @@ static int devfreq_bw_hwmon_ev_handler(struct devfreq *df,
break;
case DEVFREQ_GOV_INTERVAL:
+ mutex_lock(&sync_lock);
sample_ms = *(unsigned int *)data;
sample_ms = max(MIN_MS, sample_ms);
sample_ms = min(MAX_MS, sample_ms);
@@ -865,6 +868,7 @@ static int devfreq_bw_hwmon_ev_handler(struct devfreq *df,
"Unable to resume HW monitor (%d)\n", ret);
return ret;
}
+ mutex_unlock(&sync_lock);
break;
case DEVFREQ_GOV_SUSPEND: