Skip to contentSkip to conversation

dt_binding_check not reporting all errors

PATCH Michal Simek 2 participants 3 messages Apr 24, 2023 – Apr 26, 2023 2 messages not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi,

last week I found that dt_binding_check is not checking all errors with compatible string and I have no idea why. I have used 3 systems and behavior is pretty much the same. I am on the top of 6.3 kernel with
dt-validate -V
2023.5.dev3+g31cc52ae483e

And here is the behavior.
Two compatible string I see errors but if I break only one compatible string I can't see erros. Not sure if this is issue with dt binding document or with host PC setup. Definitely thank you for any hint what to check.

Thanks,
Michal

[linux](master)$ vim Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml [linux](master)$ git diff

Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml +1 -1
index 098b73134a1b..fbd9754ab0a3 100644
@@ -110,7 +110,7 @@ examples:
         usb@0 {
             #address-cells = <0x2>;
             #size-cells = <0x2>;
-            compatible = "xlnx,zynqmp-dwc3";
+            compatible = "xlnx,zynqmp-dwc32", "xlnx,zynqmp-dwc3";
             reg = <0x0 0xff9d0000 0x0 0x100>;
             clocks = <&zynqmp_clk USB0_BUS_REF>, <&zynqmp_clk USB3_DUAL_REF>;
             clock-names = "bus_clk", "ref_clk";

[linux](master)$ make DT_SCHEMA_FILES=Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml dt_binding_check

  LINT    Documentation/devicetree/bindings
  CHKDT   Documentation/devicetree/bindings/processed-schema.json
  SCHEMA  Documentation/devicetree/bindings/processed-schema.json
  DTEX    Documentation/devicetree/bindings/usb/dwc3-xilinx.example.dts

DTC_CHK Documentation/devicetree/bindings/usb/dwc3-xilinx.example.dtb
/dev/shm/linux/Documentation/devicetree/bindings/usb/dwc3-xilinx.example.dtb: usb@0: compatible:0: 'xlnx,zynqmp-dwc32' is not one of ['xlnx,zynqmp-dwc3', 'xlnx,versal-dwc3']
From schema: /dev/shm/linux/Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml
/dev/shm/linux/Documentation/devicetree/bindings/usb/dwc3-xilinx.example.dtb: usb@0: compatible: ['xlnx,zynqmp-dwc32', 'xlnx,zynqmp-dwc3'] is too long
From schema: /dev/shm/linux/Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml

[linux](master)$ vim Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml [linux](master)$ git diff Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml

Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml +1 -1
index 098b73134a1b..0b8985bf9b0b 100644
@@ -110,7 +110,7 @@ examples:
         usb@0 {
             #address-cells = <0x2>;
             #size-cells = <0x2>;
-            compatible = "xlnx,zynqmp-dwc3";
+            compatible = "xlnx,zynqmp-dwc32";
             reg = <0x0 0xff9d0000 0x0 0x100>;
             clocks = <&zynqmp_clk USB0_BUS_REF>, <&zynqmp_clk USB3_DUAL_REF>;
             clock-names = "bus_clk", "ref_clk";

[linux](master)$ make DT_SCHEMA_FILES=Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml dt_binding_check

  LINT    Documentation/devicetree/bindings
  CHKDT   Documentation/devicetree/bindings/processed-schema.json
  SCHEMA  Documentation/devicetree/bindings/processed-schema.json
  DTEX    Documentation/devicetree/bindings/usb/dwc3-xilinx.example.dts

DTC_CHK Documentation/devicetree/bindings/usb/dwc3-xilinx.example.dtb

[linux](master)$ vim Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml [linux](master)$ git diff Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml

Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml +1 -1
index 098b73134a1b..b6d0d6930a32 100644
@@ -110,7 +110,7 @@ examples:
         usb@0 {
             #address-cells = <0x2>;
             #size-cells = <0x2>;
-            compatible = "xlnx,zynqmp-dwc3";
+            compatible = "xlnx,ffdzynqmp-dwc3";
             reg = <0x0 0xff9d0000 0x0 0x100>;
             clocks = <&zynqmp_clk USB0_BUS_REF>, <&zynqmp_clk USB3_DUAL_REF>;
             clock-names = "bus_clk", "ref_clk";

[linux](master)$ make DT_SCHEMA_FILES=Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml dt_binding_check

  LINT    Documentation/devicetree/bindings
  CHKDT   Documentation/devicetree/bindings/processed-schema.json
  SCHEMA  Documentation/devicetree/bindings/processed-schema.json
  DTEX    Documentation/devicetree/bindings/usb/dwc3-xilinx.example.dts

DTC_CHK Documentation/devicetree/bindings/usb/dwc3-xilinx.example.dtb

A message that is not in the archive (sent off-list or not yet received): 77db7543-cae4-695c-7c86-6562534d4e87-5C7GfCeVMHo@public.gmane.org

#2 lore raw
Quoted 72 lines · On Mon, Apr 24, 2023 at 11:38 AM Michal Simek…

Hi,

last week I found that dt_binding_check is not checking all errors with compatible string and I have no idea why. I have used 3 systems and behavior is pretty much the same.
I am on the top of 6.3 kernel with
dt-validate -V
2023.5.dev3+g31cc52ae483e

And here is the behavior.
Two compatible string I see errors but if I break only one compatible string I can't see erros. Not sure if this is issue with dt binding document or with host PC setup. Definitely thank you for any hint what to check.

Thanks,
Michal

[linux](master)$ vim Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml [linux](master)$ git diff

Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml +1 -1
index 098b73134a1b..fbd9754ab0a3 100644
@@ -110,7 +110,7 @@ examples:
          usb@0 {
              #address-cells = <0x2>;
              #size-cells = <0x2>;
-            compatible = "xlnx,zynqmp-dwc3";
+            compatible = "xlnx,zynqmp-dwc32", "xlnx,zynqmp-dwc3";
              reg = <0x0 0xff9d0000 0x0 0x100>;
              clocks = <&zynqmp_clk USB0_BUS_REF>, <&zynqmp_clk USB3_DUAL_REF>;
              clock-names = "bus_clk", "ref_clk";

[linux](master)$ make DT_SCHEMA_FILES=Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml dt_binding_check

   LINT    Documentation/devicetree/bindings
   CHKDT   Documentation/devicetree/bindings/processed-schema.json
   SCHEMA  Documentation/devicetree/bindings/processed-schema.json
   DTEX    Documentation/devicetree/bindings/usb/dwc3-xilinx.example.dts

DTC_CHK Documentation/devicetree/bindings/usb/dwc3-xilinx.example.dtb
/dev/shm/linux/Documentation/devicetree/bindings/usb/dwc3-xilinx.example.dtb:
usb@0: compatible:0: 'xlnx,zynqmp-dwc32' is not one of ['xlnx,zynqmp-dwc3', 'xlnx,versal-dwc3']
From schema: /dev/shm/linux/Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml
/dev/shm/linux/Documentation/devicetree/bindings/usb/dwc3-xilinx.example.dtb:
usb@0: compatible: ['xlnx,zynqmp-dwc32', 'xlnx,zynqmp-dwc3'] is too long
From schema: /dev/shm/linux/Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml

[linux](master)$ vim Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml [linux](master)$ git diff Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml

Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml +1 -1
index 098b73134a1b..0b8985bf9b0b 100644
@@ -110,7 +110,7 @@ examples:
          usb@0 {
              #address-cells = <0x2>;
              #size-cells = <0x2>;
-            compatible = "xlnx,zynqmp-dwc3";
+            compatible = "xlnx,zynqmp-dwc32";
              reg = <0x0 0xff9d0000 0x0 0x100>;
              clocks = <&zynqmp_clk USB0_BUS_REF>, <&zynqmp_clk USB3_DUAL_REF>;
              clock-names = "bus_clk", "ref_clk";

[linux](master)$ make DT_SCHEMA_FILES=Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml dt_binding_check

Quoted 5 lines
   LINT    Documentation/devicetree/bindings
   CHKDT   Documentation/devicetree/bindings/processed-schema.json
   SCHEMA  Documentation/devicetree/bindings/processed-schema.json
   DTEX    Documentation/devicetree/bindings/usb/dwc3-xilinx.example.dts

DTC_CHK Documentation/devicetree/bindings/usb/dwc3-xilinx.example.dtb

'compatible' is how we decide whether to apply a schema or not (by default if there is no 'select' entry). If you have an unknown compatible, then no schema is going to be applied (except ones that always get applied). The way we check for unknown compatible strings is with the '-m' option on dt-validate. That's turned on for dtbs_check, but off for dt_binding_check until the remaining 20-30 warnings are fixed. Also, I don't think that works in conjunction with DT_SCHEMA_FILES being set.

Rob

A message that is not in the archive (sent off-list or not yet received): CAL_JsqJcJsjnao0FGzx7e-vxYnUGC6S3_GRORq1KyDQzqX-3hw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#4 lore raw
Quoted 79 lines · Rob Herring
Quoted 72 lines · On Mon, Apr 24, 2023 at 11:38 AM Michal Simek…

Hi,

last week I found that dt_binding_check is not checking all errors with compatible string and I have no idea why. I have used 3 systems and behavior is pretty much the same.
I am on the top of 6.3 kernel with
dt-validate -V
2023.5.dev3+g31cc52ae483e

And here is the behavior.
Two compatible string I see errors but if I break only one compatible string I can't see erros. Not sure if this is issue with dt binding document or with host PC setup. Definitely thank you for any hint what to check.

Thanks,
Michal

[linux](master)$ vim Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml [linux](master)$ git diff

Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml +1 -1
index 098b73134a1b..fbd9754ab0a3 100644
@@ -110,7 +110,7 @@ examples:
           usb@0 {
               #address-cells = <0x2>;
               #size-cells = <0x2>;
-            compatible = "xlnx,zynqmp-dwc3";
+            compatible = "xlnx,zynqmp-dwc32", "xlnx,zynqmp-dwc3";
               reg = <0x0 0xff9d0000 0x0 0x100>;
               clocks = <&zynqmp_clk USB0_BUS_REF>, <&zynqmp_clk USB3_DUAL_REF>;
               clock-names = "bus_clk", "ref_clk";

[linux](master)$ make DT_SCHEMA_FILES=Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml dt_binding_check

    LINT    Documentation/devicetree/bindings
    CHKDT   Documentation/devicetree/bindings/processed-schema.json
    SCHEMA  Documentation/devicetree/bindings/processed-schema.json
    DTEX    Documentation/devicetree/bindings/usb/dwc3-xilinx.example.dts

DTC_CHK Documentation/devicetree/bindings/usb/dwc3-xilinx.example.dtb
/dev/shm/linux/Documentation/devicetree/bindings/usb/dwc3-xilinx.example.dtb:
usb@0: compatible:0: 'xlnx,zynqmp-dwc32' is not one of ['xlnx,zynqmp-dwc3', 'xlnx,versal-dwc3']
From schema: /dev/shm/linux/Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml
/dev/shm/linux/Documentation/devicetree/bindings/usb/dwc3-xilinx.example.dtb:
usb@0: compatible: ['xlnx,zynqmp-dwc32', 'xlnx,zynqmp-dwc3'] is too long
From schema: /dev/shm/linux/Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml

[linux](master)$ vim Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml [linux](master)$ git diff Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml

Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml +1 -1
index 098b73134a1b..0b8985bf9b0b 100644
@@ -110,7 +110,7 @@ examples:
           usb@0 {
               #address-cells = <0x2>;
               #size-cells = <0x2>;
-            compatible = "xlnx,zynqmp-dwc3";
+            compatible = "xlnx,zynqmp-dwc32";
               reg = <0x0 0xff9d0000 0x0 0x100>;
               clocks = <&zynqmp_clk USB0_BUS_REF>, <&zynqmp_clk USB3_DUAL_REF>;
               clock-names = "bus_clk", "ref_clk";

[linux](master)$ make DT_SCHEMA_FILES=Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml dt_binding_check

Quoted 5 lines
    LINT    Documentation/devicetree/bindings
    CHKDT   Documentation/devicetree/bindings/processed-schema.json
    SCHEMA  Documentation/devicetree/bindings/processed-schema.json
    DTEX    Documentation/devicetree/bindings/usb/dwc3-xilinx.example.dts

DTC_CHK Documentation/devicetree/bindings/usb/dwc3-xilinx.example.dtb

Quoted 8 lines

'compatible' is how we decide whether to apply a schema or not (by default if there is no 'select' entry). If you have an unknown compatible, then no schema is going to be applied (except ones that always get applied). The way we check for unknown compatible strings is with the '-m' option on dt-validate. That's turned on for dtbs_check, but off for dt_binding_check until the remaining 20-30 warnings are fixed. Also, I don't think that works in conjunction with DT_SCHEMA_FILES being set.

ok. Clear. Yes -m is not enabled for DT_SCHEMA_FILES.

Thanks,
Michal