diff options
| author | Runmin Wang <runminw@codeaurora.org> | 2016-05-03 13:13:26 -0700 |
|---|---|---|
| committer | Runmin Wang <runminw@codeaurora.org> | 2016-10-13 13:04:11 -0700 |
| commit | 90c2d5300ee2bc1dafae9be7225dd61540cffef7 (patch) | |
| tree | 64b1384d51da3fe9b2c8570e0451f83546f5096b /drivers | |
| parent | 1fac7f53bdec193dfbaba8a9706075dc4d5ff756 (diff) | |
soc: qcom: core_hang: Separate sysfs entry for silver and gold cluster
Silver and gold cluster use different PMU_EVENT and may need to have
different threshold values.
This patch creates different sysfs entries for silver and gold cluster.
CRs-Fixed: 1004392
Change-Id: I88cdf5110cadb44a81c0c700d5188bf639bb2129
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/soc/qcom/core_hang_detect.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/drivers/soc/qcom/core_hang_detect.c b/drivers/soc/qcom/core_hang_detect.c index e9b7f612dccc..c88d4c34eecf 100644 --- a/drivers/soc/qcom/core_hang_detect.c +++ b/drivers/soc/qcom/core_hang_detect.c @@ -245,7 +245,9 @@ static int msm_hang_detect_probe(struct platform_device *pdev) struct device_node *node = pdev->dev.of_node; struct hang_detect *hang_det = NULL; int cpu, ret, cpu_count = 0; - u32 treg[NR_CPUS], creg[NR_CPUS]; + const char *name; + u32 treg[NR_CPUS] = {0}, creg[NR_CPUS] = {0}; + u32 num_reg = 0; if (!pdev->dev.of_node || !enable) return -ENODEV; @@ -258,15 +260,28 @@ static int msm_hang_detect_probe(struct platform_device *pdev) return -ENOMEM; } + name = of_get_property(node, "label", NULL); + if (!name) { + pr_err("Can't get label property\n"); + return -EINVAL; + } + + num_reg = of_property_count_u32_elems(node, + "qcom,threshold-arr"); + if (num_reg < 0) { + pr_err("Can't get threshold-arr property\n"); + return -EINVAL; + } + ret = of_property_read_u32_array(node, "qcom,threshold-arr", - treg, num_possible_cpus()); + treg, num_reg); if (ret) { pr_err("Can't get threshold-arr property\n"); return -EINVAL; } ret = of_property_read_u32_array(node, "qcom,config-arr", - creg, num_possible_cpus()); + creg, num_reg); if (ret) { pr_err("Can't get config-arr property\n"); return -EINVAL; @@ -289,7 +304,8 @@ static int msm_hang_detect_probe(struct platform_device *pdev) } ret = kobject_init_and_add(&hang_det->kobj, &core_ktype, - &cpu_subsys.dev_root->kobj, "%s", "hang_detect"); + &cpu_subsys.dev_root->kobj, "%s_%s", + "hang_detect", name); if (ret) { pr_err("%s:Error in creation kobject_add\n", __func__); goto out_put_kobj; |
