Skip to content

Commit

Permalink
PCI/PM: Revert "PCI/PM: Apply D2 delay as milliseconds, not microseco…
Browse files Browse the repository at this point in the history
…nds"

This reverts commit 7e24bc3.

7e24bc3 was based on PCIe r5.0, sec 5.9, which claims we need a 200 ms
delay when transitioning to or from D2.  However, sec 5.3.1.3 states the
delay as 200 μs (microseconds), as does the table in PCIe r4.0, sec 5.9.1.

This looks like a typo in the r5.0 spec, so revert back to a 200 μs delay
instead of a 200 ms delay.

Fixes: 7e24bc3 ("PCI/PM: Apply D2 delay as milliseconds, not microseconds")
Signed-off-by: Bjorn Helgaas <[email protected]>
Reviewed-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
bjorn-helgaas committed Sep 30, 2020
1 parent 454d082 commit 638c133
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,7 @@ static int pci_raw_set_power_state(struct pci_dev *dev, pci_power_t state)
if (state == PCI_D3hot || dev->current_state == PCI_D3hot)
pci_dev_d3_sleep(dev);
else if (state == PCI_D2 || dev->current_state == PCI_D2)
msleep(PCI_PM_D2_DELAY);
udelay(PCI_PM_D2_DELAY);

pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr);
dev->current_state = (pmcsr & PCI_PM_CTRL_STATE_MASK);
Expand Down
6 changes: 3 additions & 3 deletions drivers/pci/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ int pci_probe_reset_function(struct pci_dev *dev);
int pci_bridge_secondary_bus_reset(struct pci_dev *dev);
int pci_bus_error_reset(struct pci_dev *dev);

#define PCI_PM_D2_DELAY 200
#define PCI_PM_D3HOT_WAIT 10
#define PCI_PM_D3COLD_WAIT 100
#define PCI_PM_D2_DELAY 200 /* usec; see PCIe r4.0, sec 5.9.1 */
#define PCI_PM_D3HOT_WAIT 10 /* msec */
#define PCI_PM_D3COLD_WAIT 100 /* msec */

/**
* struct pci_platform_pm_ops - Firmware PM callbacks
Expand Down

0 comments on commit 638c133

Please sign in to comment.