提交 931ff68a 编写于 作者: R Rafael J. Wysocki

PCI PM: Restore config spaces of all devices during early resume

At present the configuration spaces of PCI devices that have no
drivers or no PM support in the drivers (either legacy or through a
pm object) are not saved during suspend and, consequently, they are
not restored during resume.  This generally may lead to the state of
the system being slightly inconsistent after the resume, so it's
better to save and restore the configuration spaces of these devices
as well.
Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
Acked-by: NIngo Molnar <mingo@elte.hu>
Acked-by: NJesse Barnes <jbarnes@virtuousgeek.org>
上级 4a865905
...@@ -516,13 +516,13 @@ static int pci_pm_suspend(struct device *dev) ...@@ -516,13 +516,13 @@ static int pci_pm_suspend(struct device *dev)
if (pci_has_legacy_pm_support(pci_dev)) if (pci_has_legacy_pm_support(pci_dev))
return pci_legacy_suspend(dev, PMSG_SUSPEND); return pci_legacy_suspend(dev, PMSG_SUSPEND);
pci_dev->state_saved = false;
if (!pm) { if (!pm) {
pci_pm_default_suspend(pci_dev); pci_pm_default_suspend(pci_dev);
goto Fixup; goto Fixup;
} }
pci_dev->state_saved = false;
if (pm->suspend) { if (pm->suspend) {
pci_power_t prev = pci_dev->current_state; pci_power_t prev = pci_dev->current_state;
int error; int error;
...@@ -554,8 +554,10 @@ static int pci_pm_suspend_noirq(struct device *dev) ...@@ -554,8 +554,10 @@ static int pci_pm_suspend_noirq(struct device *dev)
if (pci_has_legacy_pm_support(pci_dev)) if (pci_has_legacy_pm_support(pci_dev))
return pci_legacy_suspend_late(dev, PMSG_SUSPEND); return pci_legacy_suspend_late(dev, PMSG_SUSPEND);
if (!pm) if (!pm) {
pci_save_state(pci_dev);
return 0; return 0;
}
if (pm->suspend_noirq) { if (pm->suspend_noirq) {
pci_power_t prev = pci_dev->current_state; pci_power_t prev = pci_dev->current_state;
...@@ -650,13 +652,13 @@ static int pci_pm_freeze(struct device *dev) ...@@ -650,13 +652,13 @@ static int pci_pm_freeze(struct device *dev)
if (pci_has_legacy_pm_support(pci_dev)) if (pci_has_legacy_pm_support(pci_dev))
return pci_legacy_suspend(dev, PMSG_FREEZE); return pci_legacy_suspend(dev, PMSG_FREEZE);
pci_dev->state_saved = false;
if (!pm) { if (!pm) {
pci_pm_default_suspend(pci_dev); pci_pm_default_suspend(pci_dev);
return 0; return 0;
} }
pci_dev->state_saved = false;
if (pm->freeze) { if (pm->freeze) {
int error; int error;
...@@ -738,13 +740,13 @@ static int pci_pm_poweroff(struct device *dev) ...@@ -738,13 +740,13 @@ static int pci_pm_poweroff(struct device *dev)
if (pci_has_legacy_pm_support(pci_dev)) if (pci_has_legacy_pm_support(pci_dev))
return pci_legacy_suspend(dev, PMSG_HIBERNATE); return pci_legacy_suspend(dev, PMSG_HIBERNATE);
pci_dev->state_saved = false;
if (!pm) { if (!pm) {
pci_pm_default_suspend(pci_dev); pci_pm_default_suspend(pci_dev);
goto Fixup; goto Fixup;
} }
pci_dev->state_saved = false;
if (pm->poweroff) { if (pm->poweroff) {
int error; int error;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册