Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 222124
b: refs/heads/master
c: 97c145f
h: refs/heads/master
v: v3
  • Loading branch information
Jesse Barnes committed Nov 11, 2010
1 parent 0f435ba commit 70afc39
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3b519e4ea618b6943a82931630872907f9ac2c2b
refs/heads/master: 97c145f7c87453cec90e91238fba5fe2c1561b32
12 changes: 12 additions & 0 deletions trunk/drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,18 @@ static int __pci_enable_device_flags(struct pci_dev *dev,
int err;
int i, bars = 0;

/*
* Power state could be unknown at this point, either due to a fresh
* boot or a device removal call. So get the current power state
* so that things like MSI message writing will behave as expected
* (e.g. if the device really is in D0 at enable time).
*/
if (dev->pm_cap) {
u16 pmcsr;
pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr);
dev->current_state = (pmcsr & PCI_PM_CTRL_STATE_MASK);
}

if (atomic_add_return(1, &dev->enable_cnt) > 1)
return 0; /* already enabled */

Expand Down

0 comments on commit 70afc39

Please sign in to comment.