[PATCH RFC 15/25] PCI/LUO: Restore PM related fields

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jason Miu <jasonmiu@xxxxxxxxxx>

- pm_cap
Restore the liveupdate saved `pm_cap` during the PCI Power Management
initialization.

- skip_bus_pm flag:
The flag skip_bus_pm is used in the PM suspend and resume
operations. Therefore we restore this flag for the device in the PM
init before all the operations.

- wakeup_prepared flag:
Restores the wakeup_prepared flag during the PM initialization.

Tested: QEMU VM boot test.

Signed-off-by: Chris Li <chrisl@xxxxxxxxxx>
---
 drivers/pci/pci.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 9e42090fb108920995ebe34bd2535a0e23fef7fd..e0e730f7bb3932567815c390088088bd5c56f11e 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -3209,13 +3209,14 @@ void pci_pm_init(struct pci_dev *dev)
 	u16 pmc;
 
 	device_enable_async_suspend(&dev->dev);
-	dev->wakeup_prepared = false;
 
 	dev->pm_cap = 0;
 	dev->pme_support = 0;
 
-	/* find PCI PM capability in list */
-	pm = pci_find_capability(dev, PCI_CAP_ID_PM);
+	/* Restore PM related fields after live update or find PM capability */
+	pm = PCI_SER_GET(dev, pm_cap, pci_find_capability(dev, PCI_CAP_ID_PM));
+	dev->wakeup_prepared = PCI_SER_GET(dev, wakeup_prepared, false);
+	dev->skip_bus_pm = PCI_SER_GET(dev, skip_bus_pm, dev->skip_bus_pm);
 	if (!pm)
 		goto poweron;
 	/* Check device's ability to generate PME# */

-- 
2.50.1.487.gc89ff58d15-goog





[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux