Patch "PCI / PM: Force devices to D0 in pci_pm_thaw_noirq()" has been added to the 4.14-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
PCI / PM: Force devices to D0 in pci_pm_thaw_noirq()
to the 4.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
pci-pm-force-devices-to-d0-in-pci_pm_thaw_noirq.patch
and it can be found in the queue-4.14 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
5839ee7389e893a31e4e3c9cf17b50d14103c902Mon Sep 17 00:00:00 2001
From: "Rafael J. Wysocki" <[email protected]>
Date: Fri, 15 Dec 2017 03:07:18 +0100
Subject: PCI / PM: Force devices to D0 in pci_pm_thaw_noirq()
From: Rafael J. Wysocki <[email protected]>
commit 5839ee7389e893a31e4e3c9cf17b50d14103c902 upstream.
It is incorrect to call pci_restore_state() for devices in low-power states (D1-D3), as that involves the restoration of MSI setup which requires MMIO to be operational and that is only the case in D0.
However, pci_pm_thaw_noirq() may do that if the driver's "freeze" callbacks put the device into a low-power state, so fix it by making it force devices into D0 via pci_set_power_state() instead of trying to "update" their power state which is pointless.
--- drivers/pci/pci-driver.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/pci/pci-driver.c +6 -1
@@ -968,7 +968,12 @@ static int pci_pm_thaw_noirq(struct deviif (pci_has_legacy_pm_support (pci_dev))return pci_legacy_resume_early (dev); -pci_update_current_state (pci_dev,PCI_D0 ); +/* +* pci_restore_state() requires the device to be in D0 (because of MSI +* restoration among other things), so force it into D0 in case the +* driver's "freeze" callbacks put it into a low-power state directly. +*/ +pci_set_power_state (pci_dev,PCI_D0 );pci_restore_state (pci_dev);if (drv && drv->pm && drv->pm->thaw_noirq)
Patches currently in stable-queue which might be from [email protected] are
queue-4.14/pci-pm-force-devices-to-d0-in-pci_pm_thaw_noirq.patch queue-4.14/acpi-apei-erst-fix-missing-error-handling-in-erst_reader.patch