aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pcie/pme.c
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2014-10-22 08:31:55 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-10-23 16:47:28 -0400
commit5dfd7f9f88ba8539e630d04e17b93ccc7043c31c (patch)
tree933a7145828efe1a8b3b022fccfddb63b5d6de7c /drivers/pci/pcie/pme.c
parentf114040e3ea6e07372334ade75d1ee0775c355e1 (diff)
PCI / PM: handle failure to enable wakeup on PCIe PME
If the irqchip handling the PCIe PME interrupt is not able to enable interrupt wakeup we should properly reflect this in the PME suspend status. This fixes a kernel warning on resume, where it would try to disable the irq wakeup that failed to be activated while suspending, for example: WARNING: CPU: 0 PID: 609 at kernel/irq/manage.c:536 irq_set_irq_wake+0xc0/0xf8() Unbalanced IRQ 384 wake disable Fixes: 76cde7e49590 (PCI / PM: Make PCIe PME interrupts wake up from suspend-to-idle) Reported-and-tested-by: Richard Zhu <richard.zhu@freescale.com> Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/pci/pcie/pme.c')
-rw-r--r--drivers/pci/pcie/pme.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/pci/pcie/pme.c b/drivers/pci/pcie/pme.c
index a9f9c46e5022..63fc63911295 100644
--- a/drivers/pci/pcie/pme.c
+++ b/drivers/pci/pcie/pme.c
@@ -397,6 +397,7 @@ static int pcie_pme_suspend(struct pcie_device *srv)
397 struct pcie_pme_service_data *data = get_service_data(srv); 397 struct pcie_pme_service_data *data = get_service_data(srv);
398 struct pci_dev *port = srv->port; 398 struct pci_dev *port = srv->port;
399 bool wakeup; 399 bool wakeup;
400 int ret;
400 401
401 if (device_may_wakeup(&port->dev)) { 402 if (device_may_wakeup(&port->dev)) {
402 wakeup = true; 403 wakeup = true;
@@ -407,9 +408,10 @@ static int pcie_pme_suspend(struct pcie_device *srv)
407 } 408 }
408 spin_lock_irq(&data->lock); 409 spin_lock_irq(&data->lock);
409 if (wakeup) { 410 if (wakeup) {
410 enable_irq_wake(srv->irq); 411 ret = enable_irq_wake(srv->irq);
411 data->suspend_level = PME_SUSPEND_WAKEUP; 412 data->suspend_level = PME_SUSPEND_WAKEUP;
412 } else { 413 }
414 if (!wakeup || ret) {
413 struct pci_dev *port = srv->port; 415 struct pci_dev *port = srv->port;
414 416
415 pcie_pme_interrupt_enable(port, false); 417 pcie_pme_interrupt_enable(port, false);