On 26/12/2024 1:10 am, Jie Gan wrote:
> Add support for new APB clock-name. If the function fails
> to obtain the clock with the name "apb_pclk", it will
> attempt to acquire the clock with the name "apb".
>
> Signed-off-by: Jie Gan <quic_jiegan(a)quicinc.com>
> ---
> include/linux/coresight.h | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/coresight.h b/include/linux/coresight.h
> index 17276965ff1d..157c4bd009a1 100644
> --- a/include/linux/coresight.h
> +++ b/include/linux/coresight.h
> @@ -459,8 +459,11 @@ static inline struct clk *coresight_get_enable_apb_pclk(struct device *dev)
> int ret;
>
> pclk = clk_get(dev, "apb_pclk");
> - if (IS_ERR(pclk))
> - return NULL;
> + if (IS_ERR(pclk)) {
> + pclk = clk_get(dev, "apb");
> + if (IS_ERR(pclk))
> + return NULL;
> + }
>
> ret = clk_prepare_enable(pclk);
> if (ret) {
Reviewed-by: James Clark <james.clark(a)linaro.org>
On 09/01/2025 21:53, Ilkka Koskinen wrote:
> Trying to record a trace on kernel with 64k pages resulted in -ENOMEM.
> This happens due to a bug in calculating the number of table pages, which
> returns zero. Fix the issue by rounding up.
>
> $ perf record --kcore -e cs_etm/@tmc_etr55,cycacc,branch_broadcast/k --per-thread taskset --cpu-list 1 dd if=/dev/zero of=/dev/null
> failed to mmap with 12 (Cannot allocate memory)
>
Needs a Fixes tag.
Fixes : 8ed536b1e283 ("coresight: catu: Add support for scatter gather
tables")
> Signed-off-by: Ilkka Koskinen <ilkka(a)os.amperecomputing.com>
> ---
> drivers/hwtracing/coresight/coresight-catu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-catu.c b/drivers/hwtracing/coresight/coresight-catu.c
> index 275cc0d9f505..3378bb77e6b4 100644
> --- a/drivers/hwtracing/coresight/coresight-catu.c
> +++ b/drivers/hwtracing/coresight/coresight-catu.c
> @@ -269,7 +269,7 @@ catu_init_sg_table(struct device *catu_dev, int node,
> * Each table can address upto 1MB and we can have
> * CATU_PAGES_PER_SYSPAGE tables in a system page.
> */
> - nr_tpages = DIV_ROUND_UP(size, SZ_1M) / CATU_PAGES_PER_SYSPAGE;
> + nr_tpages = DIV_ROUND_UP(size, CATU_PAGES_PER_SYSPAGE * SZ_1M);
> catu_table = tmc_alloc_sg_table(catu_dev, node, nr_tpages,
> size >> PAGE_SHIFT, pages);
> if (IS_ERR(catu_table))
Looks good to me, I will queue this later for v6.15.
Suzuki
Greg,
Please find the changes targeting v6.14 for the CoreSight self hosted tracing
subsystem.
Kindly pull
Suzuki
The following changes since commit fac04efc5c793dccbd07e2d59af9f90b7fc0dca4:
Linux 6.13-rc2 (2024-12-08 14:03:39 -0800)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/coresight/linux.git tags/coresight-next-v6.14
for you to fetch changes up to 56e14a21cee4ea6074b956a9ff2e406de5ad6548:
coresight-tpda: Optimize the function of reading element size (2024-12-13 10:25:15 +0000)
----------------------------------------------------------------
coresight: Updates for Linux v6.14
Coresight self-hosted tracing subsystem updates for v6.14 includes:
- Support for static traceid allocation for devices
- Support for impdef, static trace filtering in Qualcomm replicators
- Miscellaneous fixes
Signed-off-by: Suzuki K Poulose <suzuki.poulose(a)arm.com>
----------------------------------------------------------------
James Clark (1):
coresight: Drop atomics in connection refcounts
Mao Jinlong (3):
dt-bindings: arm: Add arm,static-trace-id for coresight dummy source
coresight: Add support to get static id for system trace sources
coresight: dummy: Add static trace id support for dummy source
Pei Xiao (1):
coresight: Fix dsb_mode_store() unsigned val is never less than zero
Songwei Chai (1):
Coresight: Narrow down the matching range of tpdm
Tao Zhang (4):
dt-bindings: arm: qcom,coresight-static-replicator: Add property for source filtering
coresight: Add a helper to check if a device is source
coresight: Add support for trace filtering by source
coresight-tpda: Optimize the function of reading element size
.../sysfs-bus-coresight-devices-dummy-source | 15 +++
.../bindings/arm/arm,coresight-dummy-source.yaml | 6 ++
.../arm/arm,coresight-static-replicator.yaml | 19 +++-
drivers/hwtracing/coresight/coresight-core.c | 113 +++++++++++++++++----
drivers/hwtracing/coresight/coresight-dummy.c | 81 +++++++++++++--
drivers/hwtracing/coresight/coresight-funnel.c | 6 +-
drivers/hwtracing/coresight/coresight-platform.c | 27 +++++
drivers/hwtracing/coresight/coresight-replicator.c | 6 +-
drivers/hwtracing/coresight/coresight-tpda.c | 19 +++-
drivers/hwtracing/coresight/coresight-tpdm.c | 7 +-
drivers/hwtracing/coresight/coresight-trace-id.c | 43 +++++---
drivers/hwtracing/coresight/coresight-trace-id.h | 9 ++
include/linux/coresight.h | 17 +++-
13 files changed, 309 insertions(+), 59 deletions(-)
create mode 100644 Documentation/ABI/testing/sysfs-bus-coresight-devices-dummy-source
On 09/01/2025 12:01, Yeoreum Yun wrote:
> Hi Suzuki,
>
>> 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.
>>
>
> That was i've tried but I've accepted Mike's opinion that
> it's enough to check whether CS_MODE_DISABLED via coresight_get_mode()
> in *_store().
>
> "the .._store functions in sysfs should use coresight_get_mode() to ensure
> this is set to CS_MODE_DISABLED before altering the config,
> which ensures that the trace system is inactive.
> We don't' really care about reading the config if trace is running."
There are two issues with that :
1. Sprinkling the get_mode call in each sysfs stor function doesn't look
good to me.
2. Someone preparing for a sysfs session must not be prevented from
doing so just because there is a perf session running.
Suzuki
> Thanks.
>
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(a)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
Hi
On 11/11/2024 14:12, Alexander Shishkin wrote:
> Uwe Kleine-König <u.kleine-koenig(a)baylibre.com> writes:
>
>> After commit 0edb555a65d1 ("platform: Make platform_driver::remove()
>> return void") .remove() is (again) the right callback to implement for
>> platform drivers.
>>
>> Convert all platform drivers below drivers/hwtracing to use .remove(),
>> with the eventual goal to drop struct platform_driver::remove_new(). As
>> .remove() and .remove_new() have the same prototypes, conversion is done
>> by just changing the structure member name in the driver initializer.
>>
>> Also adapt some whitespace to make indention consistent.
>>
>> Signed-off-by: Uwe Kleine-König <u.kleine-koenig(a)baylibre.com>
>
> Acked-by: Alexander Shishkin <alexander.shishkin(a)linux.intel.com>
>
>> ---
>> Hello,
>>
>> I did a single patch for all of drivers/hwtracing. While I usually
>> prefer to do one logical change per patch, this seems to be
>> overengineering here as the individual changes are really trivial and
>> shouldn't be much in the way for stable backports. But I'll happily
>> split the patch if you prefer it split. Maybe split for coresight vs.
>> intel_th? Also if you object the indentation stuff, I can rework that.
>
> I'm fine with it as is.
>
>> This is based on today's next, if conflicts arise when you apply it at
>> some later time and don't want to resolve them, feel free to just drop
>> the changes to the conflicting files. I'll notice and followup at a
>> later time then. Or ask me for a fixed resend. (Having said that, I
>> recommend b4 am -3 + git am -3 which should resolve most conflicts just
>> fine.)
>
> Does anybody want to pick this up or should I? I'm fine either way, but
> if there are any conflicts they won't be from my end of things, so it
> might make sense to take it via the coresight path.
I am happy to take them via coresight tree and queue them for v6.14
Suzuki
>
> Thanks,
> --
> Alex
On 07/01/2025 13:01, Yeoreum Yun wrote:
> Hi Suzuki,
>
>> Hi Levi
>>
>> On 23/12/2024 18:53, Yeoreum Yun wrote:
>>> While enable active config via cscfg_csdev_enable_active_config(),
>>> active config could be deactivated via configfs' sysfs interface.
>>> This could make UAF issue in below scenario:
>>>
>>> CPU0 CPU1
>>> (sysfs enable) load module
>>> cscfg_load_config_sets()
>>> activate config. // sysfs
>>> (sys_active_cnt == 1)
>>> ...
>>> cscfg_csdev_enable_active_config()
>>> lock(csdev->cscfg_csdev_lock)
>>> // here load config activate by CPU1
>>> unlock(csdev->cscfg_csdev_lock)
>>>
>>> deactivate config // sysfs
>>> (sys_activec_cnt == 0)
>>> cscfg_unload_config_sets()
>>> unload module
>>>
>>> // access to config_desc which freed
>>> // while unloading module.
>>> cfs_csdev_enable_config
>>>
>>> To address this, introduce sys_enable_cnt in cscfg_mgr to prevent
>>> deactivate while there is enabled configuration.
>>
>> Thanks for the finding the problem and the detailed description + patch. I
>> have some concerns on the fix, please find it below.
>>
>>>
>>
>>
>> So we have 3 atomic counters now !
>> cscfg_mgr->sys_active_cnt // Global count
>> config->active_cnt // Per config count,
>>
>> And another one which this one introduces.
>>
>> cscfg_mgr->sys_enable_cnt // ?
>>
>>
>> And config->active_cnt is always ever 0 or 1. i.e., it is not really a
>> reference counter at the moment but it indicates whether it is active or
>> not. Could we not use that for tracking the references on the specific
>> config ?
>>
>> i.e., every time we "enable_active_config" atomic_inc(config->active_cnt)
>>
>> and disable_active_config() always decrements the config. These could be
>> wrapped in cscfg_get() cscfg_put() which would, inc/dec the refcounts
>> and also drop the "module" reference when the active_cnt == 0
>
> This action is done via _cscfg_activate_config() already but its
> activation is done via "sysfs".
> and the checking active_cnt, I think it would increase lots of complex.
I don't understand. We have this today :
cscfg_config_desc which is getting de-activated. This has reference to
the module (owner). If someone is using this config_desc in running
session (be it perf or sysfg), it must be refcounted. As such I don't
see that the cscfg is refcounted anywhere. (The active_cnt indicates if
this has been activated, but not used in a session). If we have a
refcount on the "cscfg_config_desc" for each active session, we could
prevent/delay unloading the module until the last one drops.
Something like this is what I was checking ?
coresight: cscfg: Hold refcount on the config for active
sessions
Signed-off-by: Suzuki K Poulose <suzuki.poulose(a)arm.com>
---
.../hwtracing/coresight/coresight-config.h | 2 +-
.../hwtracing/coresight/coresight-syscfg.c | 24 +++++++++++++------
2 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/drivers/hwtracing/coresight/coresight-config.h
b/drivers/hwtracing/coresight/coresight-config.h
index 6ba013975741..84cdde6f0e4d 100644
--- a/drivers/hwtracing/coresight/coresight-config.h
+++ b/drivers/hwtracing/coresight/coresight-config.h
@@ -228,7 +228,7 @@ struct cscfg_feature_csdev {
* @feats_csdev:references to the device features to enable.
*/
struct cscfg_config_csdev {
- const struct cscfg_config_desc *config_desc;
+ struct cscfg_config_desc *config_desc;
struct coresight_device *csdev;
bool enabled;
struct list_head node;
diff --git a/drivers/hwtracing/coresight/coresight-syscfg.c
b/drivers/hwtracing/coresight/coresight-syscfg.c
index 11138a9762b0..53baeaaf907f 100644
--- a/drivers/hwtracing/coresight/coresight-syscfg.c
+++ b/drivers/hwtracing/coresight/coresight-syscfg.c
@@ -914,15 +914,20 @@ static int _cscfg_activate_config(unsigned long
cfg_hash)
return err;
}
+static void cscfg_config_desc_put(struct cscfg_config_desc *config_desc)
+{
+ if (!atomic_dec_return(&config_desc->active_cnt))
+ cscfg_owner_put(config_desc->load_owner);
+}
+
static void _cscfg_deactivate_config(unsigned long cfg_hash)
{
struct cscfg_config_desc *config_desc;
list_for_each_entry(config_desc, &cscfg_mgr->config_desc_list, item) {
if ((unsigned long)config_desc->event_ea->var == cfg_hash) {
- atomic_dec(&config_desc->active_cnt);
atomic_dec(&cscfg_mgr->sys_active_cnt);
- cscfg_owner_put(config_desc->load_owner);
+ cscfg_config_desc_put(config_desc);
dev_dbg(cscfg_device(), "Deactivate config %s.\n", config_desc->name);
break;
}
@@ -1047,7 +1052,7 @@ int cscfg_csdev_enable_active_config(struct
coresight_device *csdev,
unsigned long cfg_hash, int preset)
{
struct cscfg_config_csdev *config_csdev_active = NULL,
*config_csdev_item;
- const struct cscfg_config_desc *config_desc;
+ struct cscfg_config_desc *config_desc;
unsigned long flags;
int err = 0;
@@ -1062,8 +1067,8 @@ int cscfg_csdev_enable_active_config(struct
coresight_device *csdev,
spin_lock_irqsave(&csdev->cscfg_csdev_lock, flags);
list_for_each_entry(config_csdev_item, &csdev->config_csdev_list, node) {
config_desc = config_csdev_item->config_desc;
- if ((atomic_read(&config_desc->active_cnt)) &&
- ((unsigned long)config_desc->event_ea->var == cfg_hash)) {
+ if ((unsigned long)config_desc->event_ea->var == cfg_hash &&
+ atomic_inc_not_zero(&config_desc->active_cnt)) {
config_csdev_active = config_csdev_item;
csdev->active_cscfg_ctxt = (void *)config_csdev_active;
break;
@@ -1091,12 +1096,15 @@ int cscfg_csdev_enable_active_config(struct
coresight_device *csdev,
* Set enabled if OK, err if not.
*/
spin_lock_irqsave(&csdev->cscfg_csdev_lock, flags);
- if (csdev->active_cscfg_ctxt)
+ if (csdev->active_cscfg_ctxt == config_csdev_active)
config_csdev_active->enabled = true;
else
err = -EBUSY;
spin_unlock_irqrestore(&csdev->cscfg_csdev_lock, flags);
}
+ if (err)
+ cscfg_config_desc_put(config_desc);
+
}
return err;
}
@@ -1136,8 +1144,10 @@ void cscfg_csdev_disable_active_config(struct
coresight_device *csdev)
spin_unlock_irqrestore(&csdev->cscfg_csdev_lock, flags);
/* true if there was an enabled active config */
- if (config_csdev)
+ if (config_csdev) {
cscfg_csdev_disable_config(config_csdev);
+ cscfg_config_desc_put(config_csdev->config_desc);
+ }
}
EXPORT_SYMBOL_GPL(cscfg_csdev_disable_active_config);
--
> because, if so, it should iterate all config in each csdev.
> So, I believe it is the reason why the activation and module_cnt get via "sysfs"
> to prevent iterating every config in csdev when config unload.
>
> although, active_cnt in each config added to list in csdev be 0 or 1,
> the module could be >= 1 (by sum of active_cnt which have the same
> module owner). So I'm skeptical to use active_cnt like "reference cnt"
> and That's why I decide to use "sys_enable_cnt"
>>
>>> Signed-off-by: Yeoreum Yun <yeoreum.yun(a)arm.com>
>>> ---
>>> from v1 to v2:
>>> - modify commit message.
>>> ---
>>> .../hwtracing/coresight/coresight-etm4x-core.c | 3 +++
>>> drivers/hwtracing/coresight/coresight-syscfg.c | 18 ++++++++++++++++--
>>> drivers/hwtracing/coresight/coresight-syscfg.h | 2 ++
>>> 3 files changed, 21 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c
>>> index 86893115df17..6218ef40acbc 100644
>>> --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c
>>> +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c
>>> @@ -986,6 +986,9 @@ static void etm4_disable_sysfs(struct coresight_device *csdev)
>>> smp_call_function_single(drvdata->cpu, etm4_disable_hw, drvdata, 1);
>>>
>>> raw_spin_unlock(&drvdata->spinlock);
>>> +
>>> + cscfg_csdev_disable_active_config(csdev);
>>
>> This looks like a separate "fix" from what you are trying to address. Please
>> could split this ?
>
> I don't think so, because without this calling, the "sys_enable_cnt"
> never down, It makes error.
My point is, we need to "disable_active_config" irrespective of this
race, in the sysfs path. So this should be a fix apart from fixing the race.
Suzuki
>
>> Also, would like to hear what Mike has to say about this change.
>
> IIRC, I followed his suggestion.
>
> Thanks!
>
Hi Levi
On 23/12/2024 18:53, Yeoreum Yun wrote:
> While enable active config via cscfg_csdev_enable_active_config(),
> active config could be deactivated via configfs' sysfs interface.
> This could make UAF issue in below scenario:
>
> CPU0 CPU1
> (sysfs enable) load module
> cscfg_load_config_sets()
> activate config. // sysfs
> (sys_active_cnt == 1)
> ...
> cscfg_csdev_enable_active_config()
> lock(csdev->cscfg_csdev_lock)
> // here load config activate by CPU1
> unlock(csdev->cscfg_csdev_lock)
>
> deactivate config // sysfs
> (sys_activec_cnt == 0)
> cscfg_unload_config_sets()
> unload module
>
> // access to config_desc which freed
> // while unloading module.
> cfs_csdev_enable_config
>
> To address this, introduce sys_enable_cnt in cscfg_mgr to prevent
> deactivate while there is enabled configuration.
Thanks for the finding the problem and the detailed description + patch.
I have some concerns on the fix, please find it below.
>
So we have 3 atomic counters now !
cscfg_mgr->sys_active_cnt // Global count
config->active_cnt // Per config count,
And another one which this one introduces.
cscfg_mgr->sys_enable_cnt // ?
And config->active_cnt is always ever 0 or 1. i.e., it is not really a
reference counter at the moment but it indicates whether it is active or
not. Could we not use that for tracking the references on the specific
config ?
i.e., every time we "enable_active_config" atomic_inc(config->active_cnt)
and disable_active_config() always decrements the config. These could be
wrapped in cscfg_get() cscfg_put() which would, inc/dec the refcounts
and also drop the "module" reference when the active_cnt == 0
> Signed-off-by: Yeoreum Yun <yeoreum.yun(a)arm.com>
> ---
> from v1 to v2:
> - modify commit message.
> ---
> .../hwtracing/coresight/coresight-etm4x-core.c | 3 +++
> drivers/hwtracing/coresight/coresight-syscfg.c | 18 ++++++++++++++++--
> drivers/hwtracing/coresight/coresight-syscfg.h | 2 ++
> 3 files changed, 21 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c
> index 86893115df17..6218ef40acbc 100644
> --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c
> +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c
> @@ -986,6 +986,9 @@ static void etm4_disable_sysfs(struct coresight_device *csdev)
> smp_call_function_single(drvdata->cpu, etm4_disable_hw, drvdata, 1);
>
> raw_spin_unlock(&drvdata->spinlock);
> +
> + cscfg_csdev_disable_active_config(csdev);
This looks like a separate "fix" from what you are trying to address.
Please could split this ?
Also, would like to hear what Mike has to say about this change.
Suzuki
> +
> cpus_read_unlock();
>
> /*
> diff --git a/drivers/hwtracing/coresight/coresight-syscfg.c b/drivers/hwtracing/coresight/coresight-syscfg.c
> index a70c1454b410..dfa7dcbaf25d 100644
> --- a/drivers/hwtracing/coresight/coresight-syscfg.c
> +++ b/drivers/hwtracing/coresight/coresight-syscfg.c
> @@ -953,7 +953,8 @@ int cscfg_config_sysfs_activate(struct cscfg_config_desc *config_desc, bool acti
> cscfg_mgr->sysfs_active_config = cfg_hash;
> } else {
> /* disable if matching current value */
> - if (cscfg_mgr->sysfs_active_config == cfg_hash) {
> + if (cscfg_mgr->sysfs_active_config == cfg_hash &&
> + !atomic_read(&cscfg_mgr->sys_enable_cnt)) {
> _cscfg_deactivate_config(cfg_hash);
> cscfg_mgr->sysfs_active_config = 0;
> } else
> @@ -1055,6 +1056,12 @@ int cscfg_csdev_enable_active_config(struct coresight_device *csdev,
> if (!atomic_read(&cscfg_mgr->sys_active_cnt))
> return 0;
>
> + /*
> + * increment sys_enable_cnt first to prevent deactivate the config
> + * while enable active config.
> + */
> + atomic_inc(&cscfg_mgr->sys_enable_cnt);
> +
> /*
> * Look for matching configuration - set the active configuration
> * context if found.
> @@ -1098,6 +1105,10 @@ int cscfg_csdev_enable_active_config(struct coresight_device *csdev,
> raw_spin_unlock_irqrestore(&csdev->cscfg_csdev_lock, flags);
> }
> }
> +
> + if (!config_csdev_active || err)
> + atomic_dec(&cscfg_mgr->sys_enable_cnt);
> +
> return err;
> }
> EXPORT_SYMBOL_GPL(cscfg_csdev_enable_active_config);
> @@ -1129,8 +1140,10 @@ void cscfg_csdev_disable_active_config(struct coresight_device *csdev)
> if (config_csdev) {
> if (!config_csdev->enabled)
> config_csdev = NULL;
> - else
> + else {
> config_csdev->enabled = false;
> + atomic_dec(&cscfg_mgr->sys_enable_cnt);
> + }
> }
> csdev->active_cscfg_ctxt = NULL;
> raw_spin_unlock_irqrestore(&csdev->cscfg_csdev_lock, flags);
> @@ -1179,6 +1192,7 @@ static int cscfg_create_device(void)
> INIT_LIST_HEAD(&cscfg_mgr->config_desc_list);
> INIT_LIST_HEAD(&cscfg_mgr->load_order_list);
> atomic_set(&cscfg_mgr->sys_active_cnt, 0);
> + atomic_set(&cscfg_mgr->sys_enable_cnt, 0);
> cscfg_mgr->load_state = CSCFG_NONE;
>
> /* setup the device */
> diff --git a/drivers/hwtracing/coresight/coresight-syscfg.h b/drivers/hwtracing/coresight/coresight-syscfg.h
> index 66e2db890d82..2fc397919985 100644
> --- a/drivers/hwtracing/coresight/coresight-syscfg.h
> +++ b/drivers/hwtracing/coresight/coresight-syscfg.h
> @@ -38,6 +38,7 @@ enum cscfg_load_ops {
> * @config_desc_list: List of system configuration descriptors to load into registered devices.
> * @load_order_list: Ordered list of owners for dynamically loaded configurations.
> * @sys_active_cnt: Total number of active config descriptor references.
> + * @sys_enable_cnt: Total number of enable of active config descriptor references.
> * @cfgfs_subsys: configfs subsystem used to manage configurations.
> * @sysfs_active_config:Active config hash used if CoreSight controlled from sysfs.
> * @sysfs_active_preset:Active preset index used if CoreSight controlled from sysfs.
> @@ -50,6 +51,7 @@ struct cscfg_manager {
> struct list_head config_desc_list;
> struct list_head load_order_list;
> atomic_t sys_active_cnt;
> + atomic_t sys_enable_cnt;
> struct configfs_subsystem cfgfs_subsys;
> u32 sysfs_active_config;
> int sysfs_active_preset;
> --
> LEVI:{C3F47F37-75D8-414A-A8BA-3980EC8A46D7}
>