aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2010-11-16 10:44:50 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2010-11-16 10:44:50 -0800
commit491acf0032c08a74a4c88032ca1c03b498bfec37 (patch)
treeb7194d3afb144fa007d0ca6a11c96297f36d42f8 /drivers/pci/pci.c
parent06fc8846a2c0ddcc51e6666a78fc29a8e749ca3b (diff)
parente53beacd23d9cb47590da6a7a7f6d417b941a994 (diff)
downloadkernel_samsung_smdk4412-491acf0032c08a74a4c88032ca1c03b498bfec37.zip
kernel_samsung_smdk4412-491acf0032c08a74a4c88032ca1c03b498bfec37.tar.gz
kernel_samsung_smdk4412-491acf0032c08a74a4c88032ca1c03b498bfec37.tar.bz2
Staging: Merge 2.6.37-rc2 into staging-next
This was necessary in order to resolve some conflicts that happened between -rc1 and -rc2 with the following files: drivers/staging/bcm/Bcmchar.c drivers/staging/intel_sst/intel_sst_app_interface.c All should be resolved now. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index e98c810..710c8a2 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -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 */