From: Mario Limonciello <superm1@kernel.org>
To: mario.limonciello@amd.com, rafael@kernel.org,
len.brown@intel.com, pavel@kernel.org, guoqing.zhang@amd.com
Cc: Randy Dunlap <rdunlap@infradead.org>, linux-pm@vger.kernel.org
Subject: [PATCH] PM: hibernate: Add stub for pm_hibernate_is_recovering()
Date: Sat, 12 Jul 2025 13:58:49 -0500 [thread overview]
Message-ID: <20250712185851.591024-1-superm1@kernel.org> (raw)
From: Mario Limonciello <mario.limonciello@amd.com>
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()")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
include/linux/suspend.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 293137210fdf4..b4f1d1f781df6 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -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 */
--
2.43.0
next reply other threads:[~2025-07-12 18:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-12 18:58 Mario Limonciello [this message]
2025-07-12 21:44 ` [PATCH] PM: hibernate: Add stub for pm_hibernate_is_recovering() kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250712185851.591024-1-superm1@kernel.org \
--to=superm1@kernel.org \
--cc=guoqing.zhang@amd.com \
--cc=len.brown@intel.com \
--cc=linux-pm@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=pavel@kernel.org \
--cc=rafael@kernel.org \
--cc=rdunlap@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox