VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Andy Hu <andy.hu@starfivetech.com> 2023-09-14 19:16:32 +0800 committer: Andy Hu <andy.hu@starfivetech.com> 2023-09-14 19:16:32 +0800 commit: 53d88a219a29f4a30f94f619985d15bbe03ac67a parent: d1ff698066686acd73d236b74976972837f2d883
Commit Summary:
Merge tag 'JH7110_515_SDK_v5.7.3' into vf2-515-devel
Diffstat:
1 file changed, 8 insertions, 4 deletions
diff --git a/drivers/pci/controller/pcie-plda.c b/drivers/pci/controller/pcie-plda.c
index 196cf6cef90f..053e4ee9c43d 100644
--- a/drivers/pci/controller/pcie-plda.c
+++ b/drivers/pci/controller/pcie-plda.c
@@ -843,10 +843,9 @@ static void plda_pcie_hw_init(struct plda_pcie *pcie)
 	plda_pcie_setup_windows(pcie);
 
 	/* Ensure that PERST has been asserted for at least 100 ms */
-	msleep(300);
+	msleep(100);
 	if (pcie->reset_gpio)
 		gpiod_set_value_cansleep(pcie->reset_gpio, 0);
-
 }
 
 static int plda_pcie_is_link_up(struct plda_pcie *pcie)
@@ -947,8 +946,13 @@ static int plda_pcie_probe(struct platform_device *pdev)
 
 	plda_pcie_hw_init(pcie);
 
-	if (plda_pcie_is_link_up(pcie) == PLDA_LINK_DOWN)
-		goto release;
+	if (plda_pcie_is_link_up(pcie) == PLDA_LINK_UP) {
+		/* As the requirement in PCIe base spec r6.0, system (<=5GT/s) must
+		 * wait a minimum of 100 ms following exit from a conventional reset
+		 * before sending a configuration request to the device.
+		 */
+		msleep(100);
+	}
 
 	if (IS_ENABLED(CONFIG_PCI_MSI)) {
 		ret = plda_pcie_enable_msi(pcie, bus);