Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp417936iog; Fri, 17 Jun 2022 06:08:31 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sm+ybCSw/NVS37tDieUhGO9k03441OqUUJ3U4ROrY0wxu/OLjAJYhJbhpwzB7LLzTUvD1Y X-Received: by 2002:a63:69c3:0:b0:40c:5e67:ffc0 with SMTP id e186-20020a6369c3000000b0040c5e67ffc0mr1369146pgc.383.1655471311509; Fri, 17 Jun 2022 06:08:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655471311; cv=none; d=google.com; s=arc-20160816; b=CZ1uzzihwZEHXY2nhj8oIKAg7zBlbGGy5mbGOEcq0Y3kx27bVBNwV5fOTRysPfbYNA rgjZ72iz2ArTe9WpS4OfX35LFGDqcKwPInUJEDOFgEW/Ij24KUm8y7QACTkk7DHoi4px RICKnQ2MO0frHgp5pG40JJnutm0O3Ed3DTaN78cHg457U1zAI1OqQbuail9FPdMx8Cda YkVVey/rpslQAk1jDGuH32qwc7BZAQU8t+cyUUBuGPVaCq32VADRe1wu9Qm4snSOaSp2 9SsmqAFy5LkUk8aK5x0bfC2ldqoFeC+jIVXZ/xhWzVD4usBk+JlTEnybicNHBEGTrBSv spHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=YmKstIo6txICGoY4oRihiSVzij8PbhHC1kGuFIt/4xE=; b=MF1LG7Yh/YPPXSi31WJslrhkzYjqL3p5fs2jbIxYdoctkex5CdWcG4HPOl9PWP9IpS cWYcQUd0EdT8i+Y+1wACfsde6gdWLQH01x8v2oVKFhETIyzzyaW0RRFRi6jHAK4hhwjk bV9RsXyI5UXAaf/HUWYuF1jGhfNsj/wXKjw5okCsc+t8eavejEFG3TgH60+HWlITUVsc AE7J8wJ27k10LgDkJFSOOSKtkvEZYFEUO2REQNkge4oS1IqfKvLbGltlbIRyBobcUYsY KPAOTpMxALP1ON7YJG3QbsJGghjCqACeGg5/LDbUAVrGExJDt0aUM65BpPDbwrl81s3n 5CUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="bRiz/GGK"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d75-20020a621d4e000000b0051c37a7cfddsi5612733pfd.282.2022.06.17.06.08.01; Fri, 17 Jun 2022 06:08:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="bRiz/GGK"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381868AbiFQMYe (ORCPT + 99 others); Fri, 17 Jun 2022 08:24:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381190AbiFQMYa (ORCPT ); Fri, 17 Jun 2022 08:24:30 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1CBE50B1E; Fri, 17 Jun 2022 05:24:29 -0700 (PDT) Received: from dimapc.. (109-252-136-92.dynamic.spd-mgts.ru [109.252.136.92]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dmitry.osipenko) by madras.collabora.co.uk (Postfix) with ESMTPSA id B571B660179A; Fri, 17 Jun 2022 13:24:27 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1655468668; bh=1lWpdp3cnfKdrU5D6f5ZdxAw3Yb16msYqFdidiHaCIw=; h=From:To:Cc:Subject:Date:From; b=bRiz/GGKtPMQSJnbjubjCyPewoA2RiugLa3pqAdwPuIfFFWSOo7cBlAQocAt0+oXQ vJZMlDbLX+3n12hDJad9m5/U0xfcS9Ivv0x7ONLYqDqt9+cY0DucX9bLS0tmoLH1ds FsRQMxdG7UTNSQVShMUjcEJiebtQGjKvHRh5WsteaA5dcPhQtMAsudtHKyLW3hbGEE 9UOJhzserUguEidfPBZW3PO4RGmiflvCt3LZo4CVboRuhRDJi8WjsDW5+p9bJDTDzv 9JyBgSsGun9p//BI0xrHom78ykBWkFP97fx2fgBiIzlOV9rg5yFsO6EPXhBtoXSEfH zOEk7kezN6P+g== From: Dmitry Osipenko To: "Rafael J . Wysocki" , Ken Moffat Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH v1] PM: hibernate: Use kernel_can_power_off() Date: Fri, 17 Jun 2022 15:24:02 +0300 Message-Id: <20220617122402.151782-1-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use new kernel_can_power_off() API instead of legacy pm_power_off global variable to fix regressed hibernation to disk where machine no longer powers off when it should because ACPI power driver transitioned to the new sys-off based API and it doesn't use pm_power_off anymore. Fixes: 98f30d0ecf79 ("ACPI: power: Switch to sys-off handler API") Tested-by: Ken Moffat Reported-by: Ken Moffat Signed-off-by: Dmitry Osipenko --- 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 20a66bf9f465..89c71fce225d 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c @@ -665,7 +665,7 @@ static void power_down(void) hibernation_platform_enter(); fallthrough; case HIBERNATION_SHUTDOWN: - if (pm_power_off) + if (kernel_can_power_off()) kernel_power_off(); break; } -- 2.35.3