]> git.baikalelectronics.ru Git - kernel.git/commit
PCI / PM: Restore PME Enable if skipping wakeup setup
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 12 Jun 2017 20:53:36 +0000 (22:53 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 14 Jun 2017 22:55:44 +0000 (00:55 +0200)
commit2e0adf942a6e31911b8a26bf959b9e17386c3a3d
treea9827178b9843f4a7306173545cd1ac60995e464
parentc72b8b927add957ff709fb967c9454541c56af0d
PCI / PM: Restore PME Enable if skipping wakeup setup

The wakeup_prepared PCI device flag is used for preventing subsequent
changes of PCI device wakeup settings in the same way (e.g. enabling
device wakeup twice in a row).

However, in some cases PME Enable may be updated by things like PCI
configuration space restoration in the meantime and it may need to be
set again even though the rest of the settings need not change, so
modify __pci_enable_wake() to do that when it is about to return
early.

Also, it is reasonable to expect that __pci_enable_wake() will always
clear PME Status when invoked to disable device wakeup, so make it do
so even if it is going to return early then.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/pci.c