Skip to content

Commit 186ce88

Browse files
committed
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
2 parents 787c72b + c12ca11 commit 186ce88

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/pci/controller/dwc/pci-keystone.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,7 +1218,16 @@ static int ks_pcie_probe(struct platform_device *pdev)
12181218
goto err_link;
12191219
}
12201220

1221+
/* Obtain references to the PHYs */
1222+
for (i = 0; i < num_lanes; i++)
1223+
phy_pm_runtime_get_sync(ks_pcie->phy[i]);
1224+
12211225
ret = ks_pcie_enable_phy(ks_pcie);
1226+
1227+
/* Release references to the PHYs */
1228+
for (i = 0; i < num_lanes; i++)
1229+
phy_pm_runtime_put_sync(ks_pcie->phy[i]);
1230+
12221231
if (ret) {
12231232
dev_err(dev, "failed to enable phy\n");
12241233
goto err_link;

0 commit comments

Comments
 (0)