public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] coresight: cti: Fix DT filter signals silently ignored
@ 2026-04-26  9:59 Yingchao Deng
  2026-04-27 11:03 ` Leo Yan
  0 siblings, 1 reply; 2+ messages in thread
From: Yingchao Deng @ 2026-04-26  9:59 UTC (permalink / raw)
  To: Suzuki K Poulose, Mike Leach, James Clark, Leo Yan,
	Alexander Shishkin, Mathieu Poirier, Greg Kroah-Hartman
  Cc: coresight, linux-arm-kernel, linux-kernel, quic_yingdeng,
	Jinlong Mao, Tingwei Zhang, Jie Gan, Yingchao Deng

In cti_plat_process_filter_sigs(), after allocating a temporary
cti_trig_grp struct via kzalloc_obj(), the code never assigns tg->nr_sigs
= nr_filter_sigs. Since kzalloc zero-initialises the struct, tg->nr_sigs
remains 0. cti_plat_read_trig_group() guards with:
    if (!tgrp->nr_sigs)
        return 0;

so it returns immediately without reading any signal indices from DT.

Fix by assigning tg->nr_sigs before calling cti_plat_read_trig_group().

Fixes: a5614770ab97 ("coresight: cti: Add device tree support for custom CTI")

Signed-off-by: Yingchao Deng <yingchao.deng@oss.qualcomm.com>
---
 drivers/hwtracing/coresight/coresight-cti-platform.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/hwtracing/coresight/coresight-cti-platform.c b/drivers/hwtracing/coresight/coresight-cti-platform.c
index 4eff96f48594..d6d5388705c3 100644
--- a/drivers/hwtracing/coresight/coresight-cti-platform.c
+++ b/drivers/hwtracing/coresight/coresight-cti-platform.c
@@ -329,6 +329,7 @@ static int cti_plat_process_filter_sigs(struct cti_drvdata *drvdata,
 	if (!tg)
 		return -ENOMEM;
 
+	tg->nr_sigs = nr_filter_sigs;
 	err = cti_plat_read_trig_group(tg, fwnode, CTI_DT_FILTER_OUT_SIGS);
 	if (!err)
 		drvdata->config.trig_out_filter |= tg->used_mask;

---
base-commit: 7080e32d3f09d8688c4a87d81bdcc71f7f606b16
change-id: 20260426-nr_sigs-268add9d09ba

Best regards,
-- 
Yingchao Deng <yingchao.deng@oss.qualcomm.com>



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] coresight: cti: Fix DT filter signals silently ignored
  2026-04-26  9:59 [PATCH] coresight: cti: Fix DT filter signals silently ignored Yingchao Deng
@ 2026-04-27 11:03 ` Leo Yan
  0 siblings, 0 replies; 2+ messages in thread
From: Leo Yan @ 2026-04-27 11:03 UTC (permalink / raw)
  To: Yingchao Deng
  Cc: Suzuki K Poulose, Mike Leach, James Clark, Alexander Shishkin,
	Mathieu Poirier, Greg Kroah-Hartman, coresight, linux-arm-kernel,
	linux-kernel, quic_yingdeng, Jinlong Mao, Tingwei Zhang, Jie Gan

On Sun, Apr 26, 2026 at 05:59:34PM +0800, Yingchao Deng wrote:
> In cti_plat_process_filter_sigs(), after allocating a temporary
> cti_trig_grp struct via kzalloc_obj(), the code never assigns tg->nr_sigs
> = nr_filter_sigs. Since kzalloc zero-initialises the struct, tg->nr_sigs
> remains 0. cti_plat_read_trig_group() guards with:
>     if (!tgrp->nr_sigs)
>         return 0;
> 
> so it returns immediately without reading any signal indices from DT.
> 
> Fix by assigning tg->nr_sigs before calling cti_plat_read_trig_group().
> 
> Fixes: a5614770ab97 ("coresight: cti: Add device tree support for custom CTI")
> Signed-off-by: Yingchao Deng <yingchao.deng@oss.qualcomm.com>
> ---
>  drivers/hwtracing/coresight/coresight-cti-platform.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-cti-platform.c b/drivers/hwtracing/coresight/coresight-cti-platform.c
> index 4eff96f48594..d6d5388705c3 100644
> --- a/drivers/hwtracing/coresight/coresight-cti-platform.c
> +++ b/drivers/hwtracing/coresight/coresight-cti-platform.c
> @@ -329,6 +329,7 @@ static int cti_plat_process_filter_sigs(struct cti_drvdata *drvdata,
>  	if (!tg)
>  		return -ENOMEM;
>  
> +	tg->nr_sigs = nr_filter_sigs;
>  	err = cti_plat_read_trig_group(tg, fwnode, CTI_DT_FILTER_OUT_SIGS);

I checked the naming, seems tg->nr_sigs is the right field to store
the number.  LGTM:

Reviewed-by: Leo Yan <leo.yan@arm.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-04-27 11:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-26  9:59 [PATCH] coresight: cti: Fix DT filter signals silently ignored Yingchao Deng
2026-04-27 11:03 ` Leo Yan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox