aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHuang Ying <ying.huang@intel.com>2012-08-07 21:07:38 -0400
committerBjorn Helgaas <bhelgaas@google.com>2012-08-21 19:31:40 -0400
commit4f9c1397e2e80e52b17ec4e39760caa807bd15c7 (patch)
tree60007cc7b7511df5db7e6705929ba01d9a96b97d
parenta6b881a5b8d4fa2135e55a74be6d6b1e17e445dd (diff)
PCI/PM: Enable D3/D3cold by default for most devices
This patch fixes the following bug: http://marc.info/?l=linux-usb&m=134318961120825&w=2 Originally, device lower power states include D1, D2, D3. After that, D3 is further divided into D3hot and D3cold. To support both scenario safely, original D3 is mapped to D3cold. When adding D3cold support, because worry about some device may have broken D3cold support, D3cold is disabled by default. This disable D3 on original platform too. But some original platform may only have working D3, but no working D1, D2. The root cause of the above bug is it too. To deal with this, this patch enables D3/D3cold by default for most devices. This restores the original behavior. For some devices that suspected to have broken D3cold support, such as PCIe port, D3cold is disabled by default. Reported-by: Bjorn Mork <bjorn@mork.no> Signed-off-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Rafael J. Wysocki <rjw@sisk.pl>
-rw-r--r--drivers/pci/pci.c1
-rw-r--r--drivers/pci/pcie/portdrv_pci.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index f3ea977a5b1b..ab4bf5a4c2f1 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1941,6 +1941,7 @@ void pci_pm_init(struct pci_dev *dev)
1941 dev->pm_cap = pm; 1941 dev->pm_cap = pm;
1942 dev->d3_delay = PCI_PM_D3_WAIT; 1942 dev->d3_delay = PCI_PM_D3_WAIT;
1943 dev->d3cold_delay = PCI_PM_D3COLD_WAIT; 1943 dev->d3cold_delay = PCI_PM_D3COLD_WAIT;
1944 dev->d3cold_allowed = true;
1944 1945
1945 dev->d1_support = false; 1946 dev->d1_support = false;
1946 dev->d2_support = false; 1947 dev->d2_support = false;
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c
index 3a7eefcb270a..62f5a76c8f80 100644
--- a/drivers/pci/pcie/portdrv_pci.c
+++ b/drivers/pci/pcie/portdrv_pci.c
@@ -200,6 +200,11 @@ static int __devinit pcie_portdrv_probe(struct pci_dev *dev,
200 return status; 200 return status;
201 201
202 pci_save_state(dev); 202 pci_save_state(dev);
203 /*
204 * D3cold may not work properly on some PCIe port, so disable
205 * it by default.
206 */
207 dev->d3cold_allowed = false;
203 if (!pci_match_id(port_runtime_pm_black_list, dev)) 208 if (!pci_match_id(port_runtime_pm_black_list, dev))
204 pm_runtime_put_noidle(&dev->dev); 209 pm_runtime_put_noidle(&dev->dev);
205 210