summaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci-sysfs.c
diff options
context:
space:
mode:
authorLukas Wunner <lukas@wunner.de>2018-07-20 00:27:58 +0200
committerBjorn Helgaas <bhelgaas@google.com>2018-07-31 18:09:36 +0200
commit82c3fbff6ed3582f2b14b5548fb976c22d7a7255 (patch)
treec6aa7cceb79465645953b2b31558513283b04613 /drivers/pci/pci-sysfs.c
parentPCI: pciehp: Resume parent to D0 on config space access (diff)
downloadlinux-82c3fbff6ed3582f2b14b5548fb976c22d7a7255.tar.xz
linux-82c3fbff6ed3582f2b14b5548fb976c22d7a7255.zip
PCI: sysfs: Resume to D0 on function reset
When performing a function reset via sysfs, the device's config space is accessed in places such as pcie_flr() and its MMIO space is accessed e.g. in reset_ivb_igd(), so ensure accessibility by resuming the device to D0. Signed-off-by: Lukas Wunner <lukas@wunner.de> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Cc: Mika Westerberg <mika.westerberg@linux.intel.com> Cc: Ashok Raj <ashok.raj@intel.com> Cc: Keith Busch <keith.busch@intel.com> Cc: Yinghai Lu <yinghai@kernel.org>
Diffstat (limited to 'drivers/pci/pci-sysfs.c')
-rw-r--r--drivers/pci/pci-sysfs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 0c4653c1d2ce..a3df6b57df0f 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -1449,7 +1449,9 @@ static ssize_t reset_store(struct device *dev, struct device_attribute *attr,
if (val != 1)
return -EINVAL;
+ pm_runtime_get_sync(dev);
result = pci_reset_function(pdev);
+ pm_runtime_put(dev);
if (result < 0)
return result;