diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-11-09 20:33:53 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-11-09 20:33:53 (GMT) |
commit | 63d4ec8731865b228065e212f01661023f85b972 (patch) | |
tree | 412774978f6d5780310dc5fbaadea80a6b3a2082 /drivers/pci/proc.c | |
parent | a4275153cc77b726b9a0595d56e216158a4c4167 (diff) | |
parent | ff8e59bc4ec3f31789a47dce9b6fe44bd7bc5fcc (diff) | |
download | linux-63d4ec8731865b228065e212f01661023f85b972.tar.xz |
Merge tag '3.7-pci-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI fixes from Bjorn Helgaas:
"Power management:
- 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
Hotplug:
- PCI/portdrv: Don't create hotplug slots unless port supports
hotplug"
* tag '3.7-pci-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
PCI/portdrv: Don't create hotplug slots unless port supports hotplug
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.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c index eb907a8f..9b8505c 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; |