lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240117102526.557006-2-s-vadapalli@ti.com>
Date: Wed, 17 Jan 2024 15:55:24 +0530
From: Siddharth Vadapalli <s-vadapalli@...com>
To: <bhelgaas@...gle.com>, <lpieralisi@...nel.org>, <kw@...ux.com>,
        <robh@...nel.org>, <krzysztof.kozlowski+dt@...aro.org>,
        <conor+dt@...nel.org>
CC: <linux-pci@...r.kernel.org>, <devicetree@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <linux-arm-kernel@...ts.infradead.org>,
        <vigneshr@...com>, <afd@...com>, <srk@...com>, <s-vadapalli@...com>
Subject: [PATCH 1/3] dt-bindings: PCI: ti,j721e-pci-*: Fix check for num-lanes

The existing implementation for validating the "num-lanes" property
based on the compatible(s) doesn't enforce it. Fix it by updating the
checks to handle both single-compatible and multi-compatible cases.

Fixes: b3ba0f6e82cb ("dt-bindings: PCI: ti,j721e-pci-*: Add checks for num-lanes")
Fixes: adc14d44d7cb ("dt-bindings: PCI: ti,j721e-pci-*: Add j784s4-pci-* compatible strings")
Signed-off-by: Siddharth Vadapalli <s-vadapalli@...com>
---
 .../bindings/pci/ti,j721e-pci-ep.yaml         | 26 ++++++++++++++-----
 .../bindings/pci/ti,j721e-pci-host.yaml       | 26 ++++++++++++++-----
 2 files changed, 38 insertions(+), 14 deletions(-)

diff --git a/Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml b/Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml
index 97f2579ea908..278e0892f8ac 100644
--- a/Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml
+++ b/Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml
@@ -68,8 +68,9 @@ allOf:
   - if:
       properties:
         compatible:
-          enum:
-            - ti,am64-pcie-ep
+          items:
+            - const: ti,am64-pcie-ep
+            - const: ti,j721e-pcie-ep
     then:
       properties:
         num-lanes:
@@ -78,9 +79,9 @@ allOf:
   - if:
       properties:
         compatible:
-          enum:
-            - ti,j7200-pcie-ep
-            - ti,j721e-pcie-ep
+          items:
+            - const: ti,j7200-pcie-ep
+            - const: ti,j721e-pcie-ep
     then:
       properties:
         num-lanes:
@@ -90,8 +91,19 @@ allOf:
   - if:
       properties:
         compatible:
-          enum:
-            - ti,j784s4-pcie-ep
+          items:
+            - const: ti,j721e-pcie-ep
+    then:
+      properties:
+        num-lanes:
+          minimum: 1
+          maximum: 4
+
+  - if:
+      properties:
+        compatible:
+          items:
+            - const: ti,j784s4-pcie-ep
     then:
       properties:
         num-lanes:
diff --git a/Documentation/devicetree/bindings/pci/ti,j721e-pci-host.yaml b/Documentation/devicetree/bindings/pci/ti,j721e-pci-host.yaml
index b7a534cef24d..36bcc8cb7896 100644
--- a/Documentation/devicetree/bindings/pci/ti,j721e-pci-host.yaml
+++ b/Documentation/devicetree/bindings/pci/ti,j721e-pci-host.yaml
@@ -97,8 +97,9 @@ allOf:
   - if:
       properties:
         compatible:
-          enum:
-            - ti,am64-pcie-host
+          items:
+            - const: ti,am64-pcie-host
+            - const: ti,j721e-pcie-host
     then:
       properties:
         num-lanes:
@@ -107,9 +108,9 @@ allOf:
   - if:
       properties:
         compatible:
-          enum:
-            - ti,j7200-pcie-host
-            - ti,j721e-pcie-host
+          items:
+            - const: ti,j7200-pcie-host
+            - const: ti,j721e-pcie-host
     then:
       properties:
         num-lanes:
@@ -119,8 +120,19 @@ allOf:
   - if:
       properties:
         compatible:
-          enum:
-            - ti,j784s4-pcie-host
+          items:
+            - const: ti,j721e-pcie-host
+    then:
+      properties:
+        num-lanes:
+          minimum: 1
+          maximum: 4
+
+  - if:
+      properties:
+        compatible:
+          items:
+            - const: ti,j784s4-pcie-host
     then:
       properties:
         num-lanes:
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ