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.
72 #define HIBERNATION_MAX (__HIBERNATION_AFTER_LAST-1)
85 return atomic_add_unless(&hibernate_atomic, -1, 0); in hibernate_acquire()
101 * hibernation_set_ops - Set the global hibernate operations.
108 if (ops && !(ops->begin && ops->end && ops->pre_snapshot in hibernation_set_ops()
109 && ops->prepare && ops->finish && ops->enter && ops->pre_restore in hibernation_set_ops()
110 && ops->restore_cleanup && ops->leave)) { in hibernation_set_ops()
155 * platform_begin - Call platform to start hibernation.
161 hibernation_ops->begin(PMSG_FREEZE) : 0; in platform_begin()
165 * platform_end - Call platform to finish transition to the working state.
171 hibernation_ops->end(); in platform_end()
175 * platform_pre_snapshot - Call platform to prepare the machine for hibernation.
185 hibernation_ops->pre_snapshot() : 0; in platform_pre_snapshot()
189 * platform_leave - Call platform to prepare a transition to the working state.
200 hibernation_ops->leave(); in platform_leave()
204 * platform_finish - Call platform to switch the system to the working state.
215 hibernation_ops->finish(); in platform_finish()
219 * platform_pre_restore - Prepare for hibernate image restoration.
222 * Use the platform driver to prepare the system for resume from a hibernation
231 hibernation_ops->pre_restore() : 0; in platform_pre_restore()
235 * platform_restore_cleanup - Switch to the working state after failing restore.
248 hibernation_ops->restore_cleanup(); in platform_restore_cleanup()
252 * platform_recover - Recover from a failure to suspend devices.
257 if (platform_mode && hibernation_ops && hibernation_ops->recover) in platform_recover()
258 hibernation_ops->recover(); in platform_recover()
262 * swsusp_show_speed - Print time elapsed between two events during hibernation.
281 centisecs = 1; /* avoid div-by-zero */ in swsusp_show_speed()
295 * create_image - Create a hibernation image.
361 /* Allow architectures to do nosmt-specific post-resume dances */ in create_image()
375 * hibernation_snapshot - Quiesce devices and create a hibernation image.
461 * resume_target_kernel - Restore system state from a hibernation image.
466 * the low-level code that will restore the remaining contents of memory and
475 pr_err("Some devices failed to power down, aborting resume\n"); in resume_target_kernel()
539 * hibernation_restore - Quiesce devices and restore from a hibernation image.
571 * hibernation_platform_enter - Power off the system using the platform driver.
578 return -ENOSYS; in hibernation_platform_enter()
582 * hibernation_ops->finish() before saving the image, so we should let in hibernation_platform_enter()
585 error = hibernation_ops->begin(PMSG_HIBERNATE); in hibernation_platform_enter()
593 if (hibernation_ops->recover) in hibernation_platform_enter()
594 hibernation_ops->recover(); in hibernation_platform_enter()
602 error = hibernation_ops->prepare(); in hibernation_platform_enter()
618 error = -EAGAIN; in hibernation_platform_enter()
622 hibernation_ops->enter(); in hibernation_platform_enter()
636 hibernation_ops->finish(); in hibernation_platform_enter()
646 hibernation_ops->end(); in hibernation_platform_enter()
652 * power_down - Shut the machine down for hibernation.
673 pr_err("Swap will be unusable! Try swapon -a.\n"); in power_down()
686 if (error == -EAGAIN || error == -EBUSY) { in power_down()
704 * corruption after resume. in power_down()
743 * hibernate - Carry out system hibernation, including saving the image.
753 return -EPERM; in hibernate()
763 return -EOPNOTSUPP; in hibernate()
770 error = -EBUSY; in hibernate()
861 * hibernate_quiet_exec - Execute a function with all devices frozen.
875 error = -EBUSY; in hibernate_quiet_exec()
961 return -ENOENT; in find_resume_device()
966 pr_info("Waiting %dsec before reading resume device ...\n", in find_resume_device()
1014 error = -EOPNOTSUPP; in software_resume()
1021 error = -EBUSY; in software_resume()
1026 pr_info("resume from hibernation\n"); in software_resume()
1049 pr_info("resume failed (%d)\n", error); in software_resume()
1062 * software_resume_initcall - Resume from a saved hibernation image.
1107 * /sys/power/disk - Control hibernation mode.
1166 buf[count - 1] = '\n'; in disk_show()
1182 return -EPERM; in disk_store()
1185 len = p ? p - buf : n; in disk_store()
1209 error = -EINVAL; in disk_store()
1212 error = -EINVAL; in disk_store()
1242 if (len && buf[len-1] == '\n') in resume_store()
1243 len--; in resume_store()
1246 return -ENOMEM; in resume_store()
1250 unsigned maj, min, offset; in resume_store() local
1255 sscanf(name, "%u:%u:%u:%c", &maj, &min, &offset, in resume_store()
1259 error = -EINVAL; in resume_store()
1263 error = -EINVAL; in resume_store()
1274 pm_pr_dbg("Configured hibernation resume from disk to %u\n", in resume_store()
1281 power_attr(resume);
1293 unsigned long long offset; in resume_offset_store() local
1296 rc = kstrtoull(buf, 0, &offset); in resume_offset_store()
1299 swsusp_resume_block = offset; in resume_offset_store()
1322 return -EINVAL; in image_size_store()
1344 return -EINVAL; in reserved_size_store()
1383 unsigned long long offset; in resume_offset_setup() local
1388 if (sscanf(str, "%llu", &offset) == 1) in resume_offset_setup()
1389 swsusp_resume_block = offset; in resume_offset_setup()
1453 return -EBUSY; in hibernate_compressor_param_set()
1491 __setup("resume=", resume_setup);