[PATCH 1/4] coresight/etm4x: disallow altering config via sysfs while enabled
Suzuki K Poulose
suzuki.poulose at arm.com
Thu Jan 9 03:46:45 PST 2025
Hi Levi,
On 21/12/2024 16:59, Yeoreum Yun wrote:
> When etm4x configuration is modified via sysfs while etm4x is being
> enabled via perf, enabled etm4x could run with different configuration
> from perf_event.
>
> To address this, disallow altering config via sysfs while csdev is enabled.
>
> Signed-off-by: Yeoreum Yun <yeoreum.yun at arm.com>
> ---
> .../coresight/coresight-etm4x-sysfs.c | 132 +++++++++++++++++-
> 1 file changed, 128 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c
> index 11e865b8e824..cc1f112921d7 100644
> --- a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c
> +++ b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c
> @@ -174,6 +174,9 @@ static ssize_t reset_store(struct device *dev,
> if (kstrtoul(buf, 16, &val))
> return -EINVAL;
>
> + if (coresight_get_mode(drvdata->csdev))
> + return -EBUSY;
> +
Is it not better to have separate "configs" for perf and sysfs ?
And etmX driver can populate the "running" config, based on the
mode specific config. That way, the configs can be updated
independently without affecting the running config or the perf one.
Suzuki
More information about the linux-arm-kernel
mailing list