lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <68a8c1ba-275c-4908-a4c8-2e8b83367703@kernel.org>
Date: Tue, 21 Oct 2025 16:07:36 -0500
From: "Mario Limonciello (AMD) (kernel.org)" <superm1@...nel.org>
To: Muhammad Usama Anjum <usama.anjum@...labora.com>,
 "Rafael J. Wysocki" <rafael@...nel.org>, Len Brown <lenb@...nel.org>,
 Pavel Machek <pavel@...nel.org>,
 Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
 Danilo Krummrich <dakr@...nel.org>,
 Dmitry Torokhov <dmitry.torokhov@...il.com>,
 Thomas Gleixner <tglx@...utronix.de>, Peter Zijlstra <peterz@...radead.org>,
 linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
 linux-pm@...r.kernel.org, linux-input@...r.kernel.org
Cc: kernel@...labora.com
Subject: Re: [RFC 1/4] PM: hibernate: export hibernation_in_progress()



On 10/18/2025 9:21 AM, Muhammad Usama Anjum wrote:
> Export hibernation_in_progress() to be used by other modules. Add its
> signature when hibernation config isn't enabled as well.

I wonder if you actually want to have pm_sleep_transition_in_progress() 
exported instead.  "Logically" I would expect cancelling a hibernate and 
cancelling a suspend should work similarly.
> 
> Signed-off-by: Muhammad Usama Anjum <usama.anjum@...labora.com>
> ---
>   include/linux/suspend.h  | 2 ++
>   kernel/power/hibernate.c | 1 +
>   2 files changed, 3 insertions(+)
> 
> diff --git a/include/linux/suspend.h b/include/linux/suspend.h
> index b02876f1ae38a..348831cdb60e4 100644
> --- a/include/linux/suspend.h
> +++ b/include/linux/suspend.h
> @@ -393,6 +393,7 @@ extern void hibernation_set_ops(const struct platform_hibernation_ops *ops);
>   extern int hibernate(void);
>   extern bool system_entering_hibernation(void);
>   extern bool hibernation_available(void);
> +extern bool hibernation_in_progress(void);
>   asmlinkage int swsusp_save(void);
>   extern struct pbe *restore_pblist;
>   int pfn_is_nosave(unsigned long pfn);
> @@ -412,6 +413,7 @@ static inline void hibernation_set_ops(const struct platform_hibernation_ops *op
>   static inline int hibernate(void) { return -ENOSYS; }
>   static inline bool system_entering_hibernation(void) { return false; }
>   static inline bool hibernation_available(void) { return false; }
> +static inline bool hibernation_in_progress(void) { return false; }
>   
>   static inline int hibernate_quiet_exec(int (*func)(void *data), void *data) {
>   	return -ENOTSUPP;
> diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
> index 14e85ff235512..aadf82f57e868 100644
> --- a/kernel/power/hibernate.c
> +++ b/kernel/power/hibernate.c
> @@ -105,6 +105,7 @@ bool hibernation_in_progress(void)
>   {
>   	return !atomic_read(&hibernate_atomic);
>   }
> +EXPORT_SYMBOL_GPL(hibernation_in_progress);
>   
>   bool hibernation_available(void)
>   {


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ