devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] dt-bindings: thermal: correct thermal zone node name limit
@ 2024-01-03 14:20 Krzysztof Kozlowski
  2024-01-03 14:20 ` [PATCH 2/2] arm64: dts: juno: fix thermal zone node names Krzysztof Kozlowski
  2024-01-03 15:12 ` [PATCH 1/2] dt-bindings: thermal: correct thermal zone node name limit Rob Herring
  0 siblings, 2 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2024-01-03 14:20 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Liviu Dudau,
	Sudeep Holla, Lorenzo Pieralisi, Amit Kucheria, linux-pm,
	devicetree, linux-kernel, linux-arm-kernel
  Cc: Krzysztof Kozlowski, Rob Herring, stable

Linux kernel uses thermal zone node name during registering thermal
zones and has a hard-coded limit of 20 characters, including terminating
NUL byte.  The bindings expect node names to finish with '-thermal'
which is eight bytes long, thus we have only 11 characters for the reset
of the node name, not 12.

Reported-by: Rob Herring <robh@kernel.org>
Closes: https://lore.kernel.org/all/CAL_JsqKogbT_4DPd1n94xqeHaU_J8ve5K09WOyVsRX3jxxUW3w@mail.gmail.com/
Fixes: 1202a442a31f ("dt-bindings: thermal: Add yaml bindings for thermal zones")
Cc: <stable@vger.kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 Documentation/devicetree/bindings/thermal/thermal-zones.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
index 4a8dabc48170..bbc883fd4044 100644
--- a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
+++ b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
@@ -49,7 +49,7 @@ properties:
       to take when the temperature crosses those thresholds.
 
 patternProperties:
-  "^[a-zA-Z][a-zA-Z0-9\\-]{1,12}-thermal$":
+  "^[a-zA-Z][a-zA-Z0-9\\-]{1,11}-thermal$":
     type: object
     description:
       Each thermal zone node contains information about how frequently it
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] arm64: dts: juno: fix thermal zone node names
  2024-01-03 14:20 [PATCH 1/2] dt-bindings: thermal: correct thermal zone node name limit Krzysztof Kozlowski
@ 2024-01-03 14:20 ` Krzysztof Kozlowski
  2024-01-03 15:14   ` Rob Herring
  2024-03-25 11:05   ` (subset) " Krzysztof Kozlowski
  2024-01-03 15:12 ` [PATCH 1/2] dt-bindings: thermal: correct thermal zone node name limit Rob Herring
  1 sibling, 2 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2024-01-03 14:20 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Liviu Dudau,
	Sudeep Holla, Lorenzo Pieralisi, Amit Kucheria, linux-pm,
	devicetree, linux-kernel, linux-arm-kernel
  Cc: Krzysztof Kozlowski, Rob Herring

Linux kernel uses thermal zone node name during registering thermal
zones and has a hard-coded limit of 20 characters, including terminating
NUL byte.  Exceeding the limit will cause failure to configure thermal
zone.

Reported-by: Rob Herring <robh@kernel.org>
Closes: https://lore.kernel.org/all/CAL_JsqKogbT_4DPd1n94xqeHaU_J8ve5K09WOyVsRX3jxxUW3w@mail.gmail.com/
Fixes: fb4d25d7a33f ("arm64: dts: juno: Align thermal zone names with bindings")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 arch/arm64/boot/dts/arm/juno-base.dtsi | 4 ++--
 arch/arm64/boot/dts/arm/juno-scmi.dtsi | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/boot/dts/arm/juno-base.dtsi b/arch/arm64/boot/dts/arm/juno-base.dtsi
index b897f5542c0a..98ed2b329ed6 100644
--- a/arch/arm64/boot/dts/arm/juno-base.dtsi
+++ b/arch/arm64/boot/dts/arm/juno-base.dtsi
@@ -773,14 +773,14 @@ soc_crit0: trip0 {
 			};
 		};
 
-		big_cluster_thermal_zone: big-cluster-thermal {
+		big_cluster_thermal_zone: big-cl-thermal {
 			polling-delay = <1000>;
 			polling-delay-passive = <100>;
 			thermal-sensors = <&scpi_sensors0 21>;
 			status = "disabled";
 		};
 
-		little_cluster_thermal_zone: little-cluster-thermal {
+		little_cluster_thermal_zone: little-cl-thermal {
 			polling-delay = <1000>;
 			polling-delay-passive = <100>;
 			thermal-sensors = <&scpi_sensors0 22>;
diff --git a/arch/arm64/boot/dts/arm/juno-scmi.dtsi b/arch/arm64/boot/dts/arm/juno-scmi.dtsi
index 31929e2377d8..f38c5b6ef657 100644
--- a/arch/arm64/boot/dts/arm/juno-scmi.dtsi
+++ b/arch/arm64/boot/dts/arm/juno-scmi.dtsi
@@ -84,11 +84,11 @@ soc-thermal {
 			thermal-sensors = <&scmi_sensors0 3>;
 		};
 
-		big-cluster-thermal {
+		big-cl-thermal {
 			thermal-sensors = <&scmi_sensors0 21>;
 		};
 
-		little-cluster-thermal {
+		little-cl-thermal {
 			thermal-sensors = <&scmi_sensors0 22>;
 		};
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] dt-bindings: thermal: correct thermal zone node name limit
  2024-01-03 14:20 [PATCH 1/2] dt-bindings: thermal: correct thermal zone node name limit Krzysztof Kozlowski
  2024-01-03 14:20 ` [PATCH 2/2] arm64: dts: juno: fix thermal zone node names Krzysztof Kozlowski
@ 2024-01-03 15:12 ` Rob Herring
  2024-01-03 16:29   ` Krzysztof Kozlowski
  1 sibling, 1 reply; 7+ messages in thread
From: Rob Herring @ 2024-01-03 15:12 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	Krzysztof Kozlowski, Conor Dooley, Liviu Dudau, Sudeep Holla,
	Lorenzo Pieralisi, Amit Kucheria, linux-pm, devicetree,
	linux-kernel, linux-arm-kernel, stable

On Wed, Jan 3, 2024 at 7:20 AM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> Linux kernel uses thermal zone node name during registering thermal
> zones and has a hard-coded limit of 20 characters, including terminating
> NUL byte.  The bindings expect node names to finish with '-thermal'
> which is eight bytes long, thus we have only 11 characters for the reset
> of the node name, not 12.
>
> Reported-by: Rob Herring <robh@kernel.org>
> Closes: https://lore.kernel.org/all/CAL_JsqKogbT_4DPd1n94xqeHaU_J8ve5K09WOyVsRX3jxxUW3w@mail.gmail.com/
> Fixes: 1202a442a31f ("dt-bindings: thermal: Add yaml bindings for thermal zones")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  Documentation/devicetree/bindings/thermal/thermal-zones.yaml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
> index 4a8dabc48170..bbc883fd4044 100644
> --- a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
> +++ b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
> @@ -49,7 +49,7 @@ properties:
>        to take when the temperature crosses those thresholds.
>
>  patternProperties:
> -  "^[a-zA-Z][a-zA-Z0-9\\-]{1,12}-thermal$":
> +  "^[a-zA-Z][a-zA-Z0-9\\-]{1,11}-thermal$":

Now off by 1 instead of 2. It should be 1 starting char, 1-10 chars,
and 8 chars for "-thermal".

Can you also add a comment that this length is due to the kernel.

Rob

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] arm64: dts: juno: fix thermal zone node names
  2024-01-03 14:20 ` [PATCH 2/2] arm64: dts: juno: fix thermal zone node names Krzysztof Kozlowski
@ 2024-01-03 15:14   ` Rob Herring
  2024-03-25 11:05   ` (subset) " Krzysztof Kozlowski
  1 sibling, 0 replies; 7+ messages in thread
From: Rob Herring @ 2024-01-03 15:14 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	Krzysztof Kozlowski, Conor Dooley, Liviu Dudau, Sudeep Holla,
	Lorenzo Pieralisi, Amit Kucheria, linux-pm, devicetree,
	linux-kernel, linux-arm-kernel

On Wed, Jan 3, 2024 at 7:21 AM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> Linux kernel uses thermal zone node name during registering thermal
> zones and has a hard-coded limit of 20 characters, including terminating
> NUL byte.  Exceeding the limit will cause failure to configure thermal
> zone.
>
> Reported-by: Rob Herring <robh@kernel.org>
> Closes: https://lore.kernel.org/all/CAL_JsqKogbT_4DPd1n94xqeHaU_J8ve5K09WOyVsRX3jxxUW3w@mail.gmail.com/
> Fixes: fb4d25d7a33f ("arm64: dts: juno: Align thermal zone names with bindings")
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  arch/arm64/boot/dts/arm/juno-base.dtsi | 4 ++--
>  arch/arm64/boot/dts/arm/juno-scmi.dtsi | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] dt-bindings: thermal: correct thermal zone node name limit
  2024-01-03 15:12 ` [PATCH 1/2] dt-bindings: thermal: correct thermal zone node name limit Rob Herring
@ 2024-01-03 16:29   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2024-01-03 16:29 UTC (permalink / raw)
  To: Rob Herring
  Cc: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	Krzysztof Kozlowski, Conor Dooley, Liviu Dudau, Sudeep Holla,
	Lorenzo Pieralisi, Amit Kucheria, linux-pm, devicetree,
	linux-kernel, linux-arm-kernel, stable

On 03/01/2024 16:12, Rob Herring wrote:
> On Wed, Jan 3, 2024 at 7:20 AM Krzysztof Kozlowski
> <krzysztof.kozlowski@linaro.org> wrote:
>>
>> Linux kernel uses thermal zone node name during registering thermal
>> zones and has a hard-coded limit of 20 characters, including terminating
>> NUL byte.  The bindings expect node names to finish with '-thermal'
>> which is eight bytes long, thus we have only 11 characters for the reset
>> of the node name, not 12.
>>
>> Reported-by: Rob Herring <robh@kernel.org>
>> Closes: https://lore.kernel.org/all/CAL_JsqKogbT_4DPd1n94xqeHaU_J8ve5K09WOyVsRX3jxxUW3w@mail.gmail.com/
>> Fixes: 1202a442a31f ("dt-bindings: thermal: Add yaml bindings for thermal zones")
>> Cc: <stable@vger.kernel.org>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> ---
>>  Documentation/devicetree/bindings/thermal/thermal-zones.yaml | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
>> index 4a8dabc48170..bbc883fd4044 100644
>> --- a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
>> +++ b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
>> @@ -49,7 +49,7 @@ properties:
>>        to take when the temperature crosses those thresholds.
>>
>>  patternProperties:
>> -  "^[a-zA-Z][a-zA-Z0-9\\-]{1,12}-thermal$":
>> +  "^[a-zA-Z][a-zA-Z0-9\\-]{1,11}-thermal$":
> 
> Now off by 1 instead of 2. It should be 1 starting char, 1-10 chars,
> and 8 chars for "-thermal".

Why off by 2? prefix can be up to 11 bytes, plus 8 bytes for "-thermal"
and 1 byte for NUL. This gives 11+8+1=20, exactly the size used in Linux
kernel.

> 
> Can you also add a comment that this length is due to the kernel.

Sure

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: (subset) [PATCH 2/2] arm64: dts: juno: fix thermal zone node names
  2024-01-03 14:20 ` [PATCH 2/2] arm64: dts: juno: fix thermal zone node names Krzysztof Kozlowski
  2024-01-03 15:14   ` Rob Herring
@ 2024-03-25 11:05   ` Krzysztof Kozlowski
  2024-03-25 12:52     ` Sudeep Holla
  1 sibling, 1 reply; 7+ messages in thread
From: Krzysztof Kozlowski @ 2024-03-25 11:05 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Liviu Dudau,
	Sudeep Holla, Lorenzo Pieralisi, Amit Kucheria, linux-pm,
	devicetree, linux-kernel, linux-arm-kernel, Krzysztof Kozlowski
  Cc: Rob Herring


On Wed, 03 Jan 2024 15:20:51 +0100, Krzysztof Kozlowski wrote:
> Linux kernel uses thermal zone node name during registering thermal
> zones and has a hard-coded limit of 20 characters, including terminating
> NUL byte.  Exceeding the limit will cause failure to configure thermal
> zone.
> 
> 

Applied, thanks!

This was waiting on the lists for some time and no one picked it up, so... let
me know if I should drop it from my tree.

[2/2] arm64: dts: juno: fix thermal zone node names
      https://git.kernel.org/krzk/linux-dt/c/85170635525758828dc22be83f6b17a86ccec312

Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: (subset) [PATCH 2/2] arm64: dts: juno: fix thermal zone node names
  2024-03-25 11:05   ` (subset) " Krzysztof Kozlowski
@ 2024-03-25 12:52     ` Sudeep Holla
  0 siblings, 0 replies; 7+ messages in thread
From: Sudeep Holla @ 2024-03-25 12:52 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Liviu Dudau,
	Lorenzo Pieralisi, Amit Kucheria, linux-pm, devicetree,
	linux-kernel, linux-arm-kernel, Rob Herring

On Mon, Mar 25, 2024 at 12:05:14PM +0100, Krzysztof Kozlowski wrote:
> 
> On Wed, 03 Jan 2024 15:20:51 +0100, Krzysztof Kozlowski wrote:
> > Linux kernel uses thermal zone node name during registering thermal
> > zones and has a hard-coded limit of 20 characters, including terminating
> > NUL byte.  Exceeding the limit will cause failure to configure thermal
> > zone.
> > 
> > 
> 
> Applied, thanks!
> 
> This was waiting on the lists for some time and no one picked it up, so... let
> me know if I should drop it from my tree.
>

Sorry for that, must have slipped through when I was off. Thanks for picking
it up. If not too late, feel free to add

Acked-by: Sudeep Holla <sudeep.holla@arm.com>

-- 
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-03-25 12:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-03 14:20 [PATCH 1/2] dt-bindings: thermal: correct thermal zone node name limit Krzysztof Kozlowski
2024-01-03 14:20 ` [PATCH 2/2] arm64: dts: juno: fix thermal zone node names Krzysztof Kozlowski
2024-01-03 15:14   ` Rob Herring
2024-03-25 11:05   ` (subset) " Krzysztof Kozlowski
2024-03-25 12:52     ` Sudeep Holla
2024-01-03 15:12 ` [PATCH 1/2] dt-bindings: thermal: correct thermal zone node name limit Rob Herring
2024-01-03 16:29   ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).