[PATCH v7 2/4] arm64: dts: amlogic: t7: Add thermal sensor nodes

Ronald Claveau linux-kernel-dev at aliel.fr
Sun Oct 18 02:03:06 PDT 2026


On 10/16/26 7:25 PM, sashiko-bot at 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 at 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 at 10220 {
>>  				amlogic,has-chip-id;
>>  			};
>>  
>> +			a73_tsensor: temperature-sensor at 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



More information about the linux-amlogic mailing list