[PATCH 2/3] PCI/pwrctrl: Add appropriate delays for slot power/clocks
From: Sean Anderson
Date: Fri Dec 19 2025 - 12:22:58 EST
Each of the PCIe electromechanical specifications requires a delay
between when power and clocks are stable and when PERST is released.
Delay for the specified time before continuing with initialization. If
there are no power supplies/clock, skip the associated delay as we
assume that they have been initialized by the bootloader (and that
booting up to this point has taken longer than the delay).
Signed-off-by: Sean Anderson <sean.anderson@xxxxxxxxx>
---
drivers/pci/pwrctrl/slot.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/pci/pwrctrl/slot.c b/drivers/pci/pwrctrl/slot.c
index 3320494b62d8..1c56fcd49f2b 100644
--- a/drivers/pci/pwrctrl/slot.c
+++ b/drivers/pci/pwrctrl/slot.c
@@ -5,6 +5,7 @@
*/
#include <linux/clk.h>
+#include <linux/delay.h>
#include <linux/device.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
@@ -31,6 +32,7 @@ static int pci_pwrctrl_slot_probe(struct platform_device *pdev)
{
struct pci_pwrctrl_slot_data *slot;
struct device *dev = &pdev->dev;
+ unsigned long delay = 0;
struct clk *clk;
int ret;
@@ -64,6 +66,17 @@ static int pci_pwrctrl_slot_probe(struct platform_device *pdev)
"Failed to enable slot clock\n");
}
+ if (slot->num_supplies)
+ /*
+ * Delay for T_PVPERL. This could be reduced to 1 ms/50 ms
+ * (T_PVPGL) for Mini/M.2 slots.
+ */
+ delay = 100000;
+ else if (clk)
+ /* Delay for T_PERST-CLK (100 us for all slot types) */
+ delay = 100;
+
+ fsleep(delay)
pci_pwrctrl_init(&slot->ctx, dev);
ret = devm_pci_pwrctrl_device_set_ready(dev, &slot->ctx);
--
2.35.1.1320.gc452695387.dirty