Re: [PATCH 2/2] ARM: dts: st: spear: fix dtbs warning on spear thermal sensor
From: Krzysztof Kozlowski <krzk@kernel.org>
Date: 2026-03-24 10:01:11
Also in:
linux-devicetree, linux-pm, lkml
On 24/03/2026 11:00, Daniel Baluta wrote:
On 3/24/26 11:26, Krzysztof Kozlowski wrote:quoted
On Mon, Mar 23, 2026 at 07:08:09PM +0530, Gopi Krishna Menon wrote:quoted
Running DTBS checks on st/spear1340-evb.dtb results in the following warning: thermal@e07008c4 (st,thermal-spear1340): Unevaluated properties are not allowed ('thermal_flags' was unexpected) from schema $id: http://devicetree.org/schemas/thermal/st,thermal-spear1340.yamlHow is it possible if there is no such file? Did you just add new warning in patch #1 and then claim in patch #2 that you fix it? You completely miss the point why this change is needed: how could the DTS work before? It could not. And that should be your justification for the patch, with explanation why it could not work.Correct me if I'm wrong but I think there was a hidden bug here drivers/thermal/spear_thermal.c:spear_thermal_probe: if (!np || !of_property_read_u32(np, "st,thermal-flags", &val)) { » » dev_err(&pdev->dev, "Failed: DT Pdata not passed\n"); » » return -EINVAL; » } So, the driver was checking for the correct property as pointed by
Yes
bindings/thermal/spear-thermal.txt but the dts was using the wrong
No, DTS had two properties - correct one and incorrect.
property name: arch/arm/boot/dts/st/spear13xx.dtsi » » » thermal@e07008c4 { » » » » compatible = "st,thermal-spear1340"; » » » » reg = <0xe07008c4 0x4>; » » » » thermal_flags = <0x7000>; » » » }; And because this check is wrong:
if (!np || !of_property_read_u32(np, "st,thermal-flags", &val)) {
people really didn't notice it.
The check should be:
if (!np || of_property_read_u32(np, "st,thermal-flags", &val)) {
» » dev_err(&pdev->dev, "Failed: DT Pdata not passed\n");
» » return -EINVAL;
» }
So, this actual patch has uncovered a bug! Yes. Driver also has bug, so probably was never working. The point is whatever commit is doing, the dtbs_check warning is not the justification, because it was introduced by this patchset. Best regards, Krzysztof