summaryrefslogtreecommitdiffstats
path: root/drivers/pci/proc.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2012-11-05 16:59:53 -0700
committerBjorn Helgaas <bhelgaas@google.com>2012-11-05 16:59:53 -0700
commit3cba8eedb757590455b03dfeaba15a5b32610339 (patch)
tree9c035788cf5a2f5fcf897f3fe63c32064bdef255 /drivers/pci/proc.c
parent8f0d8163b50e01f398b14bcd4dc039ac5ab18d64 (diff)
parentb3c32c4f9565f93407921c0d8a4458042eb8998e (diff)
Merge branch 'pci/huang-d3cold-fixes' into for-linus
* pci/huang-d3cold-fixes: PCI/PM: Fix proc config reg access for D3cold and bridge suspending PCI/PM: Resume device before shutdown PCI/PM: Fix deadlock when unbinding device if parent in D3cold
Diffstat (limited to 'drivers/pci/proc.c')
-rw-r--r--drivers/pci/proc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c
index eb907a8faf2..9b8505ccc56 100644
--- a/drivers/pci/proc.c
+++ b/drivers/pci/proc.c
@@ -76,6 +76,8 @@ proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *pp
if (!access_ok(VERIFY_WRITE, buf, cnt))
return -EINVAL;
+ pci_config_pm_runtime_get(dev);
+
if ((pos & 1) && cnt) {
unsigned char val;
pci_user_read_config_byte(dev, pos, &val);
@@ -121,6 +123,8 @@ proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *pp
cnt--;
}
+ pci_config_pm_runtime_put(dev);
+
*ppos = pos;
return nbytes;
}
@@ -146,6 +150,8 @@ proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, lof
if (!access_ok(VERIFY_READ, buf, cnt))
return -EINVAL;
+ pci_config_pm_runtime_get(dev);
+
if ((pos & 1) && cnt) {
unsigned char val;
__get_user(val, buf);
@@ -191,6 +197,8 @@ proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, lof
cnt--;
}
+ pci_config_pm_runtime_put(dev);
+
*ppos = pos;
i_size_write(ino, dp->size);
return nbytes;