summaryrefslogtreecommitdiff
path: root/drivers/pci/controller
diff options
context:
space:
mode:
authorKevin.xie <kevin.xie@starfivetech.com>2023-09-07 13:14:02 +0300
committerKevin.xie <kevin.xie@starfivetech.com>2023-09-07 14:05:52 +0300
commitfe18fec197285feeabae4550be86f22b4e91b174 (patch)
tree59686519c4da78f05548df917944b387d44ff2ee /drivers/pci/controller
parent0d701ee1b4151b613ab3d2bb52af59164be7d782 (diff)
downloadlinux-fe18fec197285feeabae4550be86f22b4e91b174.tar.xz
driver: pci: Update reset timing as the requirement in PCIe base spec r6.0
Beside, revert the release operation after link down in probe. This commit can fix the incompatibility problem in VF2 linux6.1 with WD NVMe SSD. Signed-off-by: Kevin.xie <kevin.xie@starfivetech.com>
Diffstat (limited to 'drivers/pci/controller')
-rw-r--r--drivers/pci/controller/pcie-plda.c12
1 files 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);