summaryrefslogtreecommitdiff
path: root/drivers/pci/controller/dwc/pci-imx6.c
diff options
context:
space:
mode:
authorOleksandr Suvorov <oleksandr.suvorov@toradex.com>2021-02-02 18:38:41 +0200
committerOleksandr Suvorov <oleksandr.suvorov@toradex.com>2021-02-02 18:38:41 +0200
commit590db576d04d50801f2596c71c2d60583306a923 (patch)
tree9556d7ce6c4620d67ea255080828bef2b261978f /drivers/pci/controller/dwc/pci-imx6.c
parent342beab6e8c358264819c58511df685ede3385b0 (diff)
pci: pci-imx6: fix driver hangs in a register write
During mirgarion to the NXP's 5.4.70-2.3.0 branch, the original fix of this problem was misapplied. Retune the original Philippe's fix for the new driver version. Related-to: ELB-3529 Fixed: 8879894c4dad ("pci-imx6: make sure driver exits if pll can't be locked") Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Diffstat (limited to 'drivers/pci/controller/dwc/pci-imx6.c')
-rw-r--r--drivers/pci/controller/dwc/pci-imx6.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
index 6fb5ef0594fe..7963e27b754c 100644
--- a/drivers/pci/controller/dwc/pci-imx6.c
+++ b/drivers/pci/controller/dwc/pci-imx6.c
@@ -1970,19 +1970,6 @@ static int imx6_pcie_host_init(struct pcie_port *pp)
struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
struct imx6_pcie *imx6_pcie = to_imx6_pcie(pci);
- if (imx6_pcie->power_on_gpiod)
- gpiod_set_value_cansleep(imx6_pcie->power_on_gpiod, 1);
-
-#if 1 /* TODO: Check whether this code is needed for now */
- imx6_pcie_assert_core_reset(imx6_pcie);
- imx6_pcie_init_phy(imx6_pcie);
- if(imx6_pcie_deassert_core_reset(imx6_pcie) == -ENODEV) {
- if (imx6_pcie->power_on_gpiod)
- gpiod_set_value_cansleep(imx6_pcie->power_on_gpiod, 0);
- return -ENODEV;
- }
- imx6_setup_phy_mpll(imx6_pcie);
-#endif
dw_pcie_setup_rc(pp);
pci_imx_set_msi_en(pp);
if (imx6_pcie_establish_link(imx6_pcie))
@@ -2758,7 +2745,12 @@ static int imx6_pcie_probe(struct platform_device *pdev)
imx6_pcie_assert_core_reset(imx6_pcie);
imx6_pcie_init_phy(imx6_pcie);
- imx6_pcie_deassert_core_reset(imx6_pcie);
+ ret = imx6_pcie_deassert_core_reset(imx6_pcie);
+ if (ret == -ENODEV) {
+ if (imx6_pcie->power_on_gpiod)
+ gpiod_set_value_cansleep(imx6_pcie->power_on_gpiod, 0);
+ goto err_reg;
+ }
imx6_setup_phy_mpll(imx6_pcie);
val = dw_pcie_readl_dbi(pci, PCIE_AMBA_ORDERING_CTRL_OFF);