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

Commit ee19f9ba authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "coresight: etm4x: Fix ETM probe when booting without all cores"

parents aa810ad4 d1338e7f
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2014,2016, The Linux Foundation. All rights reserved.
 * Copyright (c) 2014,2016,2018, The Linux Foundation. All rights reserved.
 */

#include <linux/kernel.h>
@@ -980,12 +980,16 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id)
	drvdata->cpu = pdata ? pdata->cpu : 0;

	cpus_read_lock();
	etmdrvdata[drvdata->cpu] = drvdata;

	if (smp_call_function_single(drvdata->cpu,
				etm4_init_arch_data,  drvdata, 1))
	ret = smp_call_function_single(drvdata->cpu,
					etm4_init_arch_data, drvdata, 1);
	if (ret) {
		dev_err(dev, "ETM arch init failed\n");

		cpus_read_unlock();
		return ret;
	} else if (!etm4_arch_supported(drvdata->arch)) {
		cpus_read_unlock();
		return -EINVAL;
	}
	if (!etm4_count++) {
		cpuhp_setup_state_nocalls_cpuslocked(CPUHP_AP_ARM_CORESIGHT_STARTING,
						     "arm/coresight4:starting",
@@ -1000,11 +1004,6 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id)

	cpus_read_unlock();

	if (etm4_arch_supported(drvdata->arch) == false) {
		ret = -EINVAL;
		goto err_arch_supported;
	}

	etm4_init_trace_id(drvdata);
	etm4_set_default(&drvdata->config);

@@ -1027,6 +1026,7 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id)
	}

	pm_runtime_put(&adev->dev);
	etmdrvdata[drvdata->cpu] = drvdata;
	dev_info(dev, "CPU%d: ETM v%d.%d initialized\n",
		 drvdata->cpu, drvdata->arch >> 4, drvdata->arch & 0xf);