Lines Matching +full:needs +full:- +full:reset +full:- +full:on +full:- +full:resume
1 // SPDX-License-Identifier: GPL-2.0-only
5 * Derived from work on ARM hibernation support by:
7 * Ubuntu project, hibernation support for mach-dove
38 * Hibernate core relies on this value being 0 on resume, and marks it
39 * __nosavedata assuming it will keep the resume kernel's '0' value. This
47 /* Do we need to reset el2? */
50 /* hyp-stub vectors, used to restore el2 during resume from hibernate. */
54 * The logical cpu number we should resume on, initialised to a non-cpu
57 static int sleep_cpu = -EINVAL;
60 * Values that may not change over hibernate/resume. We put the build number
61 * and date in here so that we guarantee not to resume with a different
78 * re-configure el2.
88 memcpy(i->uts_version, init_utsname()->version, sizeof(i->uts_version)); in arch_hdr_invariants()
94 unsigned long nosave_end_pfn = sym_to_pfn(&__nosave_end - 1); in pfn_is_nosave()
113 return -EOVERFLOW; in arch_hibernation_header_save()
115 arch_hdr_invariants(&hdr->invariants); in arch_hibernation_header_save()
116 hdr->ttbr1_el1 = __pa_symbol(swapper_pg_dir); in arch_hibernation_header_save()
117 hdr->reenter_kernel = _cpu_resume; in arch_hibernation_header_save()
121 hdr->__hyp_stub_vectors = __pa_symbol(__hyp_stub_vectors); in arch_hibernation_header_save()
123 hdr->__hyp_stub_vectors = 0; in arch_hibernation_header_save()
125 /* Save the mpidr of the cpu we called cpu_suspend() on... */ in arch_hibernation_header_save()
127 pr_err("Failing to hibernate on an unknown CPU.\n"); in arch_hibernation_header_save()
128 return -ENODEV; in arch_hibernation_header_save()
130 hdr->sleep_cpu_mpidr = cpu_logical_map(sleep_cpu); in arch_hibernation_header_save()
131 pr_info("Hibernating on CPU %d [mpidr:0x%llx]\n", sleep_cpu, in arch_hibernation_header_save()
132 hdr->sleep_cpu_mpidr); in arch_hibernation_header_save()
145 if (memcmp(&hdr->invariants, &invariants, sizeof(invariants))) { in arch_hibernation_header_restore()
147 return -EINVAL; in arch_hibernation_header_restore()
150 sleep_cpu = get_logical_index(hdr->sleep_cpu_mpidr); in arch_hibernation_header_restore()
151 pr_info("Hibernated on CPU %d [mpidr:0x%llx]\n", sleep_cpu, in arch_hibernation_header_restore()
152 hdr->sleep_cpu_mpidr); in arch_hibernation_header_restore()
154 pr_crit("Hibernated on a CPU not known to this kernel!\n"); in arch_hibernation_header_restore()
155 sleep_cpu = -EINVAL; in arch_hibernation_header_restore()
156 return -EINVAL; in arch_hibernation_header_restore()
161 sleep_cpu = -EINVAL; in arch_hibernation_header_restore()
181 * This is used by hibernate to copy the code it needs to execute when
185 * Length is provided as we probably only want 4K of data, even on a 64K
202 return -ENOMEM; in create_safe_exec_page()
226 return -ENOMEM; in save_tags()
267 for (pfn = zone->zone_start_pfn; pfn < max_zone_pfn; pfn++) { in swsusp_mte_save_tags()
341 return -EBUSY; in swsusp_arch_suspend()
383 sleep_cpu = -EINVAL; in swsusp_arch_suspend()
400 * Setup then Resume from the hibernate image using swsusp_arch_suspend_exit().
430 * We need a zero page that is zero before & after resume in order in swsusp_arch_resume()
431 * to break before make on the ttbr1 page tables. in swsusp_arch_resume()
436 return -ENOMEM; in swsusp_arch_resume()
447 exit_size = __hibernate_exit_text_end - __hibernate_exit_text_start; in swsusp_arch_resume()
478 pr_err("Failing to resume from hibernate on an unknown CPU.\n"); in hibernate_resume_nonboot_cpu_disable()
479 return -ENODEV; in hibernate_resume_nonboot_cpu_disable()