Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp702300imi; Thu, 21 Jul 2022 09:15:59 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t0E/yWmQwiMO+1t94DDuK/nEx9YJh5tVn9GhuPKqP63+lz40uaAFBhavfDQI8N1BR20Lr8 X-Received: by 2002:a05:6402:31f7:b0:43b:ca75:cb4 with SMTP id dy23-20020a05640231f700b0043bca750cb4mr1811469edb.383.1658420158928; Thu, 21 Jul 2022 09:15:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658420158; cv=none; d=google.com; s=arc-20160816; b=ze0kg4FgUlXclhafrUqmaFiCRHfyZArh3XpzEoeAnC3oKBcn7YMHEZubJT6ENjMLKC UQ8JnteMXmtib+yZRJ7Whf7polaEd+PYpCi8s5aYNLwU4SPWDsCvLYHRLzf8srpYkodb 5/FLuAKgqzopWLLKQhgPJxh5DhnOS9RiTIU10unG4ZQyYgLIPdI1yaUamlACEbDeFz/0 nvPoKcfyRKVG1c7GCRK5gqLE6Rm79vyorWgfkGzlCccbX5QbPBLETSxo4iGAOta+b+t1 /OsgQnAcpch+XA7q+js4ma6L01fLBcyDFBxo5RwTOVQK62+TI97nFrP4rS+xr/npn1eA SMtA== 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; bh=9VO+WKbpdKUtyRvSB34119rxWVEqYztFI5D9+qJQeMk=; b=lOcmdqh+YnOBm7yz2eVDwPWUUSSmIj5uhhETOwkM262bx2rSoPlyWTW4zXGVmx5QTP EtoAXMDE7g51PBdm4Mb1NSkKi9VxKzWES4xH/Hw88iqdWdbECLaAi0uU9k/2PBlJS0yF BfhtnOAzyzrkorXOzIs0fjbPRFxGuQbj28SBqbSqrKm6BXxnRhw2XfhTUP3iR2mwyGUZ shGkN4+eITe7fyy1H+8pbFCyiV8xarEu3tPtsn1Ul8n3dLxljykA3e9TbSRu/ouoM4fp cOb0PKLeYaneFy0z6+8F1gltKt6Rwjej0nAd1oX88+iedlmhglmY7v6xoPHOVqLMrFhF yUug== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g3-20020a056402424300b0043bbccdd9efsi3335037edb.487.2022.07.21.09.15.31; Thu, 21 Jul 2022 09:15:58 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229915AbiGUQOC (ORCPT + 99 others); Thu, 21 Jul 2022 12:14:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233635AbiGUQNw (ORCPT ); Thu, 21 Jul 2022 12:13:52 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B9B788E28; Thu, 21 Jul 2022 09:13:42 -0700 (PDT) Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.0.0) id 391fc89340d9f6bb; Thu, 21 Jul 2022 18:13:32 +0200 Received: from kreacher.localnet (unknown [213.134.181.148]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id 72E7866CD18; Thu, 21 Jul 2022 18:13:31 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Linux PM , Zhang Rui , Srinivas Pandruvada , Len Brown , Mario Limonciello Subject: [PATCH] ACPI: PM: x86: Print messages regarding LPS0 idle support Date: Thu, 21 Jul 2022 18:13:30 +0200 Message-ID: <12039470.O9o76ZdvQC@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.181.148 X-CLIENT-HOSTNAME: 213.134.181.148 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrudelkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpeffffffkefgheehffelteeiveeffeevhfelteejvddvieejjeelvdeiheeuveeuffenucfkphepvddufedrudefgedrudekuddrudegkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvudefrddufeegrddukedurddugeekpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeejpdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqphhmsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprhhuihdriihhrghnghesihhnthgvlhdrtghomhdprhgtphhtthhopehsrhhi nhhivhgrshdrphgrnhgurhhuvhgruggrsehlihhnuhigrdhinhhtvghlrdgtohhmpdhrtghpthhtoheplhgvnhgssehkvghrnhgvlhdrohhrghdprhgtphhtthhopehmrghrihhordhlihhmohhntghivghllhhosegrmhgurdgtohhm X-DCC--Metrics: v370.home.net.pl 1024; Body=7 Fuz1=7 Fuz2=7 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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 From: Rafael J. Wysocki Because suspend-to-idle is always supported and on x86 it is the only way to suspend the system if S3 is not supported by the platform, the kernel attempts to enter low-power S0 idle in the suspend-to-idle flow regardless of whether or not the ACPI_FADT_LOW_POWER_S0 flag is set in the FADT. However, if that flag is not set, residency counters associated with low-power S0 idle may not count and the platform may refuse to put the EC into a low-power mode, for example. For this reason, print diagnostic messages when the platform should achieve significant energy savings in low-power S0 idle (because the ACPI_FADT_LOW_POWER_S0 flag is set in the FADT) and when suspend-to-idle becomes the default suspend method (because low-power S0 idle should be equally or more efficient than S3, if available). Signed-off-by: Rafael J. Wysocki --- drivers/acpi/sleep.c | 3 +++ drivers/acpi/x86/s2idle.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) Index: linux-pm/drivers/acpi/sleep.c =================================================================== --- linux-pm.orig/drivers/acpi/sleep.c +++ linux-pm/drivers/acpi/sleep.c @@ -824,6 +824,9 @@ static const struct platform_s2idle_ops void __weak acpi_s2idle_setup(void) { + if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) + pr_info("Efficient low-power S0 idle declared\n"); + s2idle_set_ops(&acpi_s2idle_ops); } Index: linux-pm/drivers/acpi/x86/s2idle.c =================================================================== --- linux-pm.orig/drivers/acpi/x86/s2idle.c +++ linux-pm/drivers/acpi/x86/s2idle.c @@ -423,8 +423,10 @@ static int lps0_device_attach(struct acp * line. */ if ((acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) && - mem_sleep_default > PM_SUSPEND_MEM && !acpi_sleep_default_s3) + mem_sleep_default > PM_SUSPEND_MEM && !acpi_sleep_default_s3) { mem_sleep_current = PM_SUSPEND_TO_IDLE; + pr_info("Low-power S0 idle used by default for system suspend\n"); + } /* * Some LPS0 systems, like ASUS Zenbook UX430UNR/i7-8550U, require the