Merge cpuidle updates, PM core updates and one hiberation-related update for 5.17-rc1: - Make cpuidle use default_groups in kobj_type (Greg Kroah-Hartman). - Fix two comments in cpuidle code (Jason Wang, Yang Li). - Simplify locking in pm_runtime_put_suppliers() (Rafael Wysocki). - Add safety net to supplier device release in the runtime PM core code (Rafael Wysocki). - Capture device status before disabling runtime PM for it (Rafael Wysocki). - Add new macros for declaring PM operations to allow drivers to avoid guarding them with CONFIG_PM #ifdefs or __maybe_unused and update some drivers to use these macros (Paul Cercueil). - Allow ACPI hardware signature to be honoured during restore from hibernation (David Woodhouse). * pm-cpuidle: cpuidle: use default_groups in kobj_type cpuidle: Fix cpuidle_remove_state_sysfs() kerneldoc comment cpuidle: menu: Fix typo in a comment * pm-core: PM: runtime: Simplify locking in pm_runtime_put_suppliers() mmc: mxc: Use the new PM macros mmc: jz4740: Use the new PM macros PM: runtime: Add safety net to supplier device release PM: runtime: Capture device status before disabling runtime PM PM: core: Add new *_PM_OPS macros, deprecate old ones PM: core: Redefine pm_ptr() macro r8169: Avoid misuse of pm_ptr() macro * pm-sleep: PM: hibernate: Allow ACPI hardware signature to be honoured
Showing the changes to kernel (2 of 17 files). Show all
Unified · Split
| @@ -170,6 +170,7 @@ extern int swsusp_swap_in_use(void); · 169 unmodified lines | ||
| 170 | 170 | #define SF_PLATFORM_MODE 1 |
| 171 | 171 | #define SF_NOCOMPRESS_MODE 2 |
| 172 | 172 | #define SF_CRC32_MODE 4 |
| 173 | +#define SF_HW_SIG 8 | |
| 173 | 174 | |
| 174 | 175 | /* kernel/power/hibernate.c */ |
| 175 | 176 | extern int swsusp_check(void); |
| @@ -36,6 +36,8 @@ · 35 unmodified lines | ||
| 36 | 36 | |
| 37 | 37 | #define HIBERNATE_SIG "S1SUSPEND" |
| 38 | 38 | |
| 39 | +u32 swsusp_hardware_signature; | |
| 40 | + | |
| 39 | 41 | /* |
| 40 | 42 | * When reading an {un,}compressed image, we may restore pages in place, |
| 41 | 43 | * in which case some architectures need these pages cleaning before they |
| @@ -104,7 +106,8 @@ struct swap_map_handle { · 62 unmodified lines | ||
| 104 | 106 | |
| 105 | 107 | struct swsusp_header { |
| 106 | 108 | char reserved[PAGE_SIZE - 20 - sizeof(sector_t) - sizeof(int) - |
| 107 | − sizeof(u32)]; | |
| 109 | + sizeof(u32) - sizeof(u32)]; | |
| 110 | + u32 hw_sig; | |
| 108 | 111 | u32 crc32; |
| 109 | 112 | sector_t image; |
| 110 | 113 | unsigned int flags; /* Flags to pass to the "boot" kernel */ |
| @@ -312,7 +315,6 @@ static int hib_wait_io(struct hib_bio_batch *hb) · 201 unmodified lines | ||
| 312 | 315 | /* |
| 313 | 316 | * Saving part |
| 314 | 317 | */ |
| 315 | − | |
| 316 | 318 | static int mark_swapfiles(struct swap_map_handle *handle, unsigned int flags) |
| 317 | 319 | { |
| 318 | 320 | int error; |
| @@ -324,6 +326,10 @@ static int mark_swapfiles(struct swap_map_handle *handle, unsigned int flags) · 5 unmodified lines | ||
| 324 | 326 | memcpy(swsusp_header->orig_sig,swsusp_header->sig, 10); |
| 325 | 327 | memcpy(swsusp_header->sig, HIBERNATE_SIG, 10); |
| 326 | 328 | swsusp_header->image = handle->first_sector; |
| 329 | + if (swsusp_hardware_signature) { | |
| 330 | + swsusp_header->hw_sig = swsusp_hardware_signature; | |
| 331 | + flags |= SF_HW_SIG; | |
| 332 | + } | |
| 327 | 333 | swsusp_header->flags = flags; |
| 328 | 334 | if (flags & SF_CRC32_MODE) |
| 329 | 335 | swsusp_header->crc32 = handle->crc32; |
| @@ -1537,6 +1543,12 @@ int swsusp_check(void) · 1207 unmodified lines | ||
| 1537 | 1543 | } else { |
| 1538 | 1544 | error = -EINVAL; |
| 1539 | 1545 | } |
| 1546 | + if (!error && swsusp_header->flags & SF_HW_SIG && | |
| 1547 | + swsusp_header->hw_sig != swsusp_hardware_signature) { | |
| 1548 | + pr_info("Suspend image hardware signature mismatch (%08x now %08x); aborting resume.\n", | |
| 1549 | + swsusp_header->hw_sig, swsusp_hardware_signature); | |
| 1550 | + error = -EINVAL; | |
| 1551 | + } | |
| 1540 | 1552 | |
| 1541 | 1553 | put: |
| 1542 | 1554 | if (error) |