Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jie Gan" <jie.gan@oss.qualcomm.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v4 4/5] arm64: dts: qcom: sm8750: fix traceNoC probe issue
Date: Wed, 01 Jul 2026 02:06:16 +0000	[thread overview]
Message-ID: <20260701020618.A8D251F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260701-fix-tracenoc-probe-issue-v4-4-aefab449a470@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Switching the traceNoC device from an AMBA binding to a platform binding exposes a pre-existing double-disable bug for the `apb_pclk` clock during driver unbind if the device is runtime-suspended.
--

commit c18b0cbf674e991c292d9a2d479c037f1c2eafdf
Author: Jie Gan <jie.gan@oss.qualcomm.com>

arm64: dts: qcom: sm8750: fix traceNoC probe issue

This commit changes the traceNoC device binding from an AMBA compatible
string to a standalone platform compatible string. This allows the device
to probe successfully on hardware that does not expose a readable primecell
ID register.

> diff --git a/arch/arm64/boot/dts/qcom/sm8750.dtsi b/arch/arm64/boot/dts/qcom/sm8750.dtsi
> index fafed417c66fc..d58483f9f93a3 100644
> --- a/arch/arm64/boot/dts/qcom/sm8750.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sm8750.dtsi
> @@ -4687,7 +4687,7 @@ tpdm_rdpm_cmb2_out: endpoint {
>  		};
>  
>  		tn@109ab000 {
> -			compatible = "qcom,coresight-tnoc", "arm,primecell";
> +			compatible = "qcom,coresight-agtnoc";

[Severity: High]
This is a pre-existing issue, but does switching this device to a platform
binding expose a double-disable bug for the apb_pclk clock during driver
unbind if the device is runtime-suspended?

When binding as a non-AMBA device, the clock is acquired and enabled via a
devm-managed API which registers a devres action to disable it on unbind:

drivers/hwtracing/coresight/coresight-core.c:coresight_get_enable_clocks() {
    ...
    *pclk = devm_clk_get_optional_enabled(dev, "apb_pclk");
    ...
}

If the device is unbound while idle, the driver core will suspend it before
removal. The runtime PM suspend callback disables the clock:

drivers/hwtracing/coresight/coresight-tnoc.c:tnoc_runtime_suspend() {
    ...
    clk_disable_unprepare(drvdata->pclk);
    ...
}

However, the remove callback doesn't call pm_runtime_get_sync() to resume the
device before disabling runtime PM:

drivers/hwtracing/coresight/coresight-tnoc.c:tnoc_platform_remove() {
    ...
    coresight_unregister(drvdata->csdev);
    pm_runtime_disable(&pdev->dev);
    ...
}

This leaves the clock disabled by runtime PM. When the devres cleanup action
for devm_clk_get_optional_enabled() runs, it unconditionally executes
clk_disable_unprepare() again.

Could this underflow the enable_count and turn off the clock while other
devices sharing the apb_pclk are still using it?

>  			reg = <0x0 0x109ab000 0x0 0x4200>;
>  
>  			clocks = <&aoss_qmp>;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260701-fix-tracenoc-probe-issue-v4-0-aefab449a470@oss.qualcomm.com?part=4

  reply	other threads:[~2026-07-01  2:06 UTC|newest]

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

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=20260701020618.A8D251F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jie.gan@oss.qualcomm.com \
    --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