diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2024-01-15 19:10:37 +0100 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2024-01-15 19:10:37 +0100 |
commit | 186ce88c9063086f8e11d1eeafde360f0926b341 (patch) | |
tree | 39b02456013b73d03eb9ec5b60e8ce7b4048e522 /drivers/pci/controller | |
parent | Merge branch 'pci/controller/dwc' (diff) | |
parent | PCI: keystone: Fix race condition when initializing PHYs (diff) | |
download | linux-186ce88c9063086f8e11d1eeafde360f0926b341.tar.xz linux-186ce88c9063086f8e11d1eeafde360f0926b341.zip |
Merge branch 'pci/controller/keystone'
- Hold power management references to all PHYs while enabling them to avoid
a race when one provides clocks to others (Siddharth Vadapalli)
* pci/controller/keystone:
PCI: keystone: Fix race condition when initializing PHYs
Diffstat (limited to 'drivers/pci/controller')
-rw-r--r-- | drivers/pci/controller/dwc/pci-keystone.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/pci/controller/dwc/pci-keystone.c b/drivers/pci/controller/dwc/pci-keystone.c index d0f50cceede9..da8a1b21adaa 100644 --- a/drivers/pci/controller/dwc/pci-keystone.c +++ b/drivers/pci/controller/dwc/pci-keystone.c @@ -1218,7 +1218,16 @@ static int ks_pcie_probe(struct platform_device *pdev) goto err_link; } + /* Obtain references to the PHYs */ + for (i = 0; i < num_lanes; i++) + phy_pm_runtime_get_sync(ks_pcie->phy[i]); + ret = ks_pcie_enable_phy(ks_pcie); + + /* Release references to the PHYs */ + for (i = 0; i < num_lanes; i++) + phy_pm_runtime_put_sync(ks_pcie->phy[i]); + if (ret) { dev_err(dev, "failed to enable phy\n"); goto err_link; |