Skip to contentSkip to conversation

dt-bindings: Fix phandle-array constraints, again

PATCH In review Rob Herring (Arm) 3 participants 5 messages May 7 – May 19

Subsystems (24)
lore
Share & tools
lore

Rob Herring (Arm)

author maintainer
#0 lore raw

PATCH v2 1/1 dt-bindings: Fix phandle-array constraints, again

The unfortunately named 'phandle-array' property type is really a matrix with phandle and fixed arg cells entries. A matrix property should have 2 levels of items constraints.

---
v2:
- Add proper descriptions for 'qcom,smem-states'. Thanks Krzysztof!
- Fix i2c-parent warning
- Fix extra blank lines

---
 .../rockchip/rockchip,rk3399-cdn-dp.yaml       |  2 ++
 .../bindings/i2c/i2c-demux-pinctrl.yaml        |  1 +
 .../mmc/hisilicon,hi3798cv200-dw-mshc.yaml     |  7 ++++---
 .../devicetree/bindings/net/qcom,bam-dmux.yaml | 12 ++++++++++++
 .../devicetree/bindings/net/qcom,ipa.yaml      | 12 ++++++++++++
 .../bindings/net/wireless/qcom,ath10k.yaml     |  8 +++++++-
 .../bindings/net/wireless/qcom,ath11k.yaml     |  8 +++++++-
 .../net/wireless/qcom,ipq5332-wifi.yaml        | 18 ++++++++++++++++++
 .../bindings/pci/toshiba,tc9563.yaml           |  5 +++--
 .../remoteproc/qcom,msm8916-mss-pil.yaml       |  6 ++++++
 .../remoteproc/qcom,msm8996-mss-pil.yaml       |  7 +++++++
 .../bindings/remoteproc/qcom,pas-common.yaml   |  6 ++++++
 .../remoteproc/qcom,qcs404-cdsp-pil.yaml       |  6 ++++++
 .../remoteproc/qcom,sc7180-mss-pil.yaml        |  6 ++++++
 .../remoteproc/qcom,sc7280-adsp-pil.yaml       |  6 ++++++
 .../remoteproc/qcom,sc7280-mss-pil.yaml        |  6 ++++++
 .../remoteproc/qcom,sc7280-wpss-pil.yaml       |  6 ++++++
 .../remoteproc/qcom,sdm845-adsp-pil.yaml       |  6 ++++++
 .../bindings/remoteproc/qcom,wcnss-pil.yaml    |  6 ++++++
 .../devicetree/bindings/sound/samsung,tm2.yaml |  8 ++++++--
 .../bindings/spi/st,stm32mp25-ospi.yaml        |  5 +++--
 .../bindings/usb/chipidea,usb2-common.yaml     |  2 ++
 .../devicetree/bindings/usb/ci-hdrc-usb2.yaml  |  7 ++++---
 23 files changed, 142 insertions(+), 14 deletions(-)
Documentation/devicetree/bindings/display/rockchip/rockchip,rk3399-cdn-dp.yaml +2 -0
index 1a33128e77f5..195f665970bf 100644
@@ -41,7 +41,9 @@ properties:
     minItems: 1
     items:
       - description: Extcon device providing the cable state for DP PHY device 0
+        maxItems: 1
       - description: Extcon device providing the cable state for DP PHY device 1
+        maxItems: 1
     description:
       List of phandle to the extcon device providing the cable state for the DP PHY.
 
Documentation/devicetree/bindings/i2c/i2c-demux-pinctrl.yaml +1 -0
index 1eaf00b90a77..deca72bfc8cf 100644
@@ -40,6 +40,7 @@ properties:
 
   i2c-parent:
     $ref: /schemas/types.yaml#/definitions/phandle-array
+    minItems: 2
     items:
       maxItems: 1
     description:
Documentation/devicetree/bindings/mmc/hisilicon,hi3798cv200-dw-mshc.yaml +4 -3
index 41c9b22523e7..e447579e0f22 100644
@@ -39,10 +39,11 @@ properties:
     $ref: /schemas/types.yaml#/definitions/phandle-array
     description: |
       DWMMC core on Hi3798MV2x SoCs has a delay-locked-loop(DLL) attached to card data input path.
-      It is integrated into CRG core on the SoC and has to be controlled during tuning.
+      It is integrated into CRG core on the SoC and has to be controlled during tuning
     items:
-      - description: A phandle pointed to the CRG syscon node
-      - description: Sample DLL register offset in CRG address space
+      - items:
+          - description: A phandle pointed to the CRG syscon node
+          - description: Sample DLL register offset in CRG address space
 
 required:
   - compatible
Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml +12 -0
index b30544410d09..33746c238513 100644
@@ -42,7 +42,19 @@ properties:
     description: State bits used by the AP to signal the modem.
     items:
       - description: Power control
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
       - description: Power control acknowledgment
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description: Names for the state bits used by the AP to signal the modem.
Documentation/devicetree/bindings/net/qcom,ipa.yaml +12 -0
index fdeaa81b9645..68ec76fe4473 100644
@@ -128,7 +128,19 @@ properties:
     description: State bits used in by the AP to signal the modem.
     items:
       - description: Whether the "ipa-clock-enabled" state bit is valid
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
       - description: Whether the IPA clock is enabled (if valid)
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description: The names of the state bits used for SMP2P output
Documentation/devicetree/bindings/net/wireless/qcom,ath10k.yaml +7 -1
index c21d66c7cd55..d4f4d72ee0d3 100644
@@ -158,7 +158,13 @@ properties:
     description: State bits used by the AP to signal the WLAN Q6.
     items:
       - description: Signal bits used to enable/disable low power mode
-                     on WCN in the case of WoW (Wake on Wireless).
+          on WCN in the case of WoW (Wake on Wireless).
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description: The names of the state bits used for SMP2P output.
Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml +7 -1
index 0cc1dbf2beef..d4aa56e2f823 100644
@@ -80,7 +80,13 @@ properties:
     description: State bits used by the AP to signal the WLAN Q6.
     items:
       - description: Signal bits used to enable/disable low power mode
-                     on WCN6750 in the case of WoW (Wake on Wireless).
+          on WCN6750 in the case of WoW (Wake on Wireless).
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description: The names of the state bits used for SMP2P output.
Documentation/devicetree/bindings/net/wireless/qcom,ipq5332-wifi.yaml +18 -0
index 37d8a0da7780..18cd91e2728c 100644
@@ -168,8 +168,26 @@ properties:
     description: States used by the AP to signal the remote processor
     items:
       - description: Shutdown WCSS pd
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
       - description: Stop WCSS pd
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
       - description: Spawn WCSS pd
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description:
Documentation/devicetree/bindings/pci/toshiba,tc9563.yaml +3 -2
index fae466064780..b3ad05d90201 100644
@@ -49,8 +49,9 @@ properties:
       A phandle to the parent I2C node and the slave address of the device
       used to configure tc9563 to change FTS, tx amplitude etc.
     items:
-      - description: Phandle to the I2C controller node
-      - description: I2C slave address
+      - items:
+          - description: Phandle to the I2C controller node
+          - description: I2C slave address
 
 patternProperties:
   "^pcie@[1-3],0$":
Documentation/devicetree/bindings/remoteproc/qcom,msm8916-mss-pil.yaml +6 -0
index faf2712e3d27..4049157dd83d 100644
@@ -108,6 +108,12 @@ properties:
     description: States used by the AP to signal the Hexagon core
     items:
       - description: Stop modem
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description: Names of the states used by the AP to signal the Hexagon core
Documentation/devicetree/bindings/remoteproc/qcom,msm8996-mss-pil.yaml +7 -0
index 1b65813cc8ad..4a1b439f985e 100644
@@ -101,6 +101,13 @@ properties:
     description: States used by the AP to signal the Hexagon core
     items:
       - description: Stop modem
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point or Shared
+              Memory Manager device handling the communication with a remote
+              processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description: Names of the states used by the AP to signal the Hexagon core
Documentation/devicetree/bindings/remoteproc/qcom,pas-common.yaml +6 -0
index 68c17bf18987..4607b459131b 100644
@@ -60,6 +60,12 @@ properties:
     description: States used by the AP to signal the Hexagon core
     items:
       - description: Stop the modem
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description: The names of the state bits used for SMP2P output
Documentation/devicetree/bindings/remoteproc/qcom,qcs404-cdsp-pil.yaml +6 -0
index bca59394aef4..e5f5f92987e1 100644
@@ -92,6 +92,12 @@ properties:
     description: States used by the AP to signal the Hexagon core
     items:
       - description: Stop the modem
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description: The names of the state bits used for SMP2P output
Documentation/devicetree/bindings/remoteproc/qcom,sc7180-mss-pil.yaml +6 -0
index 7c9accac92d0..21c82cd3be03 100644
@@ -133,6 +133,12 @@ properties:
     description: States used by the AP to signal the Hexagon core
     items:
       - description: Stop the modem
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description: The names of the state bits used for SMP2P output
Documentation/devicetree/bindings/remoteproc/qcom,sc7280-adsp-pil.yaml +6 -0
index 94ca7a0cc203..23b8e3079f3b 100644
@@ -91,6 +91,12 @@ properties:
     description: States used by the AP to signal the Hexagon core
     items:
       - description: Stop the modem
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description: The names of the state bits used for SMP2P output
Documentation/devicetree/bindings/remoteproc/qcom,sc7280-mss-pil.yaml +6 -0
index f349c303fa07..43dfb90ac18d 100644
@@ -147,6 +147,12 @@ properties:
     description: States used by the AP to signal the Hexagon core
     items:
       - description: Stop the modem
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description: The names of the state bits used for SMP2P output
Documentation/devicetree/bindings/remoteproc/qcom,sc7280-wpss-pil.yaml +6 -0
index f4118b2da5f6..f3f3432948ed 100644
@@ -104,6 +104,12 @@ properties:
     description: States used by the AP to signal the Hexagon core
     items:
       - description: Stop the modem
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description: The names of the state bits used for SMP2P output
Documentation/devicetree/bindings/remoteproc/qcom,sdm845-adsp-pil.yaml +6 -0
index a3c74871457f..9666ebf1e7b6 100644
@@ -92,6 +92,12 @@ properties:
     description: States used by the AP to signal the Hexagon core
     items:
       - description: Stop the modem
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description: The names of the state bits used for SMP2P output
Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml +6 -0
index 117fb4d0c4ad..a55e55f5f014 100644
@@ -84,6 +84,12 @@ properties:
       States used by the AP to signal the WCNSS core that it should shutdown
     items:
       - description: Stop the modem
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description: The names of the state bits used for SMP2P output
Documentation/devicetree/bindings/sound/samsung,tm2.yaml +6 -2
index 67586ba3e0a0..985b7d29cd33 100644
@@ -45,8 +45,12 @@ properties:
     description: Phandles to the I2S controllers.
     $ref: /schemas/types.yaml#/definitions/phandle-array
     items:
-      - description: Phandle to I2S0.
-      - description: Phandle to I2S1.
+      - items:
+          - description: Phandle to I2S0
+          - description: Unused
+      - items:
+          - description: Phandle to I2S1
+          - description: Unused
 
   mic-bias-gpios:
     description: GPIO pin that enables the Main Mic bias regulator.
Documentation/devicetree/bindings/spi/st,stm32mp25-ospi.yaml +3 -2
index 272bc308726b..b6be47f67fcb 100644
@@ -49,8 +49,9 @@ properties:
     description: configure OCTOSPI delay block.
     $ref: /schemas/types.yaml#/definitions/phandle-array
     items:
-      - description: phandle to syscfg
-      - description: register offset within syscfg
+      - items:
+          - description: phandle to syscfg
+          - description: register offset within syscfg
 
   access-controllers:
     description: phandle to the rifsc device to check access right
Documentation/devicetree/bindings/usb/chipidea,usb2-common.yaml +2 -0
index 10020af15afc..e6a5e79df348 100644
@@ -97,7 +97,9 @@ properties:
     minItems: 1
     items:
       - description: vbus extcon
+        maxItems: 1
       - description: id extcon
+        maxItems: 1
 
   phy-clkgate-delay-us:
     description:
Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml +4 -3
index 691d6cf02c27..fec04702f530 100644
@@ -61,9 +61,10 @@ properties:
       offset, and phy index
     $ref: /schemas/types.yaml#/definitions/phandle-array
     items:
-      - description: phandle to TCSR node
-      - description: register offset
-      - description: phy index
+      - items:
+          - description: phandle to TCSR node
+          - description: register offset
+          - description: phy index
 
   nvidia,phy:
     description: phandle of usb phy that connects to the port. Use "phys" instead.
Signature · 1 line
2.53.0
author maintainer
#1 lore raw
Quoted 29 lines · Rob Herring (Arm)

The unfortunately named 'phandle-array' property type is really a matrix with phandle and fixed arg cells entries. A matrix property should have 2 levels of items constraints.

---
v2:
- Add proper descriptions for 'qcom,smem-states'. Thanks Krzysztof!
- Fix i2c-parent warning
- Fix extra blank lines

---
 .../rockchip/rockchip,rk3399-cdn-dp.yaml       |  2 ++
 .../bindings/i2c/i2c-demux-pinctrl.yaml        |  1 +
 .../mmc/hisilicon,hi3798cv200-dw-mshc.yaml     |  7 ++++---
 .../devicetree/bindings/net/qcom,bam-dmux.yaml | 12 ++++++++++++
 .../devicetree/bindings/net/qcom,ipa.yaml      | 12 ++++++++++++
 .../bindings/net/wireless/qcom,ath10k.yaml     |  8 +++++++-
 .../bindings/net/wireless/qcom,ath11k.yaml     |  8 +++++++-
 .../net/wireless/qcom,ipq5332-wifi.yaml        | 18 ++++++++++++++++++
 .../bindings/pci/toshiba,tc9563.yaml           |  5 +++--
 .../remoteproc/qcom,msm8916-mss-pil.yaml       |  6 ++++++
 .../remoteproc/qcom,msm8996-mss-pil.yaml       |  7 +++++++
 .../bindings/remoteproc/qcom,pas-common.yaml   |  6 ++++++
 .../remoteproc/qcom,qcs404-cdsp-pil.yaml       |  6 ++++++
 .../remoteproc/qcom,sc7180-mss-pil.yaml        |  6 ++++++
 .../remoteproc/qcom,sc7280-adsp-pil.yaml       |  6 ++++++
 .../remoteproc/qcom,sc7280-mss-pil.yaml        |  6 ++++++
Quoted 9 lines
 .../remoteproc/qcom,sc7280-wpss-pil.yaml       |  6 ++++++
 .../remoteproc/qcom,sdm845-adsp-pil.yaml       |  6 ++++++
 .../bindings/remoteproc/qcom,wcnss-pil.yaml    |  6 ++++++
 .../devicetree/bindings/sound/samsung,tm2.yaml |  8 ++++++--
 .../bindings/spi/st,stm32mp25-ospi.yaml        |  5 +++--
 .../bindings/usb/chipidea,usb2-common.yaml     |  2 ++
 .../devicetree/bindings/usb/ci-hdrc-usb2.yaml  |  7 ++++---
 23 files changed, 142 insertions(+), 14 deletions(-)

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/i2c/i2c-demux-pinctrl.example.dtb: i2c-mux3 (i2c-demux-pinctrl): i2c-parent:0: [2, 3, 4] is too long
from schema $id: http://devicetree.org/schemas/i2c/i2c-demux-pinctrl.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/i2c/i2c-demux-pinctrl.example.dtb: i2c-mux3 (i2c-demux-pinctrl): i2c-parent: [[2, 3, 4]] is too short
from schema $id: http://devicetree.org/schemas/i2c/i2c-demux-pinctrl.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.kernel.org/project/devicetree/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.

author maintainer
#2 lore raw
Quoted 43 lines · Rob Herring (Arm)
Quoted 29 lines · Rob Herring (Arm)

The unfortunately named 'phandle-array' property type is really a matrix with phandle and fixed arg cells entries. A matrix property should have 2 levels of items constraints.

---
v2:
- Add proper descriptions for 'qcom,smem-states'. Thanks Krzysztof!
- Fix i2c-parent warning
- Fix extra blank lines

---
 .../rockchip/rockchip,rk3399-cdn-dp.yaml       |  2 ++
 .../bindings/i2c/i2c-demux-pinctrl.yaml        |  1 +
 .../mmc/hisilicon,hi3798cv200-dw-mshc.yaml     |  7 ++++---
 .../devicetree/bindings/net/qcom,bam-dmux.yaml | 12 ++++++++++++
 .../devicetree/bindings/net/qcom,ipa.yaml      | 12 ++++++++++++
 .../bindings/net/wireless/qcom,ath10k.yaml     |  8 +++++++-
 .../bindings/net/wireless/qcom,ath11k.yaml     |  8 +++++++-
 .../net/wireless/qcom,ipq5332-wifi.yaml        | 18 ++++++++++++++++++
 .../bindings/pci/toshiba,tc9563.yaml           |  5 +++--
 .../remoteproc/qcom,msm8916-mss-pil.yaml       |  6 ++++++
 .../remoteproc/qcom,msm8996-mss-pil.yaml       |  7 +++++++
 .../bindings/remoteproc/qcom,pas-common.yaml   |  6 ++++++
 .../remoteproc/qcom,qcs404-cdsp-pil.yaml       |  6 ++++++
 .../remoteproc/qcom,sc7180-mss-pil.yaml        |  6 ++++++
 .../remoteproc/qcom,sc7280-adsp-pil.yaml       |  6 ++++++
 .../remoteproc/qcom,sc7280-mss-pil.yaml        |  6 ++++++
Quoted 9 lines
 .../remoteproc/qcom,sc7280-wpss-pil.yaml       |  6 ++++++
 .../remoteproc/qcom,sdm845-adsp-pil.yaml       |  6 ++++++
 .../bindings/remoteproc/qcom,wcnss-pil.yaml    |  6 ++++++
 .../devicetree/bindings/sound/samsung,tm2.yaml |  8 ++++++--
 .../bindings/spi/st,stm32mp25-ospi.yaml        |  5 +++--
 .../bindings/usb/chipidea,usb2-common.yaml     |  2 ++
 .../devicetree/bindings/usb/ci-hdrc-usb2.yaml  |  7 ++++---
 23 files changed, 142 insertions(+), 14 deletions(-)

My bot found errors running 'make dt_binding_check' on your patch:

Quoted 7 lines

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/i2c/i2c-demux-pinctrl.example.dtb: i2c-mux3 (i2c-demux-pinctrl): i2c-parent:0: [2, 3, 4] is too long
from schema $id: http://devicetree.org/schemas/i2c/i2c-demux-pinctrl.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/i2c/i2c-demux-pinctrl.example.dtb: i2c-mux3 (i2c-demux-pinctrl): i2c-parent: [[2, 3, 4]] is too short
from schema $id: http://devicetree.org/schemas/i2c/i2c-demux-pinctrl.yaml

This needs a fix in dtschema I have not yet pushed out.

Rob

#3 lore raw
In reply to Rob Herring (Arm)
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] The `maximum` constraint for the 'Single bit index to toggle' in `qcom,smem-states` properties is…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The maximum constraint for the 'Single bit index to toggle' in qcom,smem-states properties is incorrectly set to 32 instead of 31. --

commit 20348129b7dc793c517f442ef59bc8d4f2293a0e
Author: Rob Herring (Arm) <[email protected]>

dt-bindings: Fix phandle-array constraints, again

The unfortunately named 'phandle-array' property type is really a matrix with phandle and fixed arg cells entries. A matrix property should have 2 levels of items constraints.

[ ... ]

Quoted 5 lines
Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml +0 -0
index b30544410d092..33746c238513d 100644

Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml properties: · line 50

Quoted 9 lines
Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml +6 -0
@@ -42,7 +42,19 @@ properties:
     description: State bits used by the AP to signal the modem.
     items:
       - description: Power control
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32

Should this maximum be 31 instead of 32?

A valid bit index for a 32-bit value ranges from 0 to 31. Setting the maximum to 32 permits a device tree to specify an out-of-bounds bit index, which could lead to undefined behavior if a driver shifts by 32 on a 32-bit architecture.

This maximum of 32 is also used for the smem-states additions in the other bindings updated in this patch.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
maintainer Acked-by on v2 1/1
#4 lore raw
In reply to Rob Herring (Arm)
Quoted 7 lines · Rob Herring (Arm)

The unfortunately named 'phandle-array' property type is really a matrix with phandle and fixed arg cells entries. A matrix property should have 2 levels of items constraints.

- Mani

Quoted 450 lines

---
v2:
- Add proper descriptions for 'qcom,smem-states'. Thanks Krzysztof!
- Fix i2c-parent warning
- Fix extra blank lines

---
 .../rockchip/rockchip,rk3399-cdn-dp.yaml       |  2 ++
 .../bindings/i2c/i2c-demux-pinctrl.yaml        |  1 +
 .../mmc/hisilicon,hi3798cv200-dw-mshc.yaml     |  7 ++++---
 .../devicetree/bindings/net/qcom,bam-dmux.yaml | 12 ++++++++++++
 .../devicetree/bindings/net/qcom,ipa.yaml      | 12 ++++++++++++
 .../bindings/net/wireless/qcom,ath10k.yaml     |  8 +++++++-
 .../bindings/net/wireless/qcom,ath11k.yaml     |  8 +++++++-
 .../net/wireless/qcom,ipq5332-wifi.yaml        | 18 ++++++++++++++++++
 .../bindings/pci/toshiba,tc9563.yaml           |  5 +++--
 .../remoteproc/qcom,msm8916-mss-pil.yaml       |  6 ++++++
 .../remoteproc/qcom,msm8996-mss-pil.yaml       |  7 +++++++
 .../bindings/remoteproc/qcom,pas-common.yaml   |  6 ++++++
 .../remoteproc/qcom,qcs404-cdsp-pil.yaml       |  6 ++++++
 .../remoteproc/qcom,sc7180-mss-pil.yaml        |  6 ++++++
 .../remoteproc/qcom,sc7280-adsp-pil.yaml       |  6 ++++++
 .../remoteproc/qcom,sc7280-mss-pil.yaml        |  6 ++++++
 .../remoteproc/qcom,sc7280-wpss-pil.yaml       |  6 ++++++
 .../remoteproc/qcom,sdm845-adsp-pil.yaml       |  6 ++++++
 .../bindings/remoteproc/qcom,wcnss-pil.yaml    |  6 ++++++
 .../devicetree/bindings/sound/samsung,tm2.yaml |  8 ++++++--
 .../bindings/spi/st,stm32mp25-ospi.yaml        |  5 +++--
 .../bindings/usb/chipidea,usb2-common.yaml     |  2 ++
 .../devicetree/bindings/usb/ci-hdrc-usb2.yaml  |  7 ++++---
 23 files changed, 142 insertions(+), 14 deletions(-)
Documentation/devicetree/bindings/display/rockchip/rockchip,rk3399-cdn-dp.yaml +2 -0
index 1a33128e77f5..195f665970bf 100644
@@ -41,7 +41,9 @@ properties:
     minItems: 1
     items:
       - description: Extcon device providing the cable state for DP PHY device 0
+        maxItems: 1
       - description: Extcon device providing the cable state for DP PHY device 1
+        maxItems: 1
     description:
       List of phandle to the extcon device providing the cable state for the DP PHY.
 
Documentation/devicetree/bindings/i2c/i2c-demux-pinctrl.yaml +1 -0
index 1eaf00b90a77..deca72bfc8cf 100644
@@ -40,6 +40,7 @@ properties:
 
   i2c-parent:
     $ref: /schemas/types.yaml#/definitions/phandle-array
+    minItems: 2
     items:
       maxItems: 1
     description:
Documentation/devicetree/bindings/mmc/hisilicon,hi3798cv200-dw-mshc.yaml +4 -3
index 41c9b22523e7..e447579e0f22 100644
@@ -39,10 +39,11 @@ properties:
     $ref: /schemas/types.yaml#/definitions/phandle-array
     description: |
       DWMMC core on Hi3798MV2x SoCs has a delay-locked-loop(DLL) attached to card data input path.
-      It is integrated into CRG core on the SoC and has to be controlled during tuning.
+      It is integrated into CRG core on the SoC and has to be controlled during tuning
     items:
-      - description: A phandle pointed to the CRG syscon node
-      - description: Sample DLL register offset in CRG address space
+      - items:
+          - description: A phandle pointed to the CRG syscon node
+          - description: Sample DLL register offset in CRG address space
 
 required:
   - compatible
Documentation/devicetree/bindings/net/qcom,bam-dmux.yaml +12 -0
index b30544410d09..33746c238513 100644
@@ -42,7 +42,19 @@ properties:
     description: State bits used by the AP to signal the modem.
     items:
       - description: Power control
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
       - description: Power control acknowledgment
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description: Names for the state bits used by the AP to signal the modem.
Documentation/devicetree/bindings/net/qcom,ipa.yaml +12 -0
index fdeaa81b9645..68ec76fe4473 100644
@@ -128,7 +128,19 @@ properties:
     description: State bits used in by the AP to signal the modem.
     items:
       - description: Whether the "ipa-clock-enabled" state bit is valid
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
       - description: Whether the IPA clock is enabled (if valid)
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description: The names of the state bits used for SMP2P output
Documentation/devicetree/bindings/net/wireless/qcom,ath10k.yaml +7 -1
index c21d66c7cd55..d4f4d72ee0d3 100644
@@ -158,7 +158,13 @@ properties:
     description: State bits used by the AP to signal the WLAN Q6.
     items:
       - description: Signal bits used to enable/disable low power mode
-                     on WCN in the case of WoW (Wake on Wireless).
+          on WCN in the case of WoW (Wake on Wireless).
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description: The names of the state bits used for SMP2P output.
Documentation/devicetree/bindings/net/wireless/qcom,ath11k.yaml +7 -1
index 0cc1dbf2beef..d4aa56e2f823 100644
@@ -80,7 +80,13 @@ properties:
     description: State bits used by the AP to signal the WLAN Q6.
     items:
       - description: Signal bits used to enable/disable low power mode
-                     on WCN6750 in the case of WoW (Wake on Wireless).
+          on WCN6750 in the case of WoW (Wake on Wireless).
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description: The names of the state bits used for SMP2P output.
Documentation/devicetree/bindings/net/wireless/qcom,ipq5332-wifi.yaml +18 -0
index 37d8a0da7780..18cd91e2728c 100644
@@ -168,8 +168,26 @@ properties:
     description: States used by the AP to signal the remote processor
     items:
       - description: Shutdown WCSS pd
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
       - description: Stop WCSS pd
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
       - description: Spawn WCSS pd
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description:
Documentation/devicetree/bindings/pci/toshiba,tc9563.yaml +3 -2
index fae466064780..b3ad05d90201 100644
@@ -49,8 +49,9 @@ properties:
       A phandle to the parent I2C node and the slave address of the device
       used to configure tc9563 to change FTS, tx amplitude etc.
     items:
-      - description: Phandle to the I2C controller node
-      - description: I2C slave address
+      - items:
+          - description: Phandle to the I2C controller node
+          - description: I2C slave address
 
 patternProperties:
   "^pcie@[1-3],0$":
Documentation/devicetree/bindings/remoteproc/qcom,msm8916-mss-pil.yaml +6 -0
index faf2712e3d27..4049157dd83d 100644
@@ -108,6 +108,12 @@ properties:
     description: States used by the AP to signal the Hexagon core
     items:
       - description: Stop modem
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description: Names of the states used by the AP to signal the Hexagon core
Documentation/devicetree/bindings/remoteproc/qcom,msm8996-mss-pil.yaml +7 -0
index 1b65813cc8ad..4a1b439f985e 100644
@@ -101,6 +101,13 @@ properties:
     description: States used by the AP to signal the Hexagon core
     items:
       - description: Stop modem
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point or Shared
+              Memory Manager device handling the communication with a remote
+              processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description: Names of the states used by the AP to signal the Hexagon core
Documentation/devicetree/bindings/remoteproc/qcom,pas-common.yaml +6 -0
index 68c17bf18987..4607b459131b 100644
@@ -60,6 +60,12 @@ properties:
     description: States used by the AP to signal the Hexagon core
     items:
       - description: Stop the modem
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description: The names of the state bits used for SMP2P output
Documentation/devicetree/bindings/remoteproc/qcom,qcs404-cdsp-pil.yaml +6 -0
index bca59394aef4..e5f5f92987e1 100644
@@ -92,6 +92,12 @@ properties:
     description: States used by the AP to signal the Hexagon core
     items:
       - description: Stop the modem
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description: The names of the state bits used for SMP2P output
Documentation/devicetree/bindings/remoteproc/qcom,sc7180-mss-pil.yaml +6 -0
index 7c9accac92d0..21c82cd3be03 100644
@@ -133,6 +133,12 @@ properties:
     description: States used by the AP to signal the Hexagon core
     items:
       - description: Stop the modem
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description: The names of the state bits used for SMP2P output
Documentation/devicetree/bindings/remoteproc/qcom,sc7280-adsp-pil.yaml +6 -0
index 94ca7a0cc203..23b8e3079f3b 100644
@@ -91,6 +91,12 @@ properties:
     description: States used by the AP to signal the Hexagon core
     items:
       - description: Stop the modem
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description: The names of the state bits used for SMP2P output
Documentation/devicetree/bindings/remoteproc/qcom,sc7280-mss-pil.yaml +6 -0
index f349c303fa07..43dfb90ac18d 100644
@@ -147,6 +147,12 @@ properties:
     description: States used by the AP to signal the Hexagon core
     items:
       - description: Stop the modem
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description: The names of the state bits used for SMP2P output
Documentation/devicetree/bindings/remoteproc/qcom,sc7280-wpss-pil.yaml +6 -0
index f4118b2da5f6..f3f3432948ed 100644
@@ -104,6 +104,12 @@ properties:
     description: States used by the AP to signal the Hexagon core
     items:
       - description: Stop the modem
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description: The names of the state bits used for SMP2P output
Documentation/devicetree/bindings/remoteproc/qcom,sdm845-adsp-pil.yaml +6 -0
index a3c74871457f..9666ebf1e7b6 100644
@@ -92,6 +92,12 @@ properties:
     description: States used by the AP to signal the Hexagon core
     items:
       - description: Stop the modem
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description: The names of the state bits used for SMP2P output
Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.yaml +6 -0
index 117fb4d0c4ad..a55e55f5f014 100644
@@ -84,6 +84,12 @@ properties:
       States used by the AP to signal the WCNSS core that it should shutdown
     items:
       - description: Stop the modem
+        items:
+          - description: Phandle to the Shared Memory Point 2 Point device
+              handling the communication with a remote processor
+          - description: Single bit index to toggle in the value sent to
+              the remote processor
+            maximum: 32
 
   qcom,smem-state-names:
     description: The names of the state bits used for SMP2P output
Documentation/devicetree/bindings/sound/samsung,tm2.yaml +6 -2
index 67586ba3e0a0..985b7d29cd33 100644
@@ -45,8 +45,12 @@ properties:
     description: Phandles to the I2S controllers.
     $ref: /schemas/types.yaml#/definitions/phandle-array
     items:
-      - description: Phandle to I2S0.
-      - description: Phandle to I2S1.
+      - items:
+          - description: Phandle to I2S0
+          - description: Unused
+      - items:
+          - description: Phandle to I2S1
+          - description: Unused
 
   mic-bias-gpios:
     description: GPIO pin that enables the Main Mic bias regulator.
Documentation/devicetree/bindings/spi/st,stm32mp25-ospi.yaml +3 -2
index 272bc308726b..b6be47f67fcb 100644
@@ -49,8 +49,9 @@ properties:
     description: configure OCTOSPI delay block.
     $ref: /schemas/types.yaml#/definitions/phandle-array
     items:
-      - description: phandle to syscfg
-      - description: register offset within syscfg
+      - items:
+          - description: phandle to syscfg
+          - description: register offset within syscfg
 
   access-controllers:
     description: phandle to the rifsc device to check access right
Documentation/devicetree/bindings/usb/chipidea,usb2-common.yaml +2 -0
index 10020af15afc..e6a5e79df348 100644
@@ -97,7 +97,9 @@ properties:
     minItems: 1
     items:
       - description: vbus extcon
+        maxItems: 1
       - description: id extcon
+        maxItems: 1
 
   phy-clkgate-delay-us:
     description:
Documentation/devicetree/bindings/usb/ci-hdrc-usb2.yaml +4 -3
index 691d6cf02c27..fec04702f530 100644
@@ -61,9 +61,10 @@ properties:
       offset, and phy index
     $ref: /schemas/types.yaml#/definitions/phandle-array
     items:
-      - description: phandle to TCSR node
-      - description: register offset
-      - description: phy index
+      - items:
+          - description: phandle to TCSR node
+          - description: register offset
+          - description: phy index
 
   nvidia,phy:
     description: phandle of usb phy that connects to the port. Use "phys" instead.
Signature · 1 line
2.53.0
Signature · 1 line
மணிவண்ணன் சதாசிவம்