Skip to contentSkip to conversation

dt-bindings: timer: sifive,clint: Miscellaneous improvements

PATCH Superseded Geert Uytterhoeven 4 participants 7 messages Dec 17, 2021 – Jan 26, 2022

Subsystems (4)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#5 lore raw

PATCH v3 2/2 dt-bindings: timer: sifive,clint: Group interrupt tuples

In reply to Geert Uytterhoeven

To improve human readability and enable automatic validation, the tuples in "interrupts-extended" properties should be grouped using angle brackets.

---
v3:
- Add Reviewed-by,

v2:
- Split in two patches.

---
 Documentation/devicetree/bindings/timer/sifive,clint.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/timer/sifive,clint.yaml +4 -4
index b75fd6f982b1ecb3..3b25ec37d81159cb 100644
@@ -57,10 +57,10 @@ examples:
   - |
     timer@2000000 {
       compatible = "sifive,fu540-c000-clint", "sifive,clint0";
-      interrupts-extended = <&cpu1intc 3 &cpu1intc 7
-                             &cpu2intc 3 &cpu2intc 7
-                             &cpu3intc 3 &cpu3intc 7
-                             &cpu4intc 3 &cpu4intc 7>;
+      interrupts-extended = <&cpu1intc 3>, <&cpu1intc 7>,
+                            <&cpu2intc 3>, <&cpu2intc 7>,
+                            <&cpu3intc 3>, <&cpu3intc 7>,
+                            <&cpu4intc 3>, <&cpu4intc 7>;
        reg = <0x2000000 0x10000>;
     };
 ...
Signature · 1 line
2.25.1
#1 lore raw

PATCH v3 1/2 dt-bindings: timer: sifive,clint: Fix number of interrupts

In reply to Geert Uytterhoeven

The number of interrupts lacks an upper bound, thus assuming one, causing properly grouped "interrupts-extended" properties to be flagged as an error by "make dtbs_check".

Fix this by adding the missing "maxItems". As the architectural maximum is 4095 interrupts, using that as the limit would be unpractical. Hence limit it to 10 interrupts (two interrupts for a system management core, and two interrupts per core for other cores). This should be sufficient for now, and the limit can always be increased when the need arises.

---
v3:
- Add Acked-by,

v2:
- Split in two patches,
- Improve patch description and document limit rationale.

---
 Documentation/devicetree/bindings/timer/sifive,clint.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/timer/sifive,clint.yaml +1 -0
index 8d5f4687add9e81e..b75fd6f982b1ecb3 100644
@@ -44,6 +44,7 @@ properties:
 
   interrupts-extended:
     minItems: 1
+    maxItems: 10
 
 additionalProperties: false
 
Signature · 1 line
2.25.1
#0 lore raw

v3 cover dt-bindings: timer: sifive,clint: Miscellaneous improvements

Hi all,

This patch series contains two improvements for the SiFive CLINT DT bindings.

Changes compared to v2[1]:
- Add Acked-by, Reviewed-by.

Changes compared to v1[2]:
- Split in two patches,
- Improve patch description and document limit rationale.

Thanks!

[1] https://lore.kernel.org/r/[email protected]
[2] https://lore.kernel.org/r/[email protected]

Geert Uytterhoeven (2):
dt-bindings: timer: sifive,clint: Fix number of interrupts
dt-bindings: timer: sifive,clint: Group interrupt tuples

 .../devicetree/bindings/timer/sifive,clint.yaml          | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
Signature · 1 line
2.25.1
#2 lore raw

Re: [PATCH v3 1/2] dt-bindings: timer: sifive,clint: Fix number of interrupts

In reply to Geert Uytterhoeven
Quoted 10 lines · Geert Uytterhoeven

The number of interrupts lacks an upper bound, thus assuming one, causing properly grouped "interrupts-extended" properties to be flagged as an error by "make dtbs_check".

Fix this by adding the missing "maxItems". As the architectural maximum is 4095 interrupts, using that as the limit would be unpractical. Hence limit it to 10 interrupts (two interrupts for a system management core, and two interrupts per core for other cores). This should be sufficient for now, and the limit can always be increased when the need arises.

Same comment as the PLIC DT binding patch.

The "maxItems" should represent CLINT spec constraints so please don't add any synthetic value here.

Regards,
Anup

Quoted 29 lines

---
v3:
- Add Acked-by,

v2:
- Split in two patches,
- Improve patch description and document limit rationale.

---
 Documentation/devicetree/bindings/timer/sifive,clint.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/timer/sifive,clint.yaml +1 -1
index 8d5f4687add9e81e..b75fd6f982b1ecb3 100644
@@ -44,6 +44,7 @@ properties:
 
   interrupts-extended:
     minItems: 1
+    maxItems: 10
 
 additionalProperties: false
 
--

2.25.1

maintainer Reviewed-by on v3 2/2
#6 lore raw

Re: [PATCH v3 2/2] dt-bindings: timer: sifive,clint: Group interrupt tuples

In reply to Geert Uytterhoeven
Quoted 8 lines · Geert Uytterhoeven

To improve human readability and enable automatic validation, the tuples in "interrupts-extended" properties should be grouped using angle brackets.

---
v3:
- Add Reviewed-by,

Did you? ;)

Quoted 30 lines

v2:
- Split in two patches.

---
 Documentation/devicetree/bindings/timer/sifive,clint.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/timer/sifive,clint.yaml +4 -4
index b75fd6f982b1ecb3..3b25ec37d81159cb 100644
@@ -57,10 +57,10 @@ examples:
   - |
     timer@2000000 {
       compatible = "sifive,fu540-c000-clint", "sifive,clint0";
-      interrupts-extended = <&cpu1intc 3 &cpu1intc 7
-                             &cpu2intc 3 &cpu2intc 7
-                             &cpu3intc 3 &cpu3intc 7
-                             &cpu4intc 3 &cpu4intc 7>;
+      interrupts-extended = <&cpu1intc 3>, <&cpu1intc 7>,
+                            <&cpu2intc 3>, <&cpu2intc 7>,
+                            <&cpu3intc 3>, <&cpu3intc 7>,
+                            <&cpu4intc 3>, <&cpu4intc 7>;
        reg = <0x2000000 0x10000>;
     };
...
Signature · 1 line
2.25.1
#3 lore raw

Re: [PATCH v3 1/2] dt-bindings: timer: sifive,clint: Fix number of interrupts

In reply to Anup Patel
Quoted 13 lines · Anup Patel
Quoted 10 lines · Geert Uytterhoeven

The number of interrupts lacks an upper bound, thus assuming one, causing properly grouped "interrupts-extended" properties to be flagged as an error by "make dtbs_check".

Fix this by adding the missing "maxItems". As the architectural maximum is 4095 interrupts, using that as the limit would be unpractical. Hence limit it to 10 interrupts (two interrupts for a system management core, and two interrupts per core for other cores). This should be sufficient for now, and the limit can always be increased when the need arises.

Quoted 4 lines

Same comment as the PLIC DT binding patch.

The "maxItems" should represent CLINT spec constraints so please don't add any synthetic value here.

I agree.

Geert, are you going to respin these?

Rob

#4 lore raw

Re: [PATCH v3 1/2] dt-bindings: timer: sifive,clint: Fix number of interrupts

Hi Rob,

Quoted 12 lines · Rob Herring
Quoted 11 lines · Anup Patel
Quoted 9 lines · Geert Uytterhoeven

The number of interrupts lacks an upper bound, thus assuming one, causing properly grouped "interrupts-extended" properties to be flagged as an error by "make dtbs_check".

Fix this by adding the missing "maxItems". As the architectural maximum is 4095 interrupts, using that as the limit would be unpractical. Hence limit it to 10 interrupts (two interrupts for a system management core, and two interrupts per core for other cores). This should be sufficient for now, and the limit can always be increased when the need arises.

Quoted 8 lines
Quoted 4 lines

Same comment as the PLIC DT binding patch.

The "maxItems" should represent CLINT spec constraints so please don't add any synthetic value here.

I agree.

Geert, are you going to respin these?

Sure, will do, now we have an agreement.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds