mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
From: Ronald Claveau <linux-kernel-dev@aliel.fr>
To: sashiko-reviews@lists.linux.dev
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: Sun, 18 Oct 2026 11:03:06 +0200	[thread overview]
Message-ID: <dda4b297-6dd1-42ba-8332-80c22b741e29@aliel.fr> (raw)
In-Reply-To: <sashiko-outbox-174722@kernel.org>

On 10/16/26 7:25 PM, sashiko-bot@kernel.org wrote:
> 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.
> 
> [ ... ]
> 

This is pre-existing and can be managed outside of this series.

-- 
Best regards,
Ronald

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

  reply	other threads:[~2026-10-18  9:04 UTC|newest]

Thread overview: 8+ 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
2026-10-18  9:03     ` Ronald Claveau [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
2026-11-03  9:54 ` [PATCH v7 0/4] arm64: amlogic: T7 thermal support Neil Armstrong

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=dda4b297-6dd1-42ba-8332-80c22b741e29@aliel.fr \
    --to=linux-kernel-dev@aliel.fr \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-amlogic@lists.infradead.org \
    --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®