summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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: