@@ -4586,14 +4586,17 @@ static int pci_pm_reset(struct pci_dev *dev, int probe)
4586
4586
4587
4587
return pci_dev_wait (dev , "PM D3hot->D0" , PCIE_RESET_READY_POLL_MS );
4588
4588
}
4589
+
4589
4590
/**
4590
- * pcie_wait_for_link - Wait until link is active or inactive
4591
+ * pcie_wait_for_link_delay - Wait until link is active or inactive
4591
4592
* @pdev: Bridge device
4592
4593
* @active: waiting for active or inactive?
4594
+ * @delay: Delay to wait after link has become active (in ms)
4593
4595
*
4594
4596
* Use this to wait till link becomes active or inactive.
4595
4597
*/
4596
- bool pcie_wait_for_link (struct pci_dev * pdev , bool active )
4598
+ static bool pcie_wait_for_link_delay (struct pci_dev * pdev , bool active ,
4599
+ int delay )
4597
4600
{
4598
4601
int timeout = 1000 ;
4599
4602
bool ret ;
@@ -4630,13 +4633,25 @@ bool pcie_wait_for_link(struct pci_dev *pdev, bool active)
4630
4633
timeout -= 10 ;
4631
4634
}
4632
4635
if (active && ret )
4633
- msleep (100 );
4636
+ msleep (delay );
4634
4637
else if (ret != active )
4635
4638
pci_info (pdev , "Data Link Layer Link Active not %s in 1000 msec\n" ,
4636
4639
active ? "set" : "cleared" );
4637
4640
return ret == active ;
4638
4641
}
4639
4642
4643
+ /**
4644
+ * pcie_wait_for_link - Wait until link is active or inactive
4645
+ * @pdev: Bridge device
4646
+ * @active: waiting for active or inactive?
4647
+ *
4648
+ * Use this to wait till link becomes active or inactive.
4649
+ */
4650
+ bool pcie_wait_for_link (struct pci_dev * pdev , bool active )
4651
+ {
4652
+ return pcie_wait_for_link_delay (pdev , active , 100 );
4653
+ }
4654
+
4640
4655
void pci_reset_secondary_bus (struct pci_dev * dev )
4641
4656
{
4642
4657
u16 ctrl ;
0 commit comments