diff options
Diffstat (limited to 'drivers/pci/pcie/portdrv_pci.c')
-rw-r--r-- | drivers/pci/pcie/portdrv_pci.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c index ca10911ee0df..0761d90ca279 100644 --- a/drivers/pci/pcie/portdrv_pci.c +++ b/drivers/pci/pcie/portdrv_pci.c | |||
@@ -133,9 +133,17 @@ static int pcie_port_runtime_resume(struct device *dev) | |||
133 | { | 133 | { |
134 | return 0; | 134 | return 0; |
135 | } | 135 | } |
136 | |||
137 | static int pcie_port_runtime_idle(struct device *dev) | ||
138 | { | ||
139 | /* Delay for a short while to prevent too frequent suspend/resume */ | ||
140 | pm_schedule_suspend(dev, 10); | ||
141 | return -EBUSY; | ||
142 | } | ||
136 | #else | 143 | #else |
137 | #define pcie_port_runtime_suspend NULL | 144 | #define pcie_port_runtime_suspend NULL |
138 | #define pcie_port_runtime_resume NULL | 145 | #define pcie_port_runtime_resume NULL |
146 | #define pcie_port_runtime_idle NULL | ||
139 | #endif | 147 | #endif |
140 | 148 | ||
141 | static const struct dev_pm_ops pcie_portdrv_pm_ops = { | 149 | static const struct dev_pm_ops pcie_portdrv_pm_ops = { |
@@ -148,6 +156,7 @@ static const struct dev_pm_ops pcie_portdrv_pm_ops = { | |||
148 | .resume_noirq = pcie_port_resume_noirq, | 156 | .resume_noirq = pcie_port_resume_noirq, |
149 | .runtime_suspend = pcie_port_runtime_suspend, | 157 | .runtime_suspend = pcie_port_runtime_suspend, |
150 | .runtime_resume = pcie_port_runtime_resume, | 158 | .runtime_resume = pcie_port_runtime_resume, |
159 | .runtime_idle = pcie_port_runtime_idle, | ||
151 | }; | 160 | }; |
152 | 161 | ||
153 | #define PCIE_PORTDRV_PM_OPS (&pcie_portdrv_pm_ops) | 162 | #define PCIE_PORTDRV_PM_OPS (&pcie_portdrv_pm_ops) |
@@ -193,6 +202,11 @@ static int __devinit pcie_portdrv_probe(struct pci_dev *dev, | |||
193 | return status; | 202 | return status; |
194 | 203 | ||
195 | pci_save_state(dev); | 204 | pci_save_state(dev); |
205 | /* | ||
206 | * D3cold may not work properly on some PCIe port, so disable | ||
207 | * it by default. | ||
208 | */ | ||
209 | dev->d3cold_allowed = false; | ||
196 | if (!pci_match_id(port_runtime_pm_black_list, dev)) | 210 | if (!pci_match_id(port_runtime_pm_black_list, dev)) |
197 | pm_runtime_put_noidle(&dev->dev); | 211 | pm_runtime_put_noidle(&dev->dev); |
198 | 212 | ||