1 From e833cdb5c792912d459773cc23153e5d78875d34 Mon Sep 17 00:00:00 2001
2 From: Sham Muthayyan <smuthayy@codeaurora.org>
3 Date: Tue, 19 Jul 2016 20:05:25 +0530
4 Subject: PCIE: designware: Fixed PCI host init
6 Change-Id: I949b302d77199fc09342acf26b7bb45a7ec467ee
7 Signed-off-by: Sham Muthayyan <smuthayy@codeaurora.org>
9 drivers/pci/host/pcie-designware.c | 9 +++++++--
10 drivers/pci/host/pcie-designware.h | 2 +-
11 drivers/pci/host/pcie-qcom.c | 5 +++--
12 3 files changed, 11 insertions(+), 5 deletions(-)
14 --- a/drivers/pci/host/pcie-designware.c
15 +++ b/drivers/pci/host/pcie-designware.c
16 @@ -637,8 +637,13 @@ int dw_pcie_host_init(struct pcie_port *
20 - if (pp->ops->host_init)
21 - pp->ops->host_init(pp);
22 + if (pp->ops->host_init) {
23 + ret = pp->ops->host_init(pp);
25 + dev_err(pp->dev, "hostinit failed\n");
30 pp->root_bus_nr = pp->busn->start;
31 if (IS_ENABLED(CONFIG_PCI_MSI)) {
32 --- a/drivers/pci/host/pcie-designware.h
33 +++ b/drivers/pci/host/pcie-designware.h
34 @@ -63,7 +63,7 @@ struct pcie_host_ops {
35 int (*wr_other_conf)(struct pcie_port *pp, struct pci_bus *bus,
36 unsigned int devfn, int where, int size, u32 val);
37 int (*link_up)(struct pcie_port *pp);
38 - void (*host_init)(struct pcie_port *pp);
39 + int (*host_init)(struct pcie_port *pp);
40 void (*msi_set_irq)(struct pcie_port *pp, int irq);
41 void (*msi_clear_irq)(struct pcie_port *pp, int irq);
42 phys_addr_t (*get_msi_addr)(struct pcie_port *pp);
43 --- a/drivers/pci/host/pcie-qcom.c
44 +++ b/drivers/pci/host/pcie-qcom.c
45 @@ -515,7 +515,7 @@ static int qcom_pcie_link_up(struct pcie
46 return !!(val & PCI_EXP_LNKSTA_DLLLA);
49 -static void qcom_pcie_host_init(struct pcie_port *pp)
50 +static int qcom_pcie_host_init(struct pcie_port *pp)
52 struct qcom_pcie *pcie = to_qcom_pcie(pp);
54 @@ -541,12 +541,13 @@ static void qcom_pcie_host_init(struct p
61 qcom_ep_reset_assert(pcie);
62 phy_power_off(pcie->phy);
64 pcie->ops->deinit(pcie);
68 static int qcom_pcie_rd_own_conf(struct pcie_port *pp, int where, int size,