diff options
Diffstat (limited to 'drivers/misc/mei/pci-txe.c')
-rw-r--r-- | drivers/misc/mei/pci-txe.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/drivers/misc/mei/pci-txe.c b/drivers/misc/mei/pci-txe.c index e38a5f144373..0566f9bfa7de 100644 --- a/drivers/misc/mei/pci-txe.c +++ b/drivers/misc/mei/pci-txe.c | |||
@@ -144,12 +144,14 @@ static int mei_txe_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
144 | pdev->dev_flags |= PCI_DEV_FLAGS_NEEDS_RESUME; | 144 | pdev->dev_flags |= PCI_DEV_FLAGS_NEEDS_RESUME; |
145 | 145 | ||
146 | /* | 146 | /* |
147 | * For not wake-able HW runtime pm framework | 147 | * TXE maps runtime suspend/resume to own power gating states, |
148 | * can't be used on pci device level. | 148 | * hence we need to go around native PCI runtime service which |
149 | * Use domain runtime pm callbacks instead. | 149 | * eventually brings the device into D3cold/hot state. |
150 | */ | 150 | * But the TXE device cannot wake up from D3 unlike from own |
151 | if (!pci_dev_run_wake(pdev)) | 151 | * power gating. To get around PCI device native runtime pm, |
152 | mei_txe_set_pm_domain(dev); | 152 | * TXE uses runtime pm domain handlers which take precedence. |
153 | */ | ||
154 | mei_txe_set_pm_domain(dev); | ||
153 | 155 | ||
154 | pm_runtime_put_noidle(&pdev->dev); | 156 | pm_runtime_put_noidle(&pdev->dev); |
155 | 157 | ||
@@ -186,8 +188,7 @@ static void mei_txe_shutdown(struct pci_dev *pdev) | |||
186 | dev_dbg(&pdev->dev, "shutdown\n"); | 188 | dev_dbg(&pdev->dev, "shutdown\n"); |
187 | mei_stop(dev); | 189 | mei_stop(dev); |
188 | 190 | ||
189 | if (!pci_dev_run_wake(pdev)) | 191 | mei_txe_unset_pm_domain(dev); |
190 | mei_txe_unset_pm_domain(dev); | ||
191 | 192 | ||
192 | mei_disable_interrupts(dev); | 193 | mei_disable_interrupts(dev); |
193 | free_irq(pdev->irq, dev); | 194 | free_irq(pdev->irq, dev); |
@@ -215,8 +216,7 @@ static void mei_txe_remove(struct pci_dev *pdev) | |||
215 | 216 | ||
216 | mei_stop(dev); | 217 | mei_stop(dev); |
217 | 218 | ||
218 | if (!pci_dev_run_wake(pdev)) | 219 | mei_txe_unset_pm_domain(dev); |
219 | mei_txe_unset_pm_domain(dev); | ||
220 | 220 | ||
221 | mei_disable_interrupts(dev); | 221 | mei_disable_interrupts(dev); |
222 | free_irq(pdev->irq, dev); | 222 | free_irq(pdev->irq, dev); |
@@ -318,15 +318,7 @@ static int mei_txe_pm_runtime_suspend(struct device *device) | |||
318 | else | 318 | else |
319 | ret = -EAGAIN; | 319 | ret = -EAGAIN; |
320 | 320 | ||
321 | /* | 321 | /* keep irq on we are staying in D0 */ |
322 | * If everything is okay we're about to enter PCI low | ||
323 | * power state (D3) therefor we need to disable the | ||
324 | * interrupts towards host. | ||
325 | * However if device is not wakeable we do not enter | ||
326 | * D-low state and we need to keep the interrupt kicking | ||
327 | */ | ||
328 | if (!ret && pci_dev_run_wake(pdev)) | ||
329 | mei_disable_interrupts(dev); | ||
330 | 322 | ||
331 | dev_dbg(&pdev->dev, "rpm: txe: runtime suspend ret=%d\n", ret); | 323 | dev_dbg(&pdev->dev, "rpm: txe: runtime suspend ret=%d\n", ret); |
332 | 324 | ||