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.
Unified · Split
| @@ -994,22 +994,11 @@ static int pci_pm_freeze(struct device *dev) · 993 unmodified lines | |||
| 994 | return 0; | 994 | return 0; |
| 995 | } | 995 | } |
| 996 | 996 | ||
| 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 | |||
| 1005 | static int pci_pm_freeze_noirq(struct device *dev) | 997 | static int pci_pm_freeze_noirq(struct device *dev) |
| 1006 | { | 998 | { |
| 1007 | struct pci_dev *pci_dev = to_pci_dev(dev); | 999 | struct pci_dev *pci_dev = to_pci_dev(dev); |
| 1008 | struct device_driver *drv = dev->driver; | 1000 | struct device_driver *drv = dev->driver; |
| 1009 | 1001 | ||
| 1010 | if (dev_pm_smart_suspend_and_suspended(dev)) | ||
| 1011 | return 0; | ||
| 1012 | |||
| 1013 | if (pci_has_legacy_pm_support(pci_dev)) | 1002 | if (pci_has_legacy_pm_support(pci_dev)) |
| 1014 | return pci_legacy_suspend_late(dev, PMSG_FREEZE); | 1003 | return pci_legacy_suspend_late(dev, PMSG_FREEZE); |
| 1015 | 1004 | ||
| @@ -1039,16 +1028,6 @@ static int pci_pm_thaw_noirq(struct device *dev) · 23 unmodified lines | |||
| 1039 | struct device_driver *drv = dev->driver; | 1028 | struct device_driver *drv = dev->driver; |
| 1040 | int error = 0; | 1029 | int error = 0; |
| 1041 | 1030 | ||
| 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 | |||
| 1052 | if (pcibios_pm_ops.thaw_noirq) { | 1031 | if (pcibios_pm_ops.thaw_noirq) { |
| 1053 | error = pcibios_pm_ops.thaw_noirq(dev); | 1032 | error = pcibios_pm_ops.thaw_noirq(dev); |
| 1054 | if (error) | 1033 | if (error) |
| @@ -1183,10 +1162,6 @@ static int pci_pm_restore_noirq(struct device *dev) · 128 unmodified lines | |||
| 1183 | struct device_driver *drv = dev->driver; | 1162 | struct device_driver *drv = dev->driver; |
| 1184 | int error = 0; | 1163 | int error = 0; |
| 1185 | 1164 | ||
| 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 | |||
| 1190 | if (pcibios_pm_ops.restore_noirq) { | 1165 | if (pcibios_pm_ops.restore_noirq) { |
| 1191 | error = pcibios_pm_ops.restore_noirq(dev); | 1166 | error = pcibios_pm_ops.restore_noirq(dev); |
| 1192 | if (error) | 1167 | if (error) |
| @@ -1235,7 +1210,6 @@ static int pci_pm_restore(struct device *dev) · 42 unmodified lines | |||
| 1235 | #else /* !CONFIG_HIBERNATE_CALLBACKS */ | 1210 | #else /* !CONFIG_HIBERNATE_CALLBACKS */ |
| 1236 | 1211 | ||
| 1237 | #define pci_pm_freeze NULL | 1212 | #define pci_pm_freeze NULL |
| 1238 | #define pci_pm_freeze_late NULL | ||
| 1239 | #define pci_pm_freeze_noirq NULL | 1213 | #define pci_pm_freeze_noirq NULL |
| 1240 | #define pci_pm_thaw NULL | 1214 | #define pci_pm_thaw NULL |
| 1241 | #define pci_pm_thaw_noirq NULL | 1215 | #define pci_pm_thaw_noirq NULL |
| @@ -1361,7 +1335,6 @@ static const struct dev_pm_ops pci_dev_pm_ops = { · 119 unmodified lines | |||
| 1361 | .suspend_late = pci_pm_suspend_late, | 1335 | .suspend_late = pci_pm_suspend_late, |
| 1362 | .resume = pci_pm_resume, | 1336 | .resume = pci_pm_resume, |
| 1363 | .freeze = pci_pm_freeze, | 1337 | .freeze = pci_pm_freeze, |
| 1364 | .freeze_late = pci_pm_freeze_late, | ||
| 1365 | .thaw = pci_pm_thaw, | 1338 | .thaw = pci_pm_thaw, |
| 1366 | .poweroff = pci_pm_poweroff, | 1339 | .poweroff = pci_pm_poweroff, |
| 1367 | .poweroff_late = pci_pm_poweroff_late, | 1340 | .poweroff_late = pci_pm_poweroff_late, |