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

Commit 8d9e55c6 authored by muluhe's avatar muluhe Committed by Mulu He
Browse files

coresight: Affinity to invalid if no cpu nodes are found



By default if no node found the function of_coresight_get_cpu return CPU0
which will cause problem when CPU0 etm probe.So should return invalid value
in case of no nodes found.

Change-Id: I9f71a0e54d9980049a8ee606ca8b2c51e1e66740
Signed-off-by: default avatarmuluhe <muluhe@codeaurora.org>
parent 8c72aa73
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1451,8 +1451,8 @@ static int cti_probe(struct amba_device *adev, const struct amba_id *id)
	drvdata->cpu = -1;
	cpu_node = of_parse_phandle(adev->dev.of_node, "cpu", 0);
	if (cpu_node) {
		drvdata->cpu = pdata ? pdata->cpu : -1;
		if (drvdata->cpu == -1) {
		drvdata->cpu = pdata ? pdata->cpu : -ENODEV;
		if (drvdata->cpu == -ENODEV) {
			dev_err(drvdata->dev, "CTI cpu node invalid\n");
			return -EINVAL;
		}
+2 −2
Original line number Diff line number Diff line
@@ -984,9 +984,9 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id)

	spin_lock_init(&drvdata->spinlock);

	drvdata->cpu = pdata ? pdata->cpu : -1;
	drvdata->cpu = pdata ? pdata->cpu : -ENODEV;

	if (drvdata->cpu == -1) {
	if (drvdata->cpu == -ENODEV) {
		dev_info(dev, "CPU not available\n");
		return -ENODEV;
	}
+4 −6
Original line number Diff line number Diff line
@@ -109,9 +109,9 @@ int of_coresight_get_cpu(const struct device_node *node)

	dn = of_parse_phandle(node, "cpu", 0);

	/* Affinity defaults to CPU0 */
	/* Affinity defaults to invalid */
	if (!dn)
		return 0;
		return -ENODEV;

	for_each_possible_cpu(cpu) {
		np = of_cpu_device_node_get(cpu);
@@ -122,8 +122,8 @@ int of_coresight_get_cpu(const struct device_node *node)
	}
	of_node_put(dn);

	/* Affinity to CPU0 if no cpu nodes are found */
	return found ? cpu : 0;
	/* Affinity to invalid if no cpu nodes are found */
	return found ? cpu : -ENODEV;
}
EXPORT_SYMBOL_GPL(of_coresight_get_cpu);

@@ -207,8 +207,6 @@ of_get_coresight_platform_data(struct device *dev,
	}

	pdata->cpu = of_coresight_get_cpu(node);
	/* Affinity defaults to invalid */
	pdata->cpu = -1;

	return pdata;
}