]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
PM: hibernate: Allow hybrid sleep to work with s2idle
authorMario Limonciello <mario.limonciello@amd.com>
Thu, 13 Oct 2022 03:50:17 +0000 (22:50 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Nov 2022 15:00:31 +0000 (00:00 +0900)
[ Upstream commit 85850af4fc47132f3f2f0dd698b90f67906600b4 ]

Hybrid sleep is currently hardcoded to only operate with S3 even
on systems that might not support it.

Instead of assuming this mode is what the user wants to use, for
hybrid sleep follow the setting of `mem_sleep_current` which
will respect mem_sleep_default kernel command line and policy
decisions made by the presence of the FADT low power idle bit.

Fixes: 81d45bdf8913 ("PM / hibernate: Untangle power_down()")
Reported-and-tested-by: kolAflash <kolAflash@kolahilft.de>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216574
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/power/hibernate.c

index 89c71fce225dd7a70c7fe7b30f81d7e0f644bf3a..537dd3beafc16c746877755dcfce6a3007e86464 100644 (file)
@@ -641,7 +641,7 @@ static void power_down(void)
        int error;
 
        if (hibernation_mode == HIBERNATION_SUSPEND) {
-               error = suspend_devices_and_enter(PM_SUSPEND_MEM);
+               error = suspend_devices_and_enter(mem_sleep_current);
                if (error) {
                        hibernation_mode = hibernation_ops ?
                                                HIBERNATION_PLATFORM :