Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'pm-sleep'

* pm-sleep:
PM: sleep: Drop dev_pm_skip_next_resume_phases()
ACPI: PM: Drop unused function and function header
ACPI: PM: Introduce "poweroff" callbacks for ACPI PM domain and LPSS
ACPI: PM: Simplify and fix PM domain hibernation callbacks
PCI: PM: Simplify bus-level hibernation callbacks
PM: ACPI/PCI: Resume all devices during hibernation
kernel: power: swap: use kzalloc() instead of kmalloc() followed by memset()
PM: sleep: Update struct wakeup_source documentation
drivers: base: power: remove wakeup_sources_stats_dentry variable
PM: suspend: Rename pm_suspend_via_s2idle()
PM: sleep: Show how long dpm_suspend_start() and dpm_suspend_end() take
PM: hibernate: powerpc: Expose pfn_is_nosave() prototype

+194 -147
+1
arch/powerpc/kernel/suspend.c
··· 7 7 */ 8 8 9 9 #include <linux/mm.h> 10 + #include <linux/suspend.h> 10 11 #include <asm/page.h> 11 12 #include <asm/sections.h> 12 13
-1
arch/s390/kernel/entry.h
··· 63 63 void die(struct pt_regs *regs, const char *str); 64 64 int setup_profiling_timer(unsigned int multiplier); 65 65 void __init time_init(void); 66 - int pfn_is_nosave(unsigned long); 67 66 void s390_early_resume(void); 68 67 unsigned long prepare_ftrace_return(unsigned long parent, unsigned long sp, unsigned long ip); 69 68
+99 -12
drivers/acpi/acpi_lpss.c
··· 1061 1061 int ret; 1062 1062 1063 1063 if (pdata->dev_desc->resume_from_noirq) { 1064 + /* 1065 + * The driver's ->suspend_late callback will be invoked by 1066 + * acpi_lpss_do_suspend_late(), with the assumption that the 1067 + * driver really wanted to run that code in ->suspend_noirq, but 1068 + * it could not run after acpi_dev_suspend() and the driver 1069 + * expected the latter to be called in the "late" phase. 1070 + */ 1064 1071 ret = acpi_lpss_do_suspend_late(dev); 1065 1072 if (ret) 1066 1073 return ret; ··· 1098 1091 struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev)); 1099 1092 int ret; 1100 1093 1101 - ret = acpi_subsys_resume_noirq(dev); 1094 + /* Follow acpi_subsys_resume_noirq(). */ 1095 + if (dev_pm_may_skip_resume(dev)) 1096 + return 0; 1097 + 1098 + if (dev_pm_smart_suspend_and_suspended(dev)) 1099 + pm_runtime_set_active(dev); 1100 + 1101 + ret = pm_generic_resume_noirq(dev); 1102 1102 if (ret) 1103 1103 return ret; 1104 1104 1105 - if (!dev_pm_may_skip_resume(dev) && pdata->dev_desc->resume_from_noirq) 1106 - ret = acpi_lpss_do_resume_early(dev); 1105 + if (!pdata->dev_desc->resume_from_noirq) 1106 + return 0; 1107 1107 1108 - return ret; 1108 + /* 1109 + * The driver's ->resume_early callback will be invoked by 1110 + * acpi_lpss_do_resume_early(), with the assumption that the driver 1111 + * really wanted to run that code in ->resume_noirq, but it could not 1112 + * run before acpi_dev_resume() and the driver expected the latter to be 1113 + * called in the "early" phase. 1114 + */ 1115 + return acpi_lpss_do_resume_early(dev); 1109 1116 } 1110 1117 1118 + static int acpi_lpss_do_restore_early(struct device *dev) 1119 + { 1120 + int ret = acpi_lpss_resume(dev); 1121 + 1122 + return ret ? ret : pm_generic_restore_early(dev); 1123 + } 1124 + 1125 + static int acpi_lpss_restore_early(struct device *dev) 1126 + { 1127 + struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev)); 1128 + 1129 + if (pdata->dev_desc->resume_from_noirq) 1130 + return 0; 1131 + 1132 + return acpi_lpss_do_restore_early(dev); 1133 + } 1134 + 1135 + static int acpi_lpss_restore_noirq(struct device *dev) 1136 + { 1137 + struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev)); 1138 + int ret; 1139 + 1140 + ret = pm_generic_restore_noirq(dev); 1141 + if (ret) 1142 + return ret; 1143 + 1144 + if (!pdata->dev_desc->resume_from_noirq) 1145 + return 0; 1146 + 1147 + /* This is analogous to what happens in acpi_lpss_resume_noirq(). */ 1148 + return acpi_lpss_do_restore_early(dev); 1149 + } 1150 + 1151 + static int acpi_lpss_do_poweroff_late(struct device *dev) 1152 + { 1153 + int ret = pm_generic_poweroff_late(dev); 1154 + 1155 + return ret ? ret : acpi_lpss_suspend(dev, device_may_wakeup(dev)); 1156 + } 1157 + 1158 + static int acpi_lpss_poweroff_late(struct device *dev) 1159 + { 1160 + struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev)); 1161 + 1162 + if (dev_pm_smart_suspend_and_suspended(dev)) 1163 + return 0; 1164 + 1165 + if (pdata->dev_desc->resume_from_noirq) 1166 + return 0; 1167 + 1168 + return acpi_lpss_do_poweroff_late(dev); 1169 + } 1170 + 1171 + static int acpi_lpss_poweroff_noirq(struct device *dev) 1172 + { 1173 + struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev)); 1174 + 1175 + if (dev_pm_smart_suspend_and_suspended(dev)) 1176 + return 0; 1177 + 1178 + if (pdata->dev_desc->resume_from_noirq) { 1179 + /* This is analogous to the acpi_lpss_suspend_noirq() case. */ 1180 + int ret = acpi_lpss_do_poweroff_late(dev); 1181 + if (ret) 1182 + return ret; 1183 + } 1184 + 1185 + return pm_generic_poweroff_noirq(dev); 1186 + } 1111 1187 #endif /* CONFIG_PM_SLEEP */ 1112 1188 1113 1189 static int acpi_lpss_runtime_suspend(struct device *dev) ··· 1224 1134 .resume_noirq = acpi_lpss_resume_noirq, 1225 1135 .resume_early = acpi_lpss_resume_early, 1226 1136 .freeze = acpi_subsys_freeze, 1227 - .freeze_late = acpi_subsys_freeze_late, 1228 - .freeze_noirq = acpi_subsys_freeze_noirq, 1229 - .thaw_noirq = acpi_subsys_thaw_noirq, 1230 - .poweroff = acpi_subsys_suspend, 1231 - .poweroff_late = acpi_lpss_suspend_late, 1232 - .poweroff_noirq = acpi_lpss_suspend_noirq, 1233 - .restore_noirq = acpi_lpss_resume_noirq, 1234 - .restore_early = acpi_lpss_resume_early, 1137 + .poweroff = acpi_subsys_poweroff, 1138 + .poweroff_late = acpi_lpss_poweroff_late, 1139 + .poweroff_noirq = acpi_lpss_poweroff_noirq, 1140 + .restore_noirq = acpi_lpss_restore_noirq, 1141 + .restore_early = acpi_lpss_restore_early, 1235 1142 #endif 1236 1143 .runtime_suspend = acpi_lpss_runtime_suspend, 1237 1144 .runtime_resume = acpi_lpss_runtime_resume,
+59 -49
drivers/acpi/device_pm.c
··· 1120 1120 * acpi_subsys_resume_noirq - Run the device driver's "noirq" resume callback. 1121 1121 * @dev: Device to handle. 1122 1122 */ 1123 - int acpi_subsys_resume_noirq(struct device *dev) 1123 + static int acpi_subsys_resume_noirq(struct device *dev) 1124 1124 { 1125 1125 if (dev_pm_may_skip_resume(dev)) 1126 1126 return 0; ··· 1135 1135 1136 1136 return pm_generic_resume_noirq(dev); 1137 1137 } 1138 - EXPORT_SYMBOL_GPL(acpi_subsys_resume_noirq); 1139 1138 1140 1139 /** 1141 1140 * acpi_subsys_resume_early - Resume device using ACPI. ··· 1144 1145 * generic early resume procedure for it during system transition into the 1145 1146 * working state. 1146 1147 */ 1147 - int acpi_subsys_resume_early(struct device *dev) 1148 + static int acpi_subsys_resume_early(struct device *dev) 1148 1149 { 1149 1150 int ret = acpi_dev_resume(dev); 1150 1151 return ret ? ret : pm_generic_resume_early(dev); 1151 1152 } 1152 - EXPORT_SYMBOL_GPL(acpi_subsys_resume_early); 1153 1153 1154 1154 /** 1155 1155 * acpi_subsys_freeze - Run the device driver's freeze callback. ··· 1157 1159 int acpi_subsys_freeze(struct device *dev) 1158 1160 { 1159 1161 /* 1160 - * This used to be done in acpi_subsys_prepare() for all devices and 1161 - * some drivers may depend on it, so do it here. Ideally, however, 1162 - * runtime-suspended devices should not be touched during freeze/thaw 1163 - * transitions. 1162 + * Resume all runtime-suspended devices before creating a snapshot 1163 + * image of system memory, because the restore kernel generally cannot 1164 + * be expected to always handle them consistently and they need to be 1165 + * put into the runtime-active metastate during system resume anyway, 1166 + * so it is better to ensure that the state saved in the image will be 1167 + * always consistent with that. 1164 1168 */ 1165 - if (!dev_pm_test_driver_flags(dev, DPM_FLAG_SMART_SUSPEND)) 1166 - pm_runtime_resume(dev); 1169 + pm_runtime_resume(dev); 1167 1170 1168 1171 return pm_generic_freeze(dev); 1169 1172 } 1170 1173 EXPORT_SYMBOL_GPL(acpi_subsys_freeze); 1171 1174 1172 1175 /** 1173 - * acpi_subsys_freeze_late - Run the device driver's "late" freeze callback. 1174 - * @dev: Device to handle. 1176 + * acpi_subsys_restore_early - Restore device using ACPI. 1177 + * @dev: Device to restore. 1175 1178 */ 1176 - int acpi_subsys_freeze_late(struct device *dev) 1179 + int acpi_subsys_restore_early(struct device *dev) 1177 1180 { 1181 + int ret = acpi_dev_resume(dev); 1182 + return ret ? ret : pm_generic_restore_early(dev); 1183 + } 1184 + EXPORT_SYMBOL_GPL(acpi_subsys_restore_early); 1185 + 1186 + /** 1187 + * acpi_subsys_poweroff - Run the device driver's poweroff callback. 1188 + * @dev: Device to handle. 1189 + * 1190 + * Follow PCI and resume devices from runtime suspend before running their 1191 + * system poweroff callbacks, unless the driver can cope with runtime-suspended 1192 + * devices during system suspend and there are no ACPI-specific reasons for 1193 + * resuming them. 1194 + */ 1195 + int acpi_subsys_poweroff(struct device *dev) 1196 + { 1197 + if (!dev_pm_test_driver_flags(dev, DPM_FLAG_SMART_SUSPEND) || 1198 + acpi_dev_needs_resume(dev, ACPI_COMPANION(dev))) 1199 + pm_runtime_resume(dev); 1200 + 1201 + return pm_generic_poweroff(dev); 1202 + } 1203 + EXPORT_SYMBOL_GPL(acpi_subsys_poweroff); 1204 + 1205 + /** 1206 + * acpi_subsys_poweroff_late - Run the device driver's poweroff callback. 1207 + * @dev: Device to handle. 1208 + * 1209 + * Carry out the generic late poweroff procedure for @dev and use ACPI to put 1210 + * it into a low-power state during system transition into a sleep state. 1211 + */ 1212 + static int acpi_subsys_poweroff_late(struct device *dev) 1213 + { 1214 + int ret; 1178 1215 1179 1216 if (dev_pm_smart_suspend_and_suspended(dev)) 1180 1217 return 0; 1181 1218 1182 - return pm_generic_freeze_late(dev); 1219 + ret = pm_generic_poweroff_late(dev); 1220 + if (ret) 1221 + return ret; 1222 + 1223 + return acpi_dev_suspend(dev, device_may_wakeup(dev)); 1183 1224 } 1184 - EXPORT_SYMBOL_GPL(acpi_subsys_freeze_late); 1185 1225 1186 1226 /** 1187 - * acpi_subsys_freeze_noirq - Run the device driver's "noirq" freeze callback. 1188 - * @dev: Device to handle. 1227 + * acpi_subsys_poweroff_noirq - Run the driver's "noirq" poweroff callback. 1228 + * @dev: Device to suspend. 1189 1229 */ 1190 - int acpi_subsys_freeze_noirq(struct device *dev) 1230 + static int acpi_subsys_poweroff_noirq(struct device *dev) 1191 1231 { 1192 - 1193 1232 if (dev_pm_smart_suspend_and_suspended(dev)) 1194 1233 return 0; 1195 1234 1196 - return pm_generic_freeze_noirq(dev); 1235 + return pm_generic_poweroff_noirq(dev); 1197 1236 } 1198 - EXPORT_SYMBOL_GPL(acpi_subsys_freeze_noirq); 1199 - 1200 - /** 1201 - * acpi_subsys_thaw_noirq - Run the device driver's "noirq" thaw callback. 1202 - * @dev: Device to handle. 1203 - */ 1204 - int acpi_subsys_thaw_noirq(struct device *dev) 1205 - { 1206 - /* 1207 - * If the device is in runtime suspend, the "thaw" code may not work 1208 - * correctly with it, so skip the driver callback and make the PM core 1209 - * skip all of the subsequent "thaw" callbacks for the device. 1210 - */ 1211 - if (dev_pm_smart_suspend_and_suspended(dev)) { 1212 - dev_pm_skip_next_resume_phases(dev); 1213 - return 0; 1214 - } 1215 - 1216 - return pm_generic_thaw_noirq(dev); 1217 - } 1218 - EXPORT_SYMBOL_GPL(acpi_subsys_thaw_noirq); 1219 1237 #endif /* CONFIG_PM_SLEEP */ 1220 1238 1221 1239 static struct dev_pm_domain acpi_general_pm_domain = { ··· 1247 1233 .resume_noirq = acpi_subsys_resume_noirq, 1248 1234 .resume_early = acpi_subsys_resume_early, 1249 1235 .freeze = acpi_subsys_freeze, 1250 - .freeze_late = acpi_subsys_freeze_late, 1251 - .freeze_noirq = acpi_subsys_freeze_noirq, 1252 - .thaw_noirq = acpi_subsys_thaw_noirq, 1253 - .poweroff = acpi_subsys_suspend, 1254 - .poweroff_late = acpi_subsys_suspend_late, 1255 - .poweroff_noirq = acpi_subsys_suspend_noirq, 1256 - .restore_noirq = acpi_subsys_resume_noirq, 1257 - .restore_early = acpi_subsys_resume_early, 1236 + .poweroff = acpi_subsys_poweroff, 1237 + .poweroff_late = acpi_subsys_poweroff_late, 1238 + .poweroff_noirq = acpi_subsys_poweroff_noirq, 1239 + .restore_early = acpi_subsys_restore_early, 1258 1240 #endif 1259 1241 }, 1260 1242 };
+14 -22
drivers/base/power/main.c
··· 530 530 /*------------------------- Resume routines -------------------------*/ 531 531 532 532 /** 533 - * dev_pm_skip_next_resume_phases - Skip next system resume phases for device. 534 - * @dev: Target device. 535 - * 536 - * Make the core skip the "early resume" and "resume" phases for @dev. 537 - * 538 - * This function can be called by middle-layer code during the "noirq" phase of 539 - * system resume if necessary, but not by device drivers. 540 - */ 541 - void dev_pm_skip_next_resume_phases(struct device *dev) 542 - { 543 - dev->power.is_late_suspended = false; 544 - dev->power.is_suspended = false; 545 - } 546 - 547 - /** 548 533 * suspend_event - Return a "suspend" message for given "resume" one. 549 534 * @resume_msg: PM message representing a system-wide resume transition. 550 535 */ ··· 666 681 dev->power.is_noirq_suspended = false; 667 682 668 683 if (skip_resume) { 684 + /* Make the next phases of resume skip the device. */ 685 + dev->power.is_late_suspended = false; 686 + dev->power.is_suspended = false; 669 687 /* 670 688 * The device is going to be left in suspend, but it might not 671 689 * have been in runtime suspend before the system suspended, so ··· 677 689 * device again. 678 690 */ 679 691 pm_runtime_set_suspended(dev); 680 - dev_pm_skip_next_resume_phases(dev); 681 692 } 682 693 683 694 Out: ··· 1618 1631 */ 1619 1632 int dpm_suspend_end(pm_message_t state) 1620 1633 { 1621 - int error = dpm_suspend_late(state); 1634 + ktime_t starttime = ktime_get(); 1635 + int error; 1636 + 1637 + error = dpm_suspend_late(state); 1622 1638 if (error) 1623 - return error; 1639 + goto out; 1624 1640 1625 1641 error = dpm_suspend_noirq(state); 1626 - if (error) { 1642 + if (error) 1627 1643 dpm_resume_early(resume_event(state)); 1628 - return error; 1629 - } 1630 1644 1631 - return 0; 1645 + out: 1646 + dpm_show_time(starttime, state, error, "end"); 1647 + return error; 1632 1648 } 1633 1649 EXPORT_SYMBOL_GPL(dpm_suspend_end); 1634 1650 ··· 2024 2034 */ 2025 2035 int dpm_suspend_start(pm_message_t state) 2026 2036 { 2037 + ktime_t starttime = ktime_get(); 2027 2038 int error; 2028 2039 2029 2040 error = dpm_prepare(state); ··· 2033 2042 dpm_save_failed_step(SUSPEND_PREPARE); 2034 2043 } else 2035 2044 error = dpm_suspend(state); 2045 + dpm_show_time(starttime, state, error, "start"); 2036 2046 return error; 2037 2047 } 2038 2048 EXPORT_SYMBOL_GPL(dpm_suspend_start);
+2 -4
drivers/base/power/wakeup.c
··· 968 968 } 969 969 #endif /* CONFIG_PM_AUTOSLEEP */ 970 970 971 - static struct dentry *wakeup_sources_stats_dentry; 972 - 973 971 /** 974 972 * print_wakeup_source_stats - Print wakeup source statistics information. 975 973 * @m: seq_file to print the statistics into. ··· 1097 1099 1098 1100 static int __init wakeup_sources_debugfs_init(void) 1099 1101 { 1100 - wakeup_sources_stats_dentry = debugfs_create_file("wakeup_sources", 1101 - S_IRUGO, NULL, NULL, &wakeup_sources_stats_fops); 1102 + debugfs_create_file("wakeup_sources", S_IRUGO, NULL, NULL, 1103 + &wakeup_sources_stats_fops); 1102 1104 return 0; 1103 1105 } 1104 1106
+1 -1
drivers/input/serio/i8042.c
··· 1406 1406 * behavior on many platforms using suspend-to-RAM (ACPI S3) 1407 1407 * by default. 1408 1408 */ 1409 - if (pm_suspend_via_s2idle() && i == I8042_KBD_PORT_NO) 1409 + if (pm_suspend_default_s2idle() && i == I8042_KBD_PORT_NO) 1410 1410 device_set_wakeup_enable(&serio->dev, true); 1411 1411 } 1412 1412 }
+8 -35
drivers/pci/pci-driver.c
··· 1012 1012 } 1013 1013 1014 1014 /* 1015 - * This used to be done in pci_pm_prepare() for all devices and some 1016 - * drivers may depend on it, so do it here. Ideally, runtime-suspended 1017 - * devices should not be touched during freeze/thaw transitions, 1018 - * however. 1015 + * Resume all runtime-suspended devices before creating a snapshot 1016 + * image of system memory, because the restore kernel generally cannot 1017 + * be expected to always handle them consistently and they need to be 1018 + * put into the runtime-active metastate during system resume anyway, 1019 + * so it is better to ensure that the state saved in the image will be 1020 + * always consistent with that. 1019 1021 */ 1020 - if (!dev_pm_smart_suspend_and_suspended(dev)) { 1021 - pm_runtime_resume(dev); 1022 - pci_dev->state_saved = false; 1023 - } 1022 + pm_runtime_resume(dev); 1023 + pci_dev->state_saved = false; 1024 1024 1025 1025 if (pm->freeze) { 1026 1026 int error; ··· 1034 1034 return 0; 1035 1035 } 1036 1036 1037 - static int pci_pm_freeze_late(struct device *dev) 1038 - { 1039 - if (dev_pm_smart_suspend_and_suspended(dev)) 1040 - return 0; 1041 - 1042 - return pm_generic_freeze_late(dev); 1043 - } 1044 - 1045 1037 static int pci_pm_freeze_noirq(struct device *dev) 1046 1038 { 1047 1039 struct pci_dev *pci_dev = to_pci_dev(dev); 1048 1040 struct device_driver *drv = dev->driver; 1049 - 1050 - if (dev_pm_smart_suspend_and_suspended(dev)) 1051 - return 0; 1052 1041 1053 1042 if (pci_has_legacy_pm_support(pci_dev)) 1054 1043 return pci_legacy_suspend_late(dev, PMSG_FREEZE); ··· 1067 1078 struct pci_dev *pci_dev = to_pci_dev(dev); 1068 1079 struct device_driver *drv = dev->driver; 1069 1080 int error = 0; 1070 - 1071 - /* 1072 - * If the device is in runtime suspend, the code below may not work 1073 - * correctly with it, so skip that code and make the PM core skip all of 1074 - * the subsequent "thaw" callbacks for the device. 1075 - */ 1076 - if (dev_pm_smart_suspend_and_suspended(dev)) { 1077 - dev_pm_skip_next_resume_phases(dev); 1078 - return 0; 1079 - } 1080 1081 1081 1082 if (pcibios_pm_ops.thaw_noirq) { 1082 1083 error = pcibios_pm_ops.thaw_noirq(dev); ··· 1205 1226 struct device_driver *drv = dev->driver; 1206 1227 int error = 0; 1207 1228 1208 - /* This is analogous to the pci_pm_resume_noirq() case. */ 1209 - if (dev_pm_smart_suspend_and_suspended(dev)) 1210 - pm_runtime_set_active(dev); 1211 - 1212 1229 if (pcibios_pm_ops.restore_noirq) { 1213 1230 error = pcibios_pm_ops.restore_noirq(dev); 1214 1231 if (error) ··· 1254 1279 #else /* !CONFIG_HIBERNATE_CALLBACKS */ 1255 1280 1256 1281 #define pci_pm_freeze NULL 1257 - #define pci_pm_freeze_late NULL 1258 1282 #define pci_pm_freeze_noirq NULL 1259 1283 #define pci_pm_thaw NULL 1260 1284 #define pci_pm_thaw_noirq NULL ··· 1379 1405 .suspend_late = pci_pm_suspend_late, 1380 1406 .resume = pci_pm_resume, 1381 1407 .freeze = pci_pm_freeze, 1382 - .freeze_late = pci_pm_freeze_late, 1383 1408 .thaw = pci_pm_thaw, 1384 1409 .poweroff = pci_pm_poweroff, 1385 1410 .poweroff_late = pci_pm_poweroff_late,
+2 -12
include/linux/acpi.h
··· 913 913 #endif 914 914 915 915 #if defined(CONFIG_ACPI) && defined(CONFIG_PM_SLEEP) 916 - int acpi_dev_suspend_late(struct device *dev); 917 916 int acpi_subsys_prepare(struct device *dev); 918 917 void acpi_subsys_complete(struct device *dev); 919 918 int acpi_subsys_suspend_late(struct device *dev); 920 919 int acpi_subsys_suspend_noirq(struct device *dev); 921 - int acpi_subsys_resume_noirq(struct device *dev); 922 - int acpi_subsys_resume_early(struct device *dev); 923 920 int acpi_subsys_suspend(struct device *dev); 924 921 int acpi_subsys_freeze(struct device *dev); 925 - int acpi_subsys_freeze_late(struct device *dev); 926 - int acpi_subsys_freeze_noirq(struct device *dev); 927 - int acpi_subsys_thaw_noirq(struct device *dev); 922 + int acpi_subsys_poweroff(struct device *dev); 928 923 #else 929 - static inline int acpi_dev_resume_early(struct device *dev) { return 0; } 930 924 static inline int acpi_subsys_prepare(struct device *dev) { return 0; } 931 925 static inline void acpi_subsys_complete(struct device *dev) {} 932 926 static inline int acpi_subsys_suspend_late(struct device *dev) { return 0; } 933 927 static inline int acpi_subsys_suspend_noirq(struct device *dev) { return 0; } 934 - static inline int acpi_subsys_resume_noirq(struct device *dev) { return 0; } 935 - static inline int acpi_subsys_resume_early(struct device *dev) { return 0; } 936 928 static inline int acpi_subsys_suspend(struct device *dev) { return 0; } 937 929 static inline int acpi_subsys_freeze(struct device *dev) { return 0; } 938 - static inline int acpi_subsys_freeze_late(struct device *dev) { return 0; } 939 - static inline int acpi_subsys_freeze_noirq(struct device *dev) { return 0; } 940 - static inline int acpi_subsys_thaw_noirq(struct device *dev) { return 0; } 930 + static inline int acpi_subsys_poweroff(struct device *dev) { return 0; } 941 931 #endif 942 932 943 933 #ifdef CONFIG_ACPI
-1
include/linux/pm.h
··· 760 760 extern int pm_generic_poweroff(struct device *dev); 761 761 extern void pm_generic_complete(struct device *dev); 762 762 763 - extern void dev_pm_skip_next_resume_phases(struct device *dev); 764 763 extern bool dev_pm_may_skip_resume(struct device *dev); 765 764 extern bool dev_pm_smart_suspend_and_suspended(struct device *dev); 766 765
+1 -1
include/linux/pm_wakeup.h
··· 36 36 * @expire_count: Number of times the wakeup source's timeout has expired. 37 37 * @wakeup_count: Number of times the wakeup source might abort suspend. 38 38 * @active: Status of the wakeup source. 39 - * @has_timeout: The wakeup source has been activated with a timeout. 39 + * @autosleep_enabled: Autosleep is active, so update @prevent_sleep_time. 40 40 */ 41 41 struct wakeup_source { 42 42 const char *name;
+3 -2
include/linux/suspend.h
··· 304 304 return unlikely(s2idle_state == S2IDLE_STATE_ENTER); 305 305 } 306 306 307 - extern bool pm_suspend_via_s2idle(void); 307 + extern bool pm_suspend_default_s2idle(void); 308 308 extern void __init pm_states_init(void); 309 309 extern void s2idle_set_ops(const struct platform_s2idle_ops *ops); 310 310 extern void s2idle_wake(void); ··· 336 336 static inline void pm_set_resume_via_firmware(void) {} 337 337 static inline bool pm_suspend_via_firmware(void) { return false; } 338 338 static inline bool pm_resume_via_firmware(void) { return false; } 339 - static inline bool pm_suspend_via_s2idle(void) { return false; } 339 + static inline bool pm_suspend_default_s2idle(void) { return false; } 340 340 341 341 static inline void suspend_set_ops(const struct platform_suspend_ops *ops) {} 342 342 static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; } ··· 448 448 extern bool hibernation_available(void); 449 449 asmlinkage int swsusp_save(void); 450 450 extern struct pbe *restore_pblist; 451 + int pfn_is_nosave(unsigned long pfn); 451 452 #else /* CONFIG_HIBERNATION */ 452 453 static inline void register_nosave_region(unsigned long b, unsigned long e) {} 453 454 static inline void register_nosave_region_late(unsigned long b, unsigned long e) {}
-2
kernel/power/power.h
··· 75 75 static inline void hibernate_image_size_init(void) {} 76 76 #endif /* !CONFIG_HIBERNATION */ 77 77 78 - extern int pfn_is_nosave(unsigned long); 79 - 80 78 #define power_attr(_name) \ 81 79 static struct kobj_attribute _name##_attr = { \ 82 80 .attr = { \
+3 -3
kernel/power/suspend.c
··· 62 62 static DEFINE_RAW_SPINLOCK(s2idle_lock); 63 63 64 64 /** 65 - * pm_suspend_via_s2idle - Check if suspend-to-idle is the default suspend. 65 + * pm_suspend_default_s2idle - Check if suspend-to-idle is the default suspend. 66 66 * 67 67 * Return 'true' if suspend-to-idle has been selected as the default system 68 68 * suspend method. 69 69 */ 70 - bool pm_suspend_via_s2idle(void) 70 + bool pm_suspend_default_s2idle(void) 71 71 { 72 72 return mem_sleep_current == PM_SUSPEND_TO_IDLE; 73 73 } 74 - EXPORT_SYMBOL_GPL(pm_suspend_via_s2idle); 74 + EXPORT_SYMBOL_GPL(pm_suspend_default_s2idle); 75 75 76 76 void s2idle_set_ops(const struct platform_s2idle_ops *ops) 77 77 {
+1 -2
kernel/power/swap.c
··· 974 974 last = handle->maps = NULL; 975 975 offset = swsusp_header->image; 976 976 while (offset) { 977 - tmp = kmalloc(sizeof(*handle->maps), GFP_KERNEL); 977 + tmp = kzalloc(sizeof(*handle->maps), GFP_KERNEL); 978 978 if (!tmp) { 979 979 release_swap_reader(handle); 980 980 return -ENOMEM; 981 981 } 982 - memset(tmp, 0, sizeof(*tmp)); 983 982 if (!handle->maps) 984 983 handle->maps = tmp; 985 984 if (last)