Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yeoreum Yun <yeoreum.yun@arm.com>
To: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Yeoreum Yun <yeoreum.yun@arm.com>,
	coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, mike.leach@arm.com,
	james.clark@linaro.org, alexander.shishkin@linux.intel.com,
	leo.yan@arm.com, jie.gan@oss.qualcomm.com
Subject: Re: [PATCH v8 08/13] coresight: etm4x: fix inconsistencies with sysfs configuration
Date: Thu, 16 Jul 2026 20:57:58 +0100	[thread overview]
Message-ID: <alk3xhoECdrVJ-3M@e129823.arm.com> (raw)
In-Reply-To: <78a81992-6beb-4caf-b7bd-5cab635a6de1@arm.com>

[...]

> >   static void etm4_enable_sysfs_smp_call(void *info)
> >   {
> >   	struct etm4_enable_arg *arg = info;
> > +	struct etmv4_drvdata *drvdata;
> >   	struct coresight_device *csdev;
> > +	unsigned long cfg_hash;
> > +	int preset;
> >   	if (WARN_ON(!arg))
> >   		return;
> > -	csdev = arg->drvdata->csdev;
> > +	drvdata = arg->drvdata;
> > +	csdev = drvdata->csdev;
> >   	if (!coresight_take_mode(csdev, CS_MODE_SYSFS)) {
> >   		/* Someone is already using the tracer */
> >   		arg->rc = -EBUSY;
> >   		return;
> >   	}
> > -	arg->rc = etm4_enable_hw(arg->drvdata);
> > +	drvdata->active_config = arg->config;
> 
> I see, we copy the sysfs config to init_arg and then apply it here.

Yes it is. Thanks!

> 
> > -	/* The tracer didn't start */
> > +	/* enable any config activated by configfs */
> > +	cscfg_config_sysfs_get_active_cfg(&cfg_hash, &preset);
> > +	if (cfg_hash) {
> > +		arg->rc = cscfg_csdev_enable_active_config(csdev,
> > +							   cfg_hash,
> > +							   preset);
> > +		if (arg->rc)
> > +			goto err;
> > +	}
> > +
> > +	drvdata->trcid = arg->path->trace_id;
> > +
> > +	/* Tracer will never be paused in sysfs mode */
> > +	drvdata->paused = false;
> > +
> > +	arg->rc = etm4_enable_hw(drvdata);
> >   	if (arg->rc) {
> > -		coresight_set_mode(csdev, CS_MODE_DISABLED);
> > -		return;
> > +		cscfg_csdev_disable_active_config(csdev);
> > +		goto err;
> >   	}
> > +	drvdata->sticky_enable = true;
> >   	csdev->path = arg->path;
> > +
> > +	return;
> > +err:
> > +	/* The tracer didn't start */
> > +	coresight_set_mode(csdev, CS_MODE_DISABLED);
> 
> Do we need to reset the active_config ?

I don't think we don't need to reset active_config since
it's a failure path and at the next time, the active_config will
be initialised with the drvdata->config again if next trial is via
sysfs.

If the next trial is perf, it clears active_config in
etm4_parse_event_config().

Therefore, we wouldn't need to reset the active_config before
relasing mode.

> 
> 
> > diff --git a/drivers/hwtracing/coresight/coresight-etm4x.h b/drivers/hwtracing/coresight/coresight-etm4x.h
> > index c0f7da17a186..a974e4d05838 100644
> > --- a/drivers/hwtracing/coresight/coresight-etm4x.h
> > +++ b/drivers/hwtracing/coresight/coresight-etm4x.h
> > @@ -1068,6 +1068,7 @@ struct etmv4_save_state {
> >    *		allows tracing at all ELs. We don't want to compute this
> >    *		at runtime, due to the additional setting of TRFCR_CX when
> >    *		in EL2. Otherwise, 0.
> > + * @active_config:	structure holding current applied configuration parameters.
> >    * @config:	structure holding configuration parameters.
> 
> Please could you update the documentation for "config" -> holding sysfs mode
> configuration.

Thanks I'll update accordingly.

-- 
Sincerely,
Yeoreum Yun


  reply	other threads:[~2026-07-16 19:58 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-29  8:59 [PATCH v8 00/13] fix several inconsistencies with sysfs configuration in etmX Yeoreum Yun
2026-06-29  8:59 ` [PATCH v8 01/13] coresight: etm4x: fix wrong check of etm4x_sspcicrn_present() Yeoreum Yun
2026-06-29  8:59 ` [PATCH v8 02/13] coresight: etm4x: fix underflow for usage of (nrseqstate - 1) Yeoreum Yun
2026-06-29  8:59 ` [PATCH v8 03/13] coresight: etm4x: introduce struct etm4_caps Yeoreum Yun
2026-06-29  8:59 ` [PATCH v8 04/13] coresight: etm4x: exclude ss_status from drvdata->config Yeoreum Yun
2026-06-29  8:59 ` [PATCH v8 05/13] coresight: etm4x: remove s_ex_level from config Yeoreum Yun
2026-06-29  8:59 ` [PATCH v8 06/13] coresight: etm4x: remove redundant fields in etmv4_save_state Yeoreum Yun
2026-06-29  9:00 ` [PATCH v8 07/13] coresight: etm4x: fix leaked trace id Yeoreum Yun
2026-06-29  9:00 ` [PATCH v8 08/13] coresight: etm4x: fix inconsistencies with sysfs configuration Yeoreum Yun
2026-07-06 17:21   ` Leo Yan
2026-07-06 18:16     ` Yeoreum Yun
2026-07-07  8:25       ` Leo Yan
2026-07-07  8:59         ` Yeoreum Yun
2026-07-07  9:54           ` Yeoreum Yun
2026-07-16 12:42             ` Suzuki K Poulose
2026-07-06 17:39   ` Leo Yan
2026-07-06 18:20     ` Yeoreum Yun
2026-07-07  8:07       ` Leo Yan
2026-07-16 12:41     ` Suzuki K Poulose
2026-07-16 20:09       ` Yeoreum Yun
2026-07-16 12:46   ` Suzuki K Poulose
2026-07-16 19:57     ` Yeoreum Yun [this message]
2026-06-29  9:00 ` [PATCH v8 09/13] coresight: etm4x: missing cscfg_csdev_disable_active_config() in perf enable Yeoreum Yun
2026-06-29  9:00 ` [PATCH v8 10/13] coresight: etm3x: change drvdata->spinlock type to raw_spin_lock_t Yeoreum Yun
2026-06-29  9:00 ` [PATCH v8 11/13] coresight: etm3x: introduce struct etm_caps Yeoreum Yun
2026-06-29  9:00 ` [PATCH v8 12/13] coresight: etm3x: fix inconsistencies with sysfs configuration Yeoreum Yun
2026-06-29  9:00 ` [PATCH v8 13/13] coresight: etm3x: remove redundant cpu online check on etm_enable_sysfs() Yeoreum Yun
2026-07-16 12:48 ` [PATCH v8 00/13] fix several inconsistencies with sysfs configuration in etmX Suzuki K Poulose
2026-07-16 19:24   ` Yeoreum Yun
2026-07-16 20:11     ` 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=alk3xhoECdrVJ-3M@e129823.arm.com \
    --to=yeoreum.yun@arm.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=coresight@lists.linaro.org \
    --cc=james.clark@linaro.org \
    --cc=jie.gan@oss.qualcomm.com \
    --cc=leo.yan@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike.leach@arm.com \
    --cc=suzuki.poulose@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