Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jie Gan" <jie.gan@oss.qualcomm.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v6 3/5] arm64: dts: qcom: kaanapali: bind traceNoC on the platform bus
Date: Fri, 10 Jul 2026 02:54:19 +0000	[thread overview]
Message-ID: <20260710025419.9797A1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260710-fix-tracenoc-probe-issue-v6-3-41eb36fef8d9@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Transitioning this device to the platform bus exposes an unbalanced clock disable (double disable) during device unbind or module removal due to missing PM runtime synchronization in the platform driver's remove path.
--

--- Patch [3]: [PATCH v6 3/5] arm64: dts: qcom: kaanapali: bind traceNoC on the platform bus ---
commit c36a0dfa1784492dc5cc63336f15362356597417
Author: Jie Gan <jie.gan@oss.qualcomm.com>
arm64: dts: qcom: kaanapali: bind traceNoC on the platform bus

This patch removes the arm,primecell compatible string from the traceNoC
node in the kaanapali device tree. This forces the device to bind via the
platform bus rather than the AMBA bus to avoid deferred probes caused by
invalid component IDs.

> diff --git a/arch/arm64/boot/dts/qcom/kaanapali.dtsi b/arch/arm64/boot/dts/qcom/kaanapali.dtsi
> index 7aa9653bd456e..5d0e7e8c2e58c 100644
> --- a/arch/arm64/boot/dts/qcom/kaanapali.dtsi
> +++ b/arch/arm64/boot/dts/qcom/kaanapali.dtsi
> @@ -5004,7 +5004,7 @@ tpdm_pcie_rscc_out: endpoint {
>  		};
>  
>  		tn@111b8000 {
> -			compatible = "qcom,coresight-tnoc", "arm,primecell";
> +			compatible = "qcom,coresight-tnoc";

[Severity: High]
Will transitioning this device to the platform bus expose an unbalanced
clock disable during device unbind or module removal?

The platform driver's probe fetches and enables the clock using
devm_clk_get_optional_enabled(), which registers a devres action to disable
the clock on cleanup:

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

When the device suspends, tnoc_runtime_suspend() disables the clock:

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

During unbind, tnoc_platform_remove() fails to 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);
    if (drvdata->atid > 0)
        coresight_trace_id_put_system_id(drvdata->atid);

Because the device remains suspended, its clock is already disabled. When
devres subsequently cleans up and executes the clk_disable_unprepare()
action, it could result in a double-disable of the clock. The AMBA bus
handles PM runtime synchronization automatically during remove, but the
platform bus does not.

Could this trigger a kernel warning and corrupt the clock enable count?

>  			reg = <0x0 0x111b8000 0x0 0x4200>;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260710-fix-tracenoc-probe-issue-v6-0-41eb36fef8d9@oss.qualcomm.com?part=3

  reply	other threads:[~2026-07-10  2:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-10  2:38 [PATCH v6 0/5] Fix traceNoC probe issue on multiple QCOM platforms Jie Gan
2026-07-10  2:39 ` [PATCH v6 1/5] dt-bindings: arm: coresight-tnoc: Bind on platform bus instead of AMBA Jie Gan
2026-07-10  2:48   ` sashiko-bot
2026-07-10  7:03   ` Krzysztof Kozlowski
2026-07-10  2:39 ` [PATCH v6 2/5] coresight: tnoc: Bind Aggregator TNOC on the platform bus Jie Gan
2026-07-10  2:50   ` sashiko-bot
2026-07-10  8:40   ` Leo Yan
2026-07-10  2:39 ` [PATCH v6 3/5] arm64: dts: qcom: kaanapali: bind traceNoC " Jie Gan
2026-07-10  2:54   ` sashiko-bot [this message]
2026-07-10  9:49   ` Konrad Dybcio
2026-07-10  2:39 ` [PATCH v6 4/5] arm64: dts: qcom: sm8750: " Jie Gan
2026-07-10  9:49   ` Konrad Dybcio
2026-07-10  2:39 ` [PATCH v6 5/5] arm64: dts: qcom: glymur: use Aggregator TNOC compatible Jie Gan
2026-07-10  9:50   ` Konrad Dybcio

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=20260710025419.9797A1F000E9@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