]> git.baikalelectronics.ru Git - kernel.git/commit
PCI / PM: Restore PME Enable after config space restoration
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 12 Jul 2017 01:05:39 +0000 (03:05 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 12 Jul 2017 21:09:21 +0000 (23:09 +0200)
commitd8d9f28e81ce7740b684a2c00b96262584e1dc28
treeb60bc7ee980415b48df2bb167f2c5ee1efe0d6e9
parent98bd4ff02cfe255c484d2a0df4396578d7a0293c
PCI / PM: Restore PME Enable after config space restoration

Commit 2e0adf942a6e (PCI / PM: Restore PME Enable if skipping wakeup
setup) introduced a mechanism by which the PME Enable bit can be
restored by pci_enable_wake() if dev->wakeup_prepared is set in
case it has been overwritten by PCI config space restoration.

However, that commit overlooked the fact that on some systems (Dell
XPS13 9360 in particular) the AML handling wakeup events checks PME
Status and PME Enable and it won't trigger a Notify() for devices
where those bits are not set while it is running.

That happens during resume from suspend-to-idle when pci_restore_state()
invoked by pci_pm_default_resume_early() clears PME Enable before the
wakeup events are processed by AML, effectively causing those wakeup
events to be ignored.

Fix this issue by restoring the PME Enable configuration right after
pci_restore_state() has been called instead of doing that in
pci_enable_wake().

Fixes: 2e0adf942a6e (PCI / PM: Restore PME Enable if skipping wakeup setup)
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/pci-driver.c
drivers/pci/pci.c
drivers/pci/pci.h