From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12E08C4332F for ; Wed, 2 Nov 2022 02:53:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230525AbiKBCxO (ORCPT ); Tue, 1 Nov 2022 22:53:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231137AbiKBCxK (ORCPT ); Tue, 1 Nov 2022 22:53:10 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00139222B1 for ; Tue, 1 Nov 2022 19:53:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 80523B8206C for ; Wed, 2 Nov 2022 02:53:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 692A7C433D6; Wed, 2 Nov 2022 02:53:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1667357584; bh=s93B14zjw80sMeP1UH3MlvnUC/h7MQClDHkQ8GML+9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T7RrpFNocDmVSCHtHKIYUDJ4WHOXITvIG2hZUQ65ThvSm6SWcqJgXnFKafKxV+nkU oXC/B8rBMlg5IcLA5pLfkyow+ipf/rbCMfj9/x6yZKNTK0sBIRooCNboViQxCE6UwC CIFSOIdWCnxZ21qOL3iY/E9rg7YS9wHx+iiXKXJ4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mario Limonciello , "Rafael J. Wysocki" , Sasha Levin , kolAflash Subject: [PATCH 6.0 195/240] PM: hibernate: Allow hybrid sleep to work with s2idle Date: Wed, 2 Nov 2022 03:32:50 +0100 Message-Id: <20221102022115.805533286@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221102022111.398283374@linuxfoundation.org> References: <20221102022111.398283374@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Mario Limonciello [ 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 Link: https://bugzilla.kernel.org/show_bug.cgi?id=216574 Signed-off-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- kernel/power/hibernate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index 89c71fce225d..537dd3beafc1 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c @@ -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 : -- 2.35.1