Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a65158eb authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "PM / devfreq: memlat: Get complete CPU list during the probe"

parents 7bc76a75 f680eb3a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -5,12 +5,12 @@ to measure the parameters for latency driven memory access patterns.

Required properties:
- compatible:			Must be "qcom,arm-memlat-mon"
- qcom,firstcpu:		First CPU of the cluster to be monitored
- qcom,cpulist:			List of CPU phandles to be monitored in a cluster
- qcom,target-dev:		The DT device that corresponds to this master port

Example:
	qcom,arm-memlat-mon {
		compatible = "qcom,arm-memlat-mon";
		qcom,firstcpu = <&CPU0>;
		qcom,cpulist = <&CPU0 &CPU1>;
		qcom,target-dev = <&memlat0>;
	};
+2 −2
Original line number Diff line number Diff line
@@ -547,13 +547,13 @@

	qcom,arm-memlat-mon-0 {
		compatible = "qcom,arm-memlat-mon";
		qcom,firstcpu = <&CPU0>;
		qcom,cpulist =	<&CPU0 &CPU1>;
		qcom,target-dev = <&memlat_cpu0>;
	};

	qcom,arm-memlat-mon-2 {
		compatible = "qcom,arm-memlat-mon";
		qcom,firstcpu = <&CPU2>;
		qcom,cpulist =	<&CPU2 &CPU3>;
		qcom,target-dev = <&memlat_cpu2>;
	};

+17 −11
Original line number Diff line number Diff line
@@ -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;
	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) {
		if (arch_find_n_match_cpu_physical_id(dev_phandle, cpu, NULL)) {
			cpumask_copy(mask, cpu_coregroup_mask(cpu));
			return 0;
			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)