Skip to content

Commit bffe4f7

Browse files
Yinghai Lujbarnes993
authored andcommitted
PCI: pciehp: Add pcie_wait_link_not_active()
Will use it for link disable status checking. Signed-off-by: Yinghai Lu <[email protected]> Signed-off-by: Jesse Barnes <[email protected]>
1 parent 4e2ce40 commit bffe4f7

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

drivers/pci/hotplug/pciehp_hpc.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,19 +257,30 @@ static bool check_link_active(struct controller *ctrl)
257257
return ret;
258258
}
259259

260-
static void pcie_wait_link_active(struct controller *ctrl)
260+
static void __pcie_wait_link_active(struct controller *ctrl, bool active)
261261
{
262262
int timeout = 1000;
263263

264-
if (check_link_active(ctrl))
264+
if (check_link_active(ctrl) == active)
265265
return;
266266
while (timeout > 0) {
267267
msleep(10);
268268
timeout -= 10;
269-
if (check_link_active(ctrl))
269+
if (check_link_active(ctrl) == active)
270270
return;
271271
}
272-
ctrl_dbg(ctrl, "Data Link Layer Link Active not set in 1000 msec\n");
272+
ctrl_dbg(ctrl, "Data Link Layer Link Active not %s in 1000 msec\n",
273+
active ? "set" : "cleared");
274+
}
275+
276+
static void pcie_wait_link_active(struct controller *ctrl)
277+
{
278+
__pcie_wait_link_active(ctrl, true);
279+
}
280+
281+
static void pcie_wait_link_not_active(struct controller *ctrl)
282+
{
283+
__pcie_wait_link_active(ctrl, false);
273284
}
274285

275286
static bool pci_bus_check_dev(struct pci_bus *bus, int devfn)

0 commit comments

Comments
 (0)