linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Suzuki K Poulose <suzuki.poulose@arm.com>
To: Yeoreum Yun <yeoreum.yun@arm.com>,
	mike.leach@linaro.org, james.clark@linaro.org,
	alexander.shishkin@linux.intel.com
Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/4] coresight/etm4x: disallow altering config via sysfs while enabled
Date: Thu, 9 Jan 2025 11:46:45 +0000	[thread overview]
Message-ID: <6bbc9b64-3ecb-46c3-8c4e-55dba6301ef3@arm.com> (raw)
In-Reply-To: <20241221165934.1161856-2-yeoreum.yun@arm.com>

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@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


  reply	other threads:[~2025-01-09 11:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-21 16:59 [PATCH 0/4] small fix for configuaring etm csdev via sysfs Yeoreum Yun
2024-12-21 16:59 ` [PATCH 1/4] coresight/etm4x: disallow altering config via sysfs while enabled Yeoreum Yun
2025-01-09 11:46   ` Suzuki K Poulose [this message]
2025-01-09 12:01     ` Yeoreum Yun
2025-01-09 12:21       ` Suzuki K Poulose
2025-01-09 12:27         ` Yeoreum Yun
2025-01-09 17:39         ` Yeoreum Yun
2025-01-09 17:48           ` Yeo Reum Yun
2025-03-12  6:45             ` Yeo Reum Yun
2024-12-21 16:59 ` [PATCH 2/4] coresight/etm4x: remove redundant usage of drvdata->spinlock Yeoreum Yun
2024-12-21 16:59 ` [PATCH 3/4] coresight/etm3x: disallow altering config via sysfs while enabled Yeoreum Yun
2024-12-21 16:59 ` [PATCH 4/4] coresight/etm3x: remove redundant usage of drvdata->spinlock Yeoreum Yun
2024-12-31 14:39 ` [PATCH 0/4] small fix for configuaring etm csdev via sysfs Yeo Reum Yun
2025-05-02 10:53 ` Yeoreum Yun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6bbc9b64-3ecb-46c3-8c4e-55dba6301ef3@arm.com \
    --to=suzuki.poulose@arm.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=coresight@lists.linaro.org \
    --cc=james.clark@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike.leach@linaro.org \
    --cc=yeoreum.yun@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).