Skip to content

Commit 03ac6a1

Browse files
committed
PM: hibernate: Add stub for pm_hibernate_is_recovering()
JIRA: https://issues.redhat.com/browse/RHEL-113576 commit a6cfa4c Author: Mario Limonciello <mario.limonciello@amd.com> Date: Sat Jul 12 18:37:12 2025 -0500 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: c2aaddb ("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> Signed-off-by: José Expósito <jexposit@redhat.com>
1 parent 69fccb3 commit 03ac6a1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

include/linux/suspend.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,8 +483,6 @@ int is_hibernate_resume_dev(dev_t dev);
483483
static inline int is_hibernate_resume_dev(dev_t dev) { return 0; }
484484
#endif
485485

486-
bool pm_hibernate_is_recovering(void);
487-
488486
/* Hibernation and suspend events */
489487
#define PM_HIBERNATION_PREPARE 0x0001 /* Going to hibernate */
490488
#define PM_POST_HIBERNATION 0x0002 /* Hibernation finished */
@@ -534,6 +532,8 @@ extern void pm_print_active_wakeup_sources(void);
534532
extern unsigned int lock_system_sleep(void);
535533
extern void unlock_system_sleep(unsigned int);
536534

535+
bool pm_hibernate_is_recovering(void);
536+
537537
#else /* !CONFIG_PM_SLEEP */
538538

539539
static inline int register_pm_notifier(struct notifier_block *nb)
@@ -562,6 +562,8 @@ static inline void pm_system_irq_wakeup(unsigned int irq_number) {}
562562
static inline unsigned int lock_system_sleep(void) { return 0; }
563563
static inline void unlock_system_sleep(unsigned int flags) {}
564564

565+
static inline bool pm_hibernate_is_recovering(void) { return false; }
566+
565567
#endif /* !CONFIG_PM_SLEEP */
566568

567569
#ifdef CONFIG_PM_SLEEP_DEBUG

0 commit comments

Comments
 (0)