Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux: Kernel

[BUGFIX 1/4] PCI/PM: enable D3/D3cold by default for most devices

 

 

Linux kernel RSS feed   Index | Next | Previous | View Threaded


ying.huang at intel

Aug 2, 2012, 11:30 PM

Post #1 of 2 (91 views)
Permalink
[BUGFIX 1/4] 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 [at] mork>
Signed-off-by: Huang Ying <ying.huang [at] intel>
---
drivers/pci/pci.c | 1 +
drivers/pci/pcie/portdrv_pci.c | 5 +++++
2 files changed, 6 insertions(+)

--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1941,6 +1941,7 @@ void pci_pm_init(struct pci_dev *dev)
dev->pm_cap = pm;
dev->d3_delay = PCI_PM_D3_WAIT;
dev->d3cold_delay = PCI_PM_D3COLD_WAIT;
+ dev->d3cold_allowed = true;

dev->d1_support = false;
dev->d2_support = false;
--- a/drivers/pci/pcie/portdrv_pci.c
+++ b/drivers/pci/pcie/portdrv_pci.c
@@ -200,6 +200,11 @@ static int __devinit pcie_portdrv_probe(
return status;

pci_save_state(dev);
+ /*
+ * D3cold may not work properly on some PCIe port, so disable
+ * it by default.
+ */
+ dev->d3cold_allowed = false;
if (!pci_match_id(port_runtime_pm_black_list, dev))
pm_runtime_put_noidle(&dev->dev);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


rjw at sisk

Aug 4, 2012, 2:46 PM

Post #2 of 2 (91 views)
Permalink
Re: [BUGFIX 1/4] PCI/PM: enable D3/D3cold by default for most devices [In reply to]

On Friday, August 03, 2012, Huang Ying wrote:
> 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 [at] mork>
> Signed-off-by: Huang Ying <ying.huang [at] intel>

Reviewed-by: Rafael J. Wysocki <rjw [at] sisk>

> ---
> drivers/pci/pci.c | 1 +
> drivers/pci/pcie/portdrv_pci.c | 5 +++++
> 2 files changed, 6 insertions(+)
>
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -1941,6 +1941,7 @@ void pci_pm_init(struct pci_dev *dev)
> dev->pm_cap = pm;
> dev->d3_delay = PCI_PM_D3_WAIT;
> dev->d3cold_delay = PCI_PM_D3COLD_WAIT;
> + dev->d3cold_allowed = true;
>
> dev->d1_support = false;
> dev->d2_support = false;
> --- a/drivers/pci/pcie/portdrv_pci.c
> +++ b/drivers/pci/pcie/portdrv_pci.c
> @@ -200,6 +200,11 @@ static int __devinit pcie_portdrv_probe(
> return status;
>
> pci_save_state(dev);
> + /*
> + * D3cold may not work properly on some PCIe port, so disable
> + * it by default.
> + */
> + dev->d3cold_allowed = false;
> if (!pci_match_id(port_runtime_pm_black_list, dev))
> pm_runtime_put_noidle(&dev->dev);
>
>
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Linux kernel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.