Re: [RFC 1/4] PM: hibernate: export hibernation_in_progress()

From: Rafael J. Wysocki

Date: Wed Oct 22 2025 - 05:53:31 EST


On Tue, Oct 21, 2025 at 11:07 PM Mario Limonciello (AMD) (kernel.org)
<superm1@xxxxxxxxxx> wrote:
>
>
>
> 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.

Well, it does AFAICS, except that only the "freeze" and "poweroff"
transitions can be aborted during hibernation. This is analogous to
aborting a suspend transition.

The missing part is a mechanism to cancel hibernation between image
creation and the "poweroff" transition.