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 5E2C8C433FE for ; Wed, 2 Nov 2022 03:32:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231204AbiKBDcn (ORCPT ); Tue, 1 Nov 2022 23:32:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231174AbiKBDcm (ORCPT ); Tue, 1 Nov 2022 23:32:42 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 374C02613B for ; Tue, 1 Nov 2022 20:32:42 -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 EDBC7B82063 for ; Wed, 2 Nov 2022 03:32:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF119C433C1; Wed, 2 Nov 2022 03:32:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1667359959; bh=KXT9Owt7K6y8POFgy36IytbcDlCUjllD2cAwnYgifWY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LNic2OvlDRy+kuOIgE45NFvgXN/qMEIiEuOfaL3xU+u43miQ90rva/3sevFXpgudV IdtFXLravGdO6jc98mHW6dIKiosGUjwCNViom2L7JBrbp9xeu0top+k25u9BrF+EK/ poSTmC1n15JkmTc+3AFXsyq4zQ3ibcwpQ3kfm5E8= 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 4.19 63/78] PM: hibernate: Allow hybrid sleep to work with s2idle Date: Wed, 2 Nov 2022 03:34:48 +0100 Message-Id: <20221102022054.803654731@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221102022052.895556444@linuxfoundation.org> References: <20221102022052.895556444@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 6abdfdf571ee..6737ae6ffbae 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c @@ -626,7 +626,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