Skip to content

Commit 2f39ddf

Browse files
GuEe-GUIyixinghua121
authored andcommitted
[DM/FIXUP] Add ms sleep for link status change
We should wait a while for success or failure after link status change or will communicate fail with the endpoint. Signed-off-by: GuEe-GUI <[email protected]>
1 parent 92fafb9 commit 2f39ddf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

components/drivers/pci/probe.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ static void pcie_fixup_link(struct rt_pci_device *pdev)
486486

487487
if (!!(exp_lnksta & PCIEM_LINK_STA_DL_ACTIVE))
488488
{
489-
return;
489+
goto _status_sync;
490490
}
491491

492492
rt_thread_mdelay(10);
@@ -496,6 +496,10 @@ static void pcie_fixup_link(struct rt_pci_device *pdev)
496496
rt_pci_write_config_u16(pdev, pos + PCIER_LINK_CTL2, exp_lnkctl2);
497497
rt_pci_write_config_u16(pdev, pos + PCIER_LINK_CTL,
498498
exp_lnkctl | PCIEM_LINK_CTL_RETRAIN_LINK);
499+
500+
_status_sync:
501+
/* Wait a while for success or failure */
502+
rt_thread_mdelay(100);
499503
}
500504

501505
static rt_uint32_t pci_scan_bridge_extend(struct rt_pci_bus *bus, struct rt_pci_device *pdev,

0 commit comments

Comments
 (0)