aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci-sysfs.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2025-06-04 10:50:01 -0500
committerBjorn Helgaas <bhelgaas@google.com>2025-06-04 10:50:01 -0500
commitf377d9cb2579843219f9f1c4a74ed1c3d1967859 (patch)
tree868eba401fa7123be35d5d0e1f23c85068d27ea8 /drivers/pci/pci-sysfs.c
parentMerge branch 'pci/pci-acpi' (diff)
parentPCI: Explicitly put devices into D0 when initializing (diff)
downloadlinux-f377d9cb2579843219f9f1c4a74ed1c3d1967859.tar.gz
linux-f377d9cb2579843219f9f1c4a74ed1c3d1967859.zip
Merge branch 'pci/pm'
- Add pm_runtime_put() cleanup helper for use with __free() to automatically drop the device usage count when a pointer goes out of scope (Alex Williamson) - Increment PM usage counter when probing reset methods so we don't try to read config space of a powered-off device (Alex Williamson) - Set all devices to D0 during enumeration to ensure ACPI opregion is connected via _REG (Mario Limonciello) * pci/pm: PCI: Explicitly put devices into D0 when initializing PCI: Increment PM usage counter when probing reset methods PM: runtime: Define pm_runtime_put cleanup helper
Diffstat (limited to 'drivers/pci/pci-sysfs.c')
-rw-r--r--drivers/pci/pci-sysfs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 278de99b00ce..268c69daa4d5 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -1475,6 +1475,9 @@ static ssize_t reset_method_store(struct device *dev,
return count;
}
+ pm_runtime_get_sync(dev);
+ struct device *pmdev __free(pm_runtime_put) = dev;
+
if (sysfs_streq(buf, "default")) {
pci_init_reset_methods(pdev);
return count;