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

Commit c1d02031 authored by Rama Aparna Mallavarapu's avatar Rama Aparna Mallavarapu
Browse files

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



We need to fail probe when ETM init fails due to CPU being unavailable
at probe time. There is no current support to defer probe when we hot
plug in the CPU. Also, check for the architecture version of ETM HW
only when ETM init is successful.

Change-Id: I0fc7b3ca5c919a74dfecedcd6278a0e0679f276f
Signed-off-by: default avatarSatyajit Desai <sadesai@codeaurora.org>
Signed-off-by: default avatarRama Aparna Mallavarapu <aparnam@codeaurora.org>
parent c69de4e0
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -987,12 +987,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) == false) {
		cpus_read_unlock();
		return -EINVAL;
	}
	if (!etm4_count++) {
		cpuhp_setup_state_nocalls_cpuslocked(CPUHP_AP_ARM_CORESIGHT_STARTING,
						     "arm/coresight4:starting",
@@ -1007,11 +1011,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);

@@ -1034,6 +1033,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, "%s initialized\n", (char *)id->data);

	if (boot_enable) {