Skip to contentSkip to conversation

PCI: Make "cdns,max-outbound-regions" optional DT property

PATCH Applied Kishon Vijay Abraham I 3 participants 6 messages Nov 6, 2020 – Nov 20, 2020

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

cover PCI: Make "cdns,max-outbound-regions" optional DT property

Make "cdns,max-outbound-regions" optional DT property in all the platforms using Cadence PCIe core.

Kishon Vijay Abraham I (2):
dt-bindings: PCI: Make "cdns,max-outbound-regions" optional property
PCI: cadence: Do not error if "cdns,max-outbound-regions" is not found

 Documentation/devicetree/bindings/pci/cdns-pcie-ep.yaml  | 3 ---
 .../devicetree/bindings/pci/ti,j721e-pci-ep.yaml         | 2 --
 drivers/pci/controller/cadence/pcie-cadence-ep.c         | 9 +++------
 drivers/pci/controller/cadence/pcie-cadence.h            | 1 +
 4 files changed, 4 insertions(+), 11 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/2 dt-bindings: PCI: Make "cdns,max-outbound-regions" optional property

Make "cdns,max-outbound-regions" optional property with the default being 32.

---
 Documentation/devicetree/bindings/pci/cdns-pcie-ep.yaml    | 3 ---
 Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml | 2 --
 2 files changed, 5 deletions(-)
Documentation/devicetree/bindings/pci/cdns-pcie-ep.yaml +0 -3
index 60b8baf299bb..21e8a8849076 100644
@@ -20,7 +20,4 @@ properties:
     maximum: 32
     default: 32
 
-required:
-  - cdns,max-outbound-regions
-
 additionalProperties: true
Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml +0 -2
index 3ae3e1a2d4b0..aae07b723fb5 100644
@@ -57,7 +57,6 @@ required:
   - power-domains
   - clocks
   - clock-names
-  - cdns,max-outbound-regions
   - dma-coherent
   - max-functions
   - phys
@@ -86,7 +85,6 @@ examples:
            power-domains = <&k3_pds 239 TI_SCI_PD_EXCLUSIVE>;
            clocks = <&k3_clks 239 1>;
            clock-names = "fck";
-           cdns,max-outbound-regions = <16>;
            max-functions = /bits/ 8 <6>;
            dma-coherent;
            phys = <&serdes0_pcie_link>;
Signature · 1 line
2.17.1
maintainer Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] dt-bindings: PCI: Make "cdns,max-outbound-regions" optional property

Quoted 10 lines · Kishon Vijay Abraham I

Make "cdns,max-outbound-regions" optional property with the default being 32.

---
 Documentation/devicetree/bindings/pci/cdns-pcie-ep.yaml    | 3 ---
 Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.yaml | 2 --
 2 files changed, 5 deletions(-)
#3 lore raw

PATCH 2/2 PCI: cadence: Do not error if "cdns,max-outbound-regions" is not found

In reply to Kishon Vijay Abraham I

Now that "cdns,max-outbound-regions" is made an optional property, do not error out if "cdns,max-outbound-regions" device tree property is not found.

---
 drivers/pci/controller/cadence/pcie-cadence-ep.c | 9 +++------
 drivers/pci/controller/cadence/pcie-cadence.h    | 1 +
 2 files changed, 4 insertions(+), 6 deletions(-)
drivers/pci/controller/cadence/pcie-cadence-ep.c +3 -6
index 254a3e1eff50..9a4195af958e 100644
@@ -531,12 +531,9 @@ int cdns_pcie_ep_setup(struct cdns_pcie_ep *ep)
 	}
 	pcie->mem_res = res;
 
-	ret = of_property_read_u32(np, "cdns,max-outbound-regions",
-				   &ep->max_regions);
-	if (ret < 0) {
-		dev_err(dev, "missing \"cdns,max-outbound-regions\"\n");
-		return ret;
-	}
+	ep->max_regions = CDNS_PCIE_MAX_OB;
+	of_property_read_u32(np, "cdns,max-outbound-regions", &ep->max_regions);
+
 	ep->ob_addr = devm_kcalloc(dev,
 				   ep->max_regions, sizeof(*ep->ob_addr),
 				   GFP_KERNEL);
drivers/pci/controller/cadence/pcie-cadence.h +1 -0
index feed1e3038f4..30eba6cafe2c 100644
@@ -197,6 +197,7 @@ enum cdns_pcie_rp_bar {
 };
 
 #define CDNS_PCIE_RP_MAX_IB	0x3
+#define CDNS_PCIE_MAX_OB	32
 
 struct cdns_pcie_rp_ib_bar {
 	u64 size;
Signature · 1 line
2.17.1
maintainer Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] PCI: cadence: Do not error if "cdns,max-outbound-regions" is not found

Quoted 10 lines · Kishon Vijay Abraham I

Now that "cdns,max-outbound-regions" is made an optional property, do not error out if "cdns,max-outbound-regions" device tree property is not found.

---
 drivers/pci/controller/cadence/pcie-cadence-ep.c | 9 +++------
 drivers/pci/controller/cadence/pcie-cadence.h    | 1 +
 2 files changed, 4 insertions(+), 6 deletions(-)
Quoted 36 lines
drivers/pci/controller/cadence/pcie-cadence-ep.c +3 -6
index 254a3e1eff50..9a4195af958e 100644
@@ -531,12 +531,9 @@ int cdns_pcie_ep_setup(struct cdns_pcie_ep *ep)
 	}
 	pcie->mem_res = res;
 
-	ret = of_property_read_u32(np, "cdns,max-outbound-regions",
-				   &ep->max_regions);
-	if (ret < 0) {
-		dev_err(dev, "missing \"cdns,max-outbound-regions\"\n");
-		return ret;
-	}
+	ep->max_regions = CDNS_PCIE_MAX_OB;
+	of_property_read_u32(np, "cdns,max-outbound-regions", &ep->max_regions);
+
 	ep->ob_addr = devm_kcalloc(dev,
 				   ep->max_regions, sizeof(*ep->ob_addr),
 				   GFP_KERNEL);
drivers/pci/controller/cadence/pcie-cadence.h +1 -0
index feed1e3038f4..30eba6cafe2c 100644
@@ -197,6 +197,7 @@ enum cdns_pcie_rp_bar {
 };
 
 #define CDNS_PCIE_RP_MAX_IB	0x3
+#define CDNS_PCIE_MAX_OB	32
 
 struct cdns_pcie_rp_ib_bar {
 	u64 size;
Signature · 1 line
2.17.1
#5 lore raw
In reply to Kishon Vijay Abraham I
Quoted 8 lines · Kishon Vijay Abraham I

Make "cdns,max-outbound-regions" optional DT property in all the platforms using Cadence PCIe core.

Kishon Vijay Abraham I (2):
dt-bindings: PCI: Make "cdns,max-outbound-regions" optional property
PCI: cadence: Do not error if "cdns,max-outbound-regions" is not found

[...]

Applied to pci/cadence, thanks!

[1/2] dt-bindings: PCI: Make "cdns,max-outbound-regions" optional property

      https://git.kernel.org/lpieralisi/pci/c/4a2b9125c9
[2/2] PCI: cadence: Do not error if "cdns,max-outbound-regions" is not found
      https://git.kernel.org/lpieralisi/pci/c/e87d17ca6a

Thanks,
Lorenzo