PCI: pciehp: Add pcie_wait_link_not_active()
Will use it for link disable status checking. Signed-off-by: Yinghai Lu <yinghai.lu@oracle.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
This commit is contained in:
@@ -257,19 +257,30 @@ static bool check_link_active(struct controller *ctrl)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pcie_wait_link_active(struct controller *ctrl)
|
static void __pcie_wait_link_active(struct controller *ctrl, bool active)
|
||||||
{
|
{
|
||||||
int timeout = 1000;
|
int timeout = 1000;
|
||||||
|
|
||||||
if (check_link_active(ctrl))
|
if (check_link_active(ctrl) == active)
|
||||||
return;
|
return;
|
||||||
while (timeout > 0) {
|
while (timeout > 0) {
|
||||||
msleep(10);
|
msleep(10);
|
||||||
timeout -= 10;
|
timeout -= 10;
|
||||||
if (check_link_active(ctrl))
|
if (check_link_active(ctrl) == active)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ctrl_dbg(ctrl, "Data Link Layer Link Active not set in 1000 msec\n");
|
ctrl_dbg(ctrl, "Data Link Layer Link Active not %s in 1000 msec\n",
|
||||||
|
active ? "set" : "cleared");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void pcie_wait_link_active(struct controller *ctrl)
|
||||||
|
{
|
||||||
|
__pcie_wait_link_active(ctrl, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void pcie_wait_link_not_active(struct controller *ctrl)
|
||||||
|
{
|
||||||
|
__pcie_wait_link_active(ctrl, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool pci_bus_check_dev(struct pci_bus *bus, int devfn)
|
static bool pci_bus_check_dev(struct pci_bus *bus, int devfn)
|
||||||
|
Reference in New Issue
Block a user