|
@@ -264,6 +264,13 @@ static int pci_device_remove(struct device * dev)
|
|
pci_dev->driver = NULL;
|
|
pci_dev->driver = NULL;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * If the device is still on, set the power state as "unknown",
|
|
|
|
+ * since it might change by the next time we load the driver.
|
|
|
|
+ */
|
|
|
|
+ if (pci_dev->current_state == PCI_D0)
|
|
|
|
+ pci_dev->current_state = PCI_UNKNOWN;
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* We would love to complain here if pci_dev->is_enabled is set, that
|
|
* We would love to complain here if pci_dev->is_enabled is set, that
|
|
* the driver should have called pci_disable_device(), but the
|
|
* the driver should have called pci_disable_device(), but the
|
|
@@ -288,6 +295,12 @@ static int pci_device_suspend(struct device * dev, pm_message_t state)
|
|
suspend_report_result(drv->suspend, i);
|
|
suspend_report_result(drv->suspend, i);
|
|
} else {
|
|
} else {
|
|
pci_save_state(pci_dev);
|
|
pci_save_state(pci_dev);
|
|
|
|
+ /*
|
|
|
|
+ * mark its power state as "unknown", since we don't know if
|
|
|
|
+ * e.g. the BIOS will change its device state when we suspend.
|
|
|
|
+ */
|
|
|
|
+ if (pci_dev->current_state == PCI_D0)
|
|
|
|
+ pci_dev->current_state = PCI_UNKNOWN;
|
|
}
|
|
}
|
|
return i;
|
|
return i;
|
|
}
|
|
}
|