summaryrefslogtreecommitdiff
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2025-10-03 12:13:11 -0500
committerBjorn Helgaas <bhelgaas@google.com>2025-10-03 12:13:11 -0500
commit4c5cd8d64172de3730056366dc61392a3f2f003a (patch)
tree3dfeaf2f7095aea0a966e352481672e12fad71ff /drivers/pci/pci.c
parent0bb65e32495e6235a069b60e787140da99e9c122 (diff)
parent48991e4935078b05f80616c75d1ee2ea3ae18e58 (diff)
Merge branch 'pci/pm'
- If a device has already been disconnected, e.g., by a hotplug removal, don't bother trying to resume it to D0 when detaching the driver (Mario Limonciello) - Ensure devices are powered up before config reads for 'max_link_width', 'current_link_speed', 'current_link_width', 'secondary_bus_number', and 'subordinate_bus_number' sysfs files (Brian Norris) * pci/pm: PCI/sysfs: Ensure devices are powered for config reads PCI/PM: Skip resuming to D0 if device is disconnected
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index b0f4d98036cd..036511f5b262 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1374,6 +1374,11 @@ int pci_power_up(struct pci_dev *dev)
return -EIO;
}
+ if (pci_dev_is_disconnected(dev)) {
+ dev->current_state = PCI_D3cold;
+ return -EIO;
+ }
+
pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr);
if (PCI_POSSIBLE_ERROR(pmcsr)) {
pci_err(dev, "Unable to change power state from %s to D0, device inaccessible\n",