PM: hibernate: Add stub for pm_hibernate_is_recovering()
Subsystems (2)
PATCH 1/1 PM: hibernate: Add stub for pm_hibernate_is_recovering()
From: Mario Limonciello <[email protected]>
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.
--- include/linux/suspend.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/linux/suspend.h +2 -1
@@ -401,6 +401,7 @@ int hibernate_quiet_exec(int (*func)(void *data), void *data);int hibernate_resume_nonboot_cpu_disable (void );int arch_hibernation_header_save (void *addr,unsigned int max_size);int arch_hibernation_header_restore (void *addr); +bool pm_hibernate_is_recovering (void );#else /* CONFIG_HIBERNATION */ static inline void register_nosave_region (unsigned long b,unsigned long e) {}
@@ -416,6 +417,7 @@ static inline bool hibernation_available(void) { return false; }static inline int hibernate_quiet_exec (int (*func)(void *data),void *data) {return -ENOTSUPP ; } +static inline bool pm_hibernate_is_recovering (void ) {return false; }#endif /* CONFIG_HIBERNATION */ int arch_resume_nosmt (void );
@@ -426,7 +428,6 @@ int is_hibernate_resume_dev(dev_t dev);static inline int is_hibernate_resume_dev (dev_t dev) {return 0 ; }#endif -bool pm_hibernate_is_recovering (void );/* Hibernation and suspend events */ #define PM_HIBERNATION_PREPARE 0x0001/* Going to hibernate */
Signature · 1 line
2.43.0
kernel test robot
build botkernel test robot noticed the following build errors:
Hi Mario,
kernel test robot noticed the following build errors:
[auto build test ERROR on linux-next/master]
[cannot apply to linus/master v6.16-rc5]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Mario-Limonciello/PM-hibernate-Add-stub-for-pm_hibernate_is_recovering/20250713-025938 base: linux-next/master patch link: https://lore.kernel.org/r/20250712185851.591024-1-superm1%40kernel.org patch subject: [PATCH] PM: hibernate: Add stub for pm_hibernate_is_recovering() config: i386-buildonly-randconfig-003-20250713 (https://download.01.org/0day-ci/archive/20250713/[email protected]/config) compiler: gcc-12 (Debian 12.2.0-14+deb12u1) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250713/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
>> drivers/base/power/main.c:77:6: error: redefinition of 'pm_hibernate_is_recovering'
77 | bool pm_hibernate_is_recovering(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/base/power/main.c:32:
include/linux/suspend.h:420:20: note: previous definition of 'pm_hibernate_is_recovering' with type 'bool(void)' {aka '_Bool(void)'}
420 | static inline bool pm_hibernate_is_recovering(void) { return false; }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~vim +/pm_hibernate_is_recovering +77 drivers/base/power/main.c
098dff738abbea Rafael J. Wysocki 2010-09-22 68
c2aaddbd2deded Samuel Zhang 2025-07-10 69 /**
c2aaddbd2deded Samuel Zhang 2025-07-10 70 * pm_hibernate_is_recovering - if recovering from hibernate due to error.
c2aaddbd2deded Samuel Zhang 2025-07-10 71 *
c2aaddbd2deded Samuel Zhang 2025-07-10 72 * Used to query if dev_pm_ops.thaw() is called for normal hibernation case or
c2aaddbd2deded Samuel Zhang 2025-07-10 73 * recovering from some error.
c2aaddbd2deded Samuel Zhang 2025-07-10 74 *
c2aaddbd2deded Samuel Zhang 2025-07-10 75 * Return: true for error case, false for normal case.
c2aaddbd2deded Samuel Zhang 2025-07-10 76 */
c2aaddbd2deded Samuel Zhang 2025-07-10 @77 bool pm_hibernate_is_recovering(void)
c2aaddbd2deded Samuel Zhang 2025-07-10 78 {
c2aaddbd2deded Samuel Zhang 2025-07-10 79 return pm_transition.event == PM_EVENT_RECOVER;
c2aaddbd2deded Samuel Zhang 2025-07-10 80 }
c2aaddbd2deded Samuel Zhang 2025-07-10 81 EXPORT_SYMBOL_GPL(pm_hibernate_is_recovering);
c2aaddbd2deded Samuel Zhang 2025-07-10 82 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki