summaryrefslogtreecommitdiff
path: root/drivers/devfreq
diff options
context:
space:
mode:
authorRohit Gupta <rohgup@codeaurora.org>2015-10-27 17:46:49 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:04:40 -0700
commite0bb9942b488e20ce315ab5d536aa1085f75be99 (patch)
treeeb2539f5cb3c92c2149433bb6165c32e65e5e23d /drivers/devfreq
parent43f61ed8aa3ebb85c40b329b83f33b79f08712c6 (diff)
PM / devfreq: memlat: Get complete CPU list during the probe
Currently arm-memlat-mon driver uses cpu_coregroup_mask to get the sibling CPUs for the first CPU specified during the probe. However if any of the CPUs in a cluster isn't hotplugged in even once before the probe runs then the call to cpu_coregroup_mask might not give the updated list of all the sibling CPUs for the specified CPU. With this change the initialization of the cpumask for the memlat device is obtained from the list of CPU phandles specified in the dtsi file. Change-Id: Ide97d60d9eecbbe1d33deda72a13951059822896 Signed-off-by: Rohit Gupta <rohgup@codeaurora.org> [junjiew@codeaurora.org: dropped changes in dtsi files.] Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
Diffstat (limited to 'drivers/devfreq')
-rw-r--r--drivers/devfreq/arm-memlat-mon.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/drivers/devfreq/arm-memlat-mon.c b/drivers/devfreq/arm-memlat-mon.c
index a13cb1995329..4bafdd7e76de 100644
--- a/drivers/devfreq/arm-memlat-mon.c
+++ b/drivers/devfreq/arm-memlat-mon.c
@@ -222,21 +222,27 @@ err:
static int get_mask_from_dev_handle(struct platform_device *pdev,
cpumask_t *mask)
{
+ struct device *dev = &pdev->dev;
struct device_node *dev_phandle;
- int cpu = 0;
-
- dev_phandle = of_parse_phandle(pdev->dev.of_node, "qcom,firstcpu", 0);
- if (!dev_phandle)
- return -ENOENT;
-
- for_each_possible_cpu(cpu) {
- if (arch_find_n_match_cpu_physical_id(dev_phandle, cpu, NULL)) {
- cpumask_copy(mask, cpu_coregroup_mask(cpu));
- return 0;
+ struct device *cpu_dev;
+ int cpu, i = 0;
+ int ret = -ENOENT;
+
+ dev_phandle = of_parse_phandle(dev->of_node, "qcom,cpulist", i++);
+ while (dev_phandle) {
+ for_each_possible_cpu(cpu) {
+ cpu_dev = get_cpu_device(cpu);
+ if (cpu_dev && cpu_dev->of_node == dev_phandle) {
+ cpumask_set_cpu(cpu, mask);
+ ret = 0;
+ break;
+ }
}
+ dev_phandle = of_parse_phandle(dev->of_node,
+ "qcom,cpulist", i++);
}
- return -ENOENT;
+ return ret;
}
static int arm_memlat_mon_driver_probe(struct platform_device *pdev)