2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-23 12:43:55 +08:00

coresight: tmc-etr: Relax collection of trace from sysfs mode

Since the ETR now uses mode specific buffers, we can reliably
provide the trace data captured in sysfs mode, even when the ETR
is operating in PERF mode.

Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Suzuki K Poulose 2018-09-20 13:17:52 -06:00 committed by Greg Kroah-Hartman
parent 96a7f64400
commit cad5f8d399

View File

@ -1168,19 +1168,17 @@ int tmc_read_prepare_etr(struct tmc_drvdata *drvdata)
goto out; goto out;
} }
/* Don't interfere if operated from Perf */ /*
if (drvdata->mode == CS_MODE_PERF) { * We can safely allow reads even if the ETR is operating in PERF mode,
ret = -EINVAL; * since the sysfs session is captured in mode specific data.
goto out; * If drvdata::sysfs_data is NULL the trace data has been read already.
} */
/* If sysfs_buf is NULL the trace data has been read already */
if (!drvdata->sysfs_buf) { if (!drvdata->sysfs_buf) {
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
/* Disable the TMC if we are trying to read from a running session */ /* Disable the TMC if we are trying to read from a running session. */
if (drvdata->mode == CS_MODE_SYSFS) if (drvdata->mode == CS_MODE_SYSFS)
tmc_etr_disable_hw(drvdata); tmc_etr_disable_hw(drvdata);