aboutsummaryrefslogtreecommitdiff
path: root/drivers/pci
diff options
context:
space:
mode:
authorRafael J. Wysocki2022-05-05 20:04:07 +0200
committerBjorn Helgaas2022-05-05 14:19:48 -0500
commit1aa85bb14d8ed0ae4238617061924032c80dad37 (patch)
treebaa9281425ce5de8b7ffa84cb227a237f06e622c /drivers/pci
parent7957d201456f436557870cf8bbd47328a280c522 (diff)
PCI/PM: Set current_state to D3cold if the device is not accessible
Make pci_power_up() and pci_set_low_power_state() change current_state to PCI_D3cold when the device is not accessible along the lines of pci_update_current_state(). Link: https://lore.kernel.org/r/10104376.nUPlyArG6x@kreacher Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/pci.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index f1bd87c5aa14..056e8284b5fd 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1207,6 +1207,7 @@ int pci_power_up(struct pci_dev *dev)
if (PCI_POSSIBLE_ERROR(pmcsr)) {
pci_err(dev, "Unable to change power state from %s to D0, device inaccessible\n",
pci_power_name(dev->current_state));
+ dev->current_state = PCI_D3cold;
return -EIO;
}
@@ -1335,6 +1336,7 @@ static int pci_set_low_power_state(struct pci_dev *dev, pci_power_t state)
pci_err(dev, "Unable to change power state from %s to %s, device inaccessible\n",
pci_power_name(dev->current_state),
pci_power_name(state));
+ dev->current_state = PCI_D3cold;
return -EIO;
}