Devicetree
 help / color / mirror / Atom feed
From: Jie Gan <jie.gan@oss.qualcomm.com>
To: sashiko-reviews@lists.linux.dev
Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, robh@kernel.org
Subject: Re: [PATCH v3 2/5] coresight: tnoc: Add AG tnoc standalone compatible to the platform driver
Date: Tue, 30 Jun 2026 18:59:54 +0800	[thread overview]
Message-ID: <8f175e76-b446-4afd-ad55-18b67eee7e5d@oss.qualcomm.com> (raw)
In-Reply-To: <20260630105749.197541F000E9@smtp.kernel.org>



On 6/30/2026 6:57 PM, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [High] System Trace ID is leaked on platform device removal for standalone Aggregator TNOC.
> --
> 
> commit 060ed6649d8ad0bd7b6b53c7f626563782e801df
> Author: Jie Gan <jie.gan@oss.qualcomm.com>
> 
> coresight: tnoc: Add AG tnoc standalone compatible to the platform driver
> 
> This commit adds the "qcom,coresight-agtnoc" compatible to allow the Aggregator
> TNOC to probe as a standalone platform device. It updates the platform driver
> and callback names to generic "tnoc" variants. It also modifies the default
> data initialization so that only the Interconnect TNOC skips trace ID allocation.
> 
>> diff --git a/drivers/hwtracing/coresight/coresight-tnoc.c b/drivers/hwtracing/coresight/coresight-tnoc.c
>> index 9e8de4323d285..8237467faba72 100644
>> --- a/drivers/hwtracing/coresight/coresight-tnoc.c
>> +++ b/drivers/hwtracing/coresight/coresight-tnoc.c
> [ ... ]
>> @@ -295,7 +295,7 @@ static int itnoc_probe(struct platform_device *pdev)
>>   	return ret;
>>   }
>>   
>> -static void itnoc_remove(struct platform_device *pdev)
>> +static void tnoc_platform_remove(struct platform_device *pdev)
>>   {
>>   	struct trace_noc_drvdata *drvdata = platform_get_drvdata(pdev);
>>   
>>   	coresight_unregister(drvdata->csdev);
>>   	pm_runtime_disable(&pdev->dev);
>>   }
> 
> [Severity: High]
> Does this code leak the allocated system trace ID on device removal?
> 

Thanks for reporting. We need free the trace ID in remove path.

Thanks,
Jie

> Because trace_noc_init_default_data() now allocates a system trace ID via
> coresight_trace_id_get_system_id() for the new "qcom,coresight-agtnoc"
> devices, it appears tnoc_platform_remove() needs a corresponding call to
> coresight_trace_id_put_system_id(drvdata->atid) when the driver is unbound.
> 
> Without this cleanup, repeated unbind and bind cycles could permanently
> exhaust the finite system trace ID pool.
> 


  reply	other threads:[~2026-06-30 11:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-30 10:36 [PATCH v3 0/5] Fix traceNoC probe issue on multiple QCOM platforms Jie Gan
2026-06-30 10:36 ` [PATCH v3 1/5] dt-bindings: arm: coresight-tnoc: Add standalone qcom,coresight-agtnoc compatible Jie Gan
2026-06-30 10:36 ` [PATCH v3 2/5] coresight: tnoc: Add AG tnoc standalone compatible to the platform driver Jie Gan
2026-06-30 10:57   ` sashiko-bot
2026-06-30 10:59     ` Jie Gan [this message]
2026-06-30 10:36 ` [PATCH v3 3/5] arm64: dts: qcom: kaanapali: fix traceNoC probe issue Jie Gan
2026-06-30 11:08   ` sashiko-bot
2026-06-30 12:53   ` Konrad Dybcio
2026-06-30 13:44     ` Jie Gan
2026-06-30 10:36 ` [PATCH v3 4/5] arm64: dts: qcom: sm8750: " Jie Gan
2026-06-30 11:19   ` sashiko-bot
2026-06-30 10:36 ` [PATCH v3 5/5] arm64: dts: qcom: glymur: use Aggregator TNOC compatible Jie Gan
2026-06-30 11:31   ` sashiko-bot

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=8f175e76-b446-4afd-ad55-18b67eee7e5d@oss.qualcomm.com \
    --to=jie.gan@oss.qualcomm.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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