History

PCI: PM: Simplify bus-level hibernation callbacks

After a previous change causing all runtime-suspended PCI devices to be resumed before creating a snapshot image of memory during hibernation, it is not necessary to worry about the case in which them might be left in runtime-suspend any more, so get rid of the code related to that from bus-level PCI hibernation callbacks.

Rafael J. Wysocki committed 7 years ago

Commit a78ae451 parent 501debd1 file · +0 −27Browse files

Unified · Split

drivers/pci/pci-driver.c+0−27
@@ -994,22 +994,11 @@ static int pci_pm_freeze(struct device *dev) · 993 unmodified lines
994994 return 0;
995995 }
996996
997−static int pci_pm_freeze_late(struct device *dev)
998−{
999− if (dev_pm_smart_suspend_and_suspended(dev))
1000− return 0;
1001−
1002− return pm_generic_freeze_late(dev);
1003−}
1004−
1005997 static int pci_pm_freeze_noirq(struct device *dev)
1006998 {
1007999 struct pci_dev *pci_dev = to_pci_dev(dev);
10081000 struct device_driver *drv = dev->driver;
10091001
1010− if (dev_pm_smart_suspend_and_suspended(dev))
1011− return 0;
1012−
10131002 if (pci_has_legacy_pm_support(pci_dev))
10141003 return pci_legacy_suspend_late(dev, PMSG_FREEZE);
10151004
@@ -1039,16 +1028,6 @@ static int pci_pm_thaw_noirq(struct device *dev) · 23 unmodified lines
10391028 struct device_driver *drv = dev->driver;
10401029 int error = 0;
10411030
1042− /*
1043− * If the device is in runtime suspend, the code below may not work
1044− * correctly with it, so skip that code and make the PM core skip all of
1045− * the subsequent "thaw" callbacks for the device.
1046− */
1047− if (dev_pm_smart_suspend_and_suspended(dev)) {
1048− dev_pm_skip_next_resume_phases(dev);
1049− return 0;
1050− }
1051−
10521031 if (pcibios_pm_ops.thaw_noirq) {
10531032 error = pcibios_pm_ops.thaw_noirq(dev);
10541033 if (error)
@@ -1183,10 +1162,6 @@ static int pci_pm_restore_noirq(struct device *dev) · 128 unmodified lines
11831162 struct device_driver *drv = dev->driver;
11841163 int error = 0;
11851164
1186− /* This is analogous to the pci_pm_resume_noirq() case. */
1187− if (dev_pm_smart_suspend_and_suspended(dev))
1188− pm_runtime_set_active(dev);
1189−
11901165 if (pcibios_pm_ops.restore_noirq) {
11911166 error = pcibios_pm_ops.restore_noirq(dev);
11921167 if (error)
@@ -1235,7 +1210,6 @@ static int pci_pm_restore(struct device *dev) · 42 unmodified lines
12351210 #else /* !CONFIG_HIBERNATE_CALLBACKS */
12361211
12371212 #define pci_pm_freeze NULL
1238−#define pci_pm_freeze_late NULL
12391213 #define pci_pm_freeze_noirq NULL
12401214 #define pci_pm_thaw NULL
12411215 #define pci_pm_thaw_noirq NULL
@@ -1361,7 +1335,6 @@ static const struct dev_pm_ops pci_dev_pm_ops = { · 119 unmodified lines
13611335 .suspend_late = pci_pm_suspend_late,
13621336 .resume = pci_pm_resume,
13631337 .freeze = pci_pm_freeze,
1364− .freeze_late = pci_pm_freeze_late,
13651338 .thaw = pci_pm_thaw,
13661339 .poweroff = pci_pm_poweroff,
13671340 .poweroff_late = pci_pm_poweroff_late,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t