mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ronald Claveau" <linux-kernel-dev@aliel.fr>
Cc: linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org, neil.armstrong@linaro.org
Subject: Re: [PATCH v7 2/4] arm64: dts: amlogic: t7: Add thermal sensor nodes
Date: Fri, 16 Oct 2026 17:25:30 +0000	[thread overview]
Message-ID: <sashiko-outbox-174722@kernel.org> (raw)
In-Reply-To: <20261016-add-thermal-t7-vim4-v7-2-6eede5450fd4@aliel.fr>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] thermal: amlogic: system hang due to MMIO access before clock enable
--

commit d943dedd550441fdf5ee6b1eb6eb97f02aac1ef7
Author: Ronald Claveau <linux-kernel-dev@aliel.fr>

arm64: dts: amlogic: t7: Add thermal sensor nodes

This commit adds six temperature sensor nodes to the device tree using
the amlogic,t7-thermal compatible. The nodes include references to their
required clocks and calibration data from the secure monitor.

> diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi
> index 8aa85aab30469..c81632d3984e8 100644
> --- a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi
> @@ -696,6 +696,26 @@ sec_ao: ao-secure@10220 {
>  				amlogic,has-chip-id;
>  			};
>  
> +			a73_tsensor: temperature-sensor@20000 {
> +				compatible = "amlogic,t7-thermal";
> +				reg = <0x0 0x20000 0x0 0x50>;
> +				interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
> +				clocks = <&clkc_periphs CLKID_SYS_TS_A73>, <&clkc_periphs CLKID_TS>;

[Severity: High]
Does adding this thermal sensor node expose an initialization order bug
in the driver that causes a system hang?

In drivers/thermal/amlogic_thermal.c:amlogic_thermal_probe(), the thermal
zone is registered before the hardware clocks are enabled:

	pdata->tzd = devm_thermal_of_zone_register(&pdev->dev,
						   0,
						   pdata,
						   &amlogic_thermal_ops);
	...
	ret = amlogic_thermal_enable(pdata);

During registration, the thermal core synchronously queries the temperature
via the driver's .get_temp callback (amlogic_thermal_get_temp()), which
performs an MMIO read via regmap_read() on TSENSOR_STAT0.

Since the driver enables the required peripheral clocks after the thermal
zone is registered, executing this MMIO read before the necessary bus clocks
are enabled will stall the AMBA bus and hang or reboot the system.

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261016-add-thermal-t7-vim4-v7-0-6eede5450fd4@aliel.fr?part=2

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2026-10-16 17:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 17:16 [PATCH v7 0/4] arm64: amlogic: T7 thermal support Ronald Claveau via B4 Relay
2026-10-16 17:16 ` [PATCH v7 1/4] arm64: dts: amlogic: t7: Add cooling cells to all CPUs Ronald Claveau via B4 Relay
2026-10-16 17:16 ` [PATCH v7 2/4] arm64: dts: amlogic: t7: Add thermal sensor nodes Ronald Claveau via B4 Relay
2026-10-16 17:25   ` sashiko-bot [this message]
2026-10-16 17:16 ` [PATCH v7 3/4] arm64: dts: amlogic: t7: Add thermal zones Ronald Claveau via B4 Relay
2026-10-16 17:16 ` [PATCH v7 4/4] arm64: dts: amlogic: t7: khadas-vim4: Add fan cooling to " Ronald Claveau via B4 Relay

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=sashiko-outbox-174722@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-kernel-dev@aliel.fr \
    --cc=neil.armstrong@linaro.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

all inboxes | Powered by JetHome®