Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 178891
b: refs/heads/master
c: 1ae861e
h: refs/heads/master
i:
  178889: 6f26fb4
  178887: 3d443df
v: v3
  • Loading branch information
Rafael J. Wysocki authored and Jesse Barnes committed Jan 4, 2010
1 parent e977773 commit 5885141
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6be954d1f91b81ca85c74792b13654069278c577
refs/heads/master: 1ae861e652b5457e7fa98ccbc55abea1e207916e
1 change: 1 addition & 0 deletions trunk/drivers/net/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -4684,6 +4684,7 @@ static int __devinit sky2_probe(struct pci_dev *pdev,
INIT_WORK(&hw->restart_work, sky2_restart);

pci_set_drvdata(pdev, hw);
pdev->d3_delay = 150;

return 0;

Expand Down
19 changes: 15 additions & 4 deletions trunk/drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,17 @@ const char *pci_power_names[] = {
};
EXPORT_SYMBOL_GPL(pci_power_names);

unsigned int pci_pm_d3_delay = PCI_PM_D3_WAIT;
unsigned int pci_pm_d3_delay;

static void pci_dev_d3_sleep(struct pci_dev *dev)
{
unsigned int delay = dev->d3_delay;

if (delay < pci_pm_d3_delay)
delay = pci_pm_d3_delay;

msleep(delay);
}

#ifdef CONFIG_PCI_DOMAINS
int pci_domains_supported = 1;
Expand Down Expand Up @@ -522,7 +532,7 @@ static int pci_raw_set_power_state(struct pci_dev *dev, pci_power_t state)
/* Mandatory power management transition delays */
/* see PCI PM 1.1 5.6.1 table 18 */
if (state == PCI_D3hot || dev->current_state == PCI_D3hot)
msleep(pci_pm_d3_delay);
pci_dev_d3_sleep(dev);
else if (state == PCI_D2 || dev->current_state == PCI_D2)
udelay(PCI_PM_D2_DELAY);

Expand Down Expand Up @@ -1409,6 +1419,7 @@ void pci_pm_init(struct pci_dev *dev)
}

dev->pm_cap = pm;
dev->d3_delay = PCI_PM_D3_WAIT;

dev->d1_support = false;
dev->d2_support = false;
Expand Down Expand Up @@ -2247,12 +2258,12 @@ static int pci_pm_reset(struct pci_dev *dev, int probe)
csr &= ~PCI_PM_CTRL_STATE_MASK;
csr |= PCI_D3hot;
pci_write_config_word(dev, dev->pm_cap + PCI_PM_CTRL, csr);
msleep(pci_pm_d3_delay);
pci_dev_d3_sleep(dev);

csr &= ~PCI_PM_CTRL_STATE_MASK;
csr |= PCI_D0;
pci_write_config_word(dev, dev->pm_cap + PCI_PM_CTRL, csr);
msleep(pci_pm_d3_delay);
pci_dev_d3_sleep(dev);

return 0;
}
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ struct pci_dev {
unsigned int d2_support:1; /* Low power state D2 is supported */
unsigned int no_d1d2:1; /* Only allow D0 and D3 */
unsigned int wakeup_prepared:1;
unsigned int d3_delay; /* D3->D0 transition time in ms */

#ifdef CONFIG_PCIEASPM
struct pcie_link_state *link_state; /* ASPM link state. */
Expand Down

0 comments on commit 5885141

Please sign in to comment.