From: Jason Miu <jasonmiu@xxxxxxxxxx> Restore the pci_dev pme_poll flag from liveupdate. If the restored flag is false, the device is in an active state (was not being PME polled before liveupdate reboot), we do not touch the PCI PME register of the device. Tested: QEMU VM liveupdate reboot, put liveupdate in to finish phase. Signed-off-by: Chris Li <chrisl@xxxxxxxxxx> --- drivers/pci/pci.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index e0e730f7bb3932567815c390088088bd5c56f11e..46fb80dbca590c251fcad3bf2f011a16f6898810 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -3263,8 +3263,17 @@ void pci_pm_init(struct pci_dev *dev) * let the user space enable it to wake up the system as needed. */ device_set_wakeup_capable(&dev->dev, true); - /* Disable the PME# generation functionality */ - pci_pme_active(dev, false); + + dev->pme_poll = PCI_SER_GET(dev, pme_poll, true); + /* + * If the restored pme_poll is false, do not + * set disable to pci_pme_active(), as the device should be in + * an active state, we do not update the device's + * PCI_PM_CTRL_PME_ENABLE flag and disable the PME# generation + * functionality + */ + if (dev->pme_poll) + pci_pme_active(dev, false); } pci_read_config_word(dev, PCI_STATUS, &status); -- 2.50.1.487.gc89ff58d15-goog