@@ -579,6 +579,7 @@ static bool pci_has_legacy_pm_support(st
static int pci_pm_prepare(struct device *dev)
{
struct device_driver *drv = dev->driver;
+ struct pci_dev *pci_dev = to_pci_dev(dev);
int error = 0;
/*
@@ -592,6 +593,10 @@ static int pci_pm_prepare(struct device
*/
pm_runtime_resume(dev);
+ if (!pci_dev->d3cold_allowed)
+ pci_dev->no_d3cold = true;
+ else
+ pci_dev->no_d3cold = false;
if (drv && drv->pm && drv->pm->prepare)
error = drv->pm->prepare(dev);
@@ -1798,10 +1798,6 @@ int pci_prepare_to_sleep(struct pci_dev
if (target_state == PCI_POWER_ERROR)
return -EIO;
- /* D3cold during system suspend/hibernate is not supported */
- if (target_state > PCI_D3hot)
- target_state = PCI_D3hot;
-
pci_enable_wake(dev, target_state, device_may_wakeup(&dev->dev));
error = pci_set_power_state(dev, target_state);
Device may need to be put in D3cold on some platforms, especially because we treat ACPI_STATE_D3 as ACPI_STATE_D3_COLD now. Signed-off-by: Huang Ying <ying.huang@intel.com> --- drivers/pci/pci-driver.c | 5 +++++ drivers/pci/pci.c | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html