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

Configure Feed

Select the types of activity you want to include in your feed.

PM: hibernate: Add stub for pm_hibernate_is_recovering()

Randy reports that amdgpu fails to compile with the following error:
ERROR: modpost: "pm_hibernate_is_recovering" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!

This happens because pm_hibernate_is_recovering() is only compiled when
CONFIG_PM_SLEEP is set. Add a stub for it so that drivers don't need
to depend upon CONFIG_PM.

Cc: Samuel Zhang <guoqing.zhang@amd.com>
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Closes: https://lore.kernel.org/dri-devel/CAJZ5v0h1CX+aTu7dFy6vB-9LM6t5J4rt7Su3qVnq1xx-BFAm=Q@mail.gmail.com/T/#m2b9fe212b35fde11d58fcbc4e0727bc02ebba7b0
Fixes: c2aaddbd2dede ("PM: hibernate: add new api pm_hibernate_is_recovering()")
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Link: https://lore.kernel.org/r/20250712233715.821424-1-superm1@kernel.org
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>

+2 -2
+2 -2
include/linux/suspend.h
··· 426 426 static inline int is_hibernate_resume_dev(dev_t dev) { return 0; } 427 427 #endif 428 428 429 - bool pm_hibernate_is_recovering(void); 430 - 431 429 /* Hibernation and suspend events */ 432 430 #define PM_HIBERNATION_PREPARE 0x0001 /* Going to hibernate */ 433 431 #define PM_POST_HIBERNATION 0x0002 /* Hibernation finished */ ··· 476 478 extern void unlock_system_sleep(unsigned int); 477 479 478 480 extern bool pm_sleep_transition_in_progress(void); 481 + bool pm_hibernate_is_recovering(void); 479 482 480 483 #else /* !CONFIG_PM_SLEEP */ 481 484 ··· 507 508 static inline void unlock_system_sleep(unsigned int flags) {} 508 509 509 510 static inline bool pm_sleep_transition_in_progress(void) { return false; } 511 + static inline bool pm_hibernate_is_recovering(void) { return false; } 510 512 511 513 #endif /* !CONFIG_PM_SLEEP */ 512 514