Lines Matching +full:resume +full:- +full:offset
1 // SPDX-License-Identifier: GPL-2.0-only
3 * kernel/power/hibernate.c - Hibernation (a.k.a suspend-to-disk) support.
62 #define HIBERNATION_MAX (__HIBERNATION_AFTER_LAST-1)
75 return atomic_add_unless(&hibernate_atomic, -1, 0); in hibernate_acquire()
91 * hibernation_set_ops - Set the global hibernate operations.
98 if (ops && !(ops->begin && ops->end && ops->pre_snapshot in hibernation_set_ops()
99 && ops->prepare && ops->finish && ops->enter && ops->pre_restore in hibernation_set_ops()
100 && ops->restore_cleanup && ops->leave)) { in hibernation_set_ops()
145 * platform_begin - Call platform to start hibernation.
151 hibernation_ops->begin(PMSG_FREEZE) : 0; in platform_begin()
155 * platform_end - Call platform to finish transition to the working state.
161 hibernation_ops->end(); in platform_end()
165 * platform_pre_snapshot - Call platform to prepare the machine for hibernation.
175 hibernation_ops->pre_snapshot() : 0; in platform_pre_snapshot()
179 * platform_leave - Call platform to prepare a transition to the working state.
190 hibernation_ops->leave(); in platform_leave()
194 * platform_finish - Call platform to switch the system to the working state.
205 hibernation_ops->finish(); in platform_finish()
209 * platform_pre_restore - Prepare for hibernate image restoration.
212 * Use the platform driver to prepare the system for resume from a hibernation
221 hibernation_ops->pre_restore() : 0; in platform_pre_restore()
225 * platform_restore_cleanup - Switch to the working state after failing restore.
238 hibernation_ops->restore_cleanup(); in platform_restore_cleanup()
242 * platform_recover - Recover from a failure to suspend devices.
247 if (platform_mode && hibernation_ops && hibernation_ops->recover) in platform_recover()
248 hibernation_ops->recover(); in platform_recover()
252 * swsusp_show_speed - Print time elapsed between two events during hibernation.
271 centisecs = 1; /* avoid div-by-zero */ in swsusp_show_speed()
285 * create_image - Create a hibernation image.
351 /* Allow architectures to do nosmt-specific post-resume dances */ in create_image()
365 * hibernation_snapshot - Quiesce devices and create a hibernation image.
451 * resume_target_kernel - Restore system state from a hibernation image.
456 * the low-level code that will restore the remaining contents of memory and
465 pr_err("Some devices failed to power down, aborting resume\n"); in resume_target_kernel()
529 * hibernation_restore - Quiesce devices and restore from a hibernation image.
561 * hibernation_platform_enter - Power off the system using the platform driver.
568 return -ENOSYS; in hibernation_platform_enter()
572 * hibernation_ops->finish() before saving the image, so we should let in hibernation_platform_enter()
575 error = hibernation_ops->begin(PMSG_HIBERNATE); in hibernation_platform_enter()
583 if (hibernation_ops->recover) in hibernation_platform_enter()
584 hibernation_ops->recover(); in hibernation_platform_enter()
592 error = hibernation_ops->prepare(); in hibernation_platform_enter()
604 error = -EAGAIN; in hibernation_platform_enter()
608 hibernation_ops->enter(); in hibernation_platform_enter()
621 hibernation_ops->finish(); in hibernation_platform_enter()
631 hibernation_ops->end(); in hibernation_platform_enter()
637 * power_down - Shut the machine down for hibernation.
658 pr_err("Swap will be unusable! Try swapon -a.\n"); in power_down()
671 if (error == -EAGAIN || error == -EBUSY) { in power_down()
686 * corruption after resume. in power_down()
722 * hibernate - Carry out system hibernation, including saving the image.
732 return -EPERM; in hibernate()
738 error = -EBUSY; in hibernate()
816 * hibernate_quiet_exec - Execute a function with all devices frozen.
830 error = -EBUSY; in hibernate_quiet_exec()
916 return -ENOENT; in find_resume_device()
921 pr_info("Waiting %dsec before reading resume device ...\n", in find_resume_device()
960 error = -EBUSY; in software_resume()
965 pr_info("resume from hibernation\n"); in software_resume()
988 pr_info("resume failed (%d)\n", error); in software_resume()
1001 * software_resume_initcall - Resume from a saved hibernation image.
1046 * /sys/power/disk - Control hibernation mode.
1103 return buf-start; in disk_show()
1117 return -EPERM; in disk_store()
1120 len = p ? p - buf : n; in disk_store()
1144 error = -EINVAL; in disk_store()
1147 error = -EINVAL; in disk_store()
1177 if (len && buf[len-1] == '\n') in resume_store()
1178 len--; in resume_store()
1181 return -ENOMEM; in resume_store()
1185 unsigned maj, min, offset; in resume_store() local
1190 sscanf(name, "%u:%u:%u:%c", &maj, &min, &offset, in resume_store()
1194 error = -EINVAL; in resume_store()
1198 error = -EINVAL; in resume_store()
1209 pm_pr_dbg("Configured hibernation resume from disk to %u\n", in resume_store()
1216 power_attr(resume);
1228 unsigned long long offset; in resume_offset_store() local
1231 rc = kstrtoull(buf, 0, &offset); in resume_offset_store()
1234 swsusp_resume_block = offset; in resume_offset_store()
1257 return -EINVAL; in image_size_store()
1279 return -EINVAL; in reserved_size_store()
1318 unsigned long long offset; in resume_offset_setup() local
1323 if (sscanf(str, "%llu", &offset) == 1) in resume_offset_setup()
1324 swsusp_resume_block = offset; in resume_offset_setup()
1375 __setup("resume=", resume_setup);