Message ID | 20240710205838.2413465-3-superm1@kernel.org |
---|---|
State | New |
Headers | show |
Series | Verify devices transition from D3cold to D0 | expand |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 4ad02ad640518..9af324ab6bb02 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -1388,6 +1388,17 @@ int pci_power_up(struct pci_dev *dev) else if (state == PCI_D2) udelay(PCI_PM_D2_DELAY); + /* + * D3cold -> D0 will have gone through a conventional reset and may need + * time to be ready. + */ + if (dev->current_state == PCI_D3cold) { + int ret; + + ret = pci_dev_wait(dev, "D3cold->D0", PCI_RESET_WAIT); + if (ret) + return ret; + } end: dev->current_state = PCI_D0; if (need_restore)