Message ID | 20191209092147.22901-1-kishon@ti.com |
---|---|
Headers | show |
Series | Add PCIe support to TI's J721E SoC | expand |
On Mon, Dec 09, 2019 at 02:51:35PM +0530, Kishon Vijay Abraham I wrote: > commit bd22885aa188f135fd9 ("PCI: cadence: Refactor driver to use > as a core library") while refactoring the Cadence PCIe driver to be > used as library, removed pm_runtime_get_sync() from cdns_pcie_ep_setup() > and cdns_pcie_host_setup() but missed to remove the corresponding > pm_runtime_put_sync() in the error path. Fix it here. > > Fixes: commit bd22885aa188f135fd9 ("PCI: cadence: Refactor driver to use As this is a fix, a commit subject starting with PCI: cadence: Fix ... may be more obvious. I'd suggest you use the shorter form of this, i.e. Fixes: %h (\"%s\")) Fixes: bd22885aa188 ("PCI: cadence: Refactor driver to use as a core library") > as a core library") > > Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> > --- > drivers/pci/controller/cadence/pcie-cadence-ep.c | 2 -- > drivers/pci/controller/cadence/pcie-cadence-host.c | 2 -- > 2 files changed, 4 deletions(-) > > diff --git a/drivers/pci/controller/cadence/pcie-cadence-ep.c b/drivers/pci/controller/cadence/pcie-cadence-ep.c > index 1c173dad67d1..560f22b4d165 100644 > --- a/drivers/pci/controller/cadence/pcie-cadence-ep.c > +++ b/drivers/pci/controller/cadence/pcie-cadence-ep.c > @@ -473,7 +473,5 @@ int cdns_pcie_ep_setup(struct cdns_pcie_ep *ep) > pci_epc_mem_exit(epc); > > err_init: > - pm_runtime_put_sync(dev); > - > return ret; > } > diff --git a/drivers/pci/controller/cadence/pcie-cadence-host.c b/drivers/pci/controller/cadence/pcie-cadence-host.c > index 9b1c3966414b..ccf55e143e1d 100644 > --- a/drivers/pci/controller/cadence/pcie-cadence-host.c > +++ b/drivers/pci/controller/cadence/pcie-cadence-host.c > @@ -275,7 +275,5 @@ int cdns_pcie_host_setup(struct cdns_pcie_rc *rc) > pci_free_resource_list(&resources); > > err_init: > - pm_runtime_put_sync(dev); > - There is probably more you can do here for both -host and -ep: - Remove the possibly now unused <linux/pm_runtime.h> include - Remove the err_init label and return directly from source. Thanks, Andrew Murray > return ret; > } > -- > 2.17.1 >
Hi, On 16/12/19 7:37 pm, Andrew Murray wrote: > On Mon, Dec 09, 2019 at 02:51:37PM +0530, Kishon Vijay Abraham I wrote: >> Add support to use custom read and write accessors. Platforms that >> doesn't support half word or byte access or any other constraint > > s/doesn't/don't/ > >> while accessing registers can use this feature to populate custom >> read and write accessors. These custom accessors are used for both >> standard register access and configuration space register access. > > You can put the following sentence underneath a --- as it's not needed > in the commit message (but may be helpful to reviewers). > >> This is in preparation for adding PCIe support in TI's J721E SoC which >> uses Cadence PCIe core. >> >> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> >> --- >> drivers/pci/controller/cadence/pcie-cadence.h | 99 +++++++++++++++++-- >> 1 file changed, 90 insertions(+), 9 deletions(-) >> >> diff --git a/drivers/pci/controller/cadence/pcie-cadence.h b/drivers/pci/controller/cadence/pcie-cadence.h >> index a2b28b912ca4..d0d91c69fa1d 100644 >> --- a/drivers/pci/controller/cadence/pcie-cadence.h >> +++ b/drivers/pci/controller/cadence/pcie-cadence.h >> @@ -223,6 +223,11 @@ enum cdns_pcie_msg_routing { >> MSG_ROUTING_GATHER, >> }; >> >> +struct cdns_pcie_ops { >> + u32 (*read)(void __iomem *addr, int size); >> + void (*write)(void __iomem *addr, int size, u32 value); >> +}; >> + >> /** >> * struct cdns_pcie - private data for Cadence PCIe controller drivers >> * @reg_base: IO mapped register base >> @@ -239,7 +244,7 @@ struct cdns_pcie { >> int phy_count; >> struct phy **phy; >> struct device_link **link; >> - const struct cdns_pcie_common_ops *ops; > > What was cdns_pcie_common_ops? It's not defined in the current tree is it? Yeah, it's spurious change that has got merged. > >> + const struct cdns_pcie_ops *ops; >> }; >> >> /** >> @@ -301,21 +306,47 @@ struct cdns_pcie_ep { >> /* Register access */ >> static inline void cdns_pcie_writeb(struct cdns_pcie *pcie, u32 reg, u8 value) >> { >> + void __iomem *addr = pcie->reg_base + reg; >> + >> + if (pcie->ops && pcie->ops->write) { >> + pcie->ops->write(addr, 0x1, value); >> + return; >> + } >> + >> writeb(value, pcie->reg_base + reg); > > Can you use 'addr' here instead of 'pcie->reg_base + reg'? (And similar for the > rest of them). Sure. Thanks Kishon
Hi Rob, On 19/12/19 5:38 AM, Rob Herring wrote: > On Mon, Dec 09, 2019 at 02:51:43PM +0530, Kishon Vijay Abraham I wrote: >> Add host mode dt-bindings for TI's J721E SoC. >> >> Cc: Rob Herring <robh+dt@kernel.org> >> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> >> --- >> .../bindings/pci/ti,j721e-pci-host.yaml | 161 ++++++++++++++++++ >> 1 file changed, 161 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/pci/ti,j721e-pci-host.yaml >> >> diff --git a/Documentation/devicetree/bindings/pci/ti,j721e-pci-host.yaml b/Documentation/devicetree/bindings/pci/ti,j721e-pci-host.yaml >> new file mode 100644 >> index 000000000000..96184e1f419f >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/pci/ti,j721e-pci-host.yaml >> @@ -0,0 +1,161 @@ >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) >> +# Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com/ >> +%YAML 1.2 >> +--- >> +$id: "http://devicetree.org/schemas/pci/ti,j721e-pci-host.yaml#" >> +$schema: "http://devicetree.org/meta-schemas/core.yaml#" >> + >> +title: TI J721E PCI Host (PCIe Wrapper) >> + >> +maintainers: >> + - Kishon Vijay Abraham I <kishon@ti.com> > > There's now a PCI bus schema. Reference it here: > > allOf: > - $ref: "/schemas/pci/pci-bus.yaml#" > >> + >> +properties: >> + compatible: >> + enum: >> + - ti,j721e-pcie-host > > Indentation. > >> + >> + reg: >> + maxItems: 4 >> + >> + reg-names: >> + items: >> + - const: intd_cfg >> + - const: user_cfg >> + - const: reg >> + - const: cfg >> + >> + ti,syscon-pcie-ctrl: >> + description: Phandle to the SYSCON entry required for configuring PCIe mode >> + and link speed. >> + allOf: >> + - $ref: /schemas/types.yaml#/definitions/phandle > > You can drop the 'allOf' here if there aren't more constraints. Do you mean I don't have to include phandle schema here? I don't seem to be able to include $ref without allOf. Thanks Kishon