[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1359434058-15918-5-git-send-email-ying.huang@intel.com>
Date: Tue, 29 Jan 2013 12:34:18 +0800
From: Huang Ying <ying.huang@...el.com>
To: Bjorn Helgaas <bhelgaas@...gle.com>
Cc: linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org,
linux-pm@...r.kernel.org, linux-acpi@...r.kernel.org,
"Rafael J. Wysocki" <rjw@...k.pl>,
Huang Ying <ying.huang@...el.com>
Subject: [PATCH 4/4] PCI/PM: Enable D3cold support for system suspend
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@...el.com>
---
drivers/pci/pci-driver.c | 5 +++++
drivers/pci/pci.c | 4 ----
2 files changed, 5 insertions(+), 4 deletions(-)
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -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);
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -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);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists