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

Commit 89708a1a authored by Mulu He's avatar Mulu He Committed by Gerrit - the friendly Code Review server
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 avatarMulu He <muluhe@codeaurora.org>
parent f02d235b
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -977,7 +977,11 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id)

	spin_lock_init(&drvdata->spinlock);

	drvdata->cpu = pdata ? pdata->cpu : 0;
	drvdata->cpu = pdata ? pdata->cpu : -ENODEV;
	if (drvdata->cpu == -ENODEV) {
		dev_info(dev, "CPU not available\n");
		return -ENODEV;
	}

	cpus_read_lock();
	ret = smp_call_function_single(drvdata->cpu,
+6 −4
Original line number Diff line number Diff line
@@ -103,14 +103,16 @@ int of_coresight_get_cpu(const struct device_node *node)
	struct device_node *dn;

	dn = of_parse_phandle(node, "cpu", 0);
	/* Affinity defaults to CPU0 */

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

	cpu = of_cpu_node_to_id(dn);
	of_node_put(dn);

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