summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@quicinc.com>2017-05-16 16:08:07 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-05-16 16:08:07 -0700
commit60b854cbaaa06cc59d562d6b120ae3e86d1c1ea0 (patch)
tree4670132d006c55c4b715df75405c08d589a65148
parent05a7ad9638bafdd2593c200474e9bb9a7cf2f59c (diff)
parent346c7ec7168b10acf68ad2564b91eef0dc26e7c2 (diff)
Merge "msm: msm_bus: Add mutex to protect node_list"
-rw-r--r--drivers/soc/qcom/msm_bus/msm_bus_rules.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/soc/qcom/msm_bus/msm_bus_rules.c b/drivers/soc/qcom/msm_bus/msm_bus_rules.c
index 297ba9fc3c35..ea29e303bbde 100644
--- a/drivers/soc/qcom/msm_bus/msm_bus_rules.c
+++ b/drivers/soc/qcom/msm_bus/msm_bus_rules.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2014-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
@@ -410,8 +410,10 @@ void print_all_rules(void)
{
struct rule_node_info *node_it = NULL;
+ mutex_lock(&msm_bus_rules_lock);
list_for_each_entry(node_it, &node_list, link)
print_rules(node_it);
+ mutex_unlock(&msm_bus_rules_lock);
}
void print_rules_buf(char *buf, int max_buf)
@@ -421,6 +423,7 @@ void print_rules_buf(char *buf, int max_buf)
int i;
int cnt = 0;
+ mutex_lock(&msm_bus_rules_lock);
list_for_each_entry(node_it, &node_list, link) {
cnt += scnprintf(buf + cnt, max_buf - cnt,
"\n Now printing rules for Node %d cur_rule %d\n",
@@ -452,6 +455,7 @@ void print_rules_buf(char *buf, int max_buf)
node_rule->rule_ops.mode);
}
}
+ mutex_unlock(&msm_bus_rules_lock);
}
static int copy_rule(struct bus_rule_type *src, struct rules_def *node_rule,
@@ -721,11 +725,12 @@ bool msm_rule_are_rules_registered(void)
{
bool ret = false;
+ mutex_lock(&msm_bus_rules_lock);
if (list_empty(&node_list))
ret = false;
else
ret = true;
-
+ mutex_unlock(&msm_bus_rules_lock);
return ret;
}