Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp902172rwe; Wed, 24 Aug 2022 10:57:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR73fOJiMyG3eEeuWXpjjf8yAZA2+1d5mGM1mthxWaAEEuydT5WLi+oByCnj37YmCNBkPRdM X-Received: by 2002:a05:6402:2945:b0:446:1144:f1aa with SMTP id ed5-20020a056402294500b004461144f1aamr154660edb.79.1661363822352; Wed, 24 Aug 2022 10:57:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661363822; cv=none; d=google.com; s=arc-20160816; b=GRWfV/r2LoBZkMUhsySrTqlTRE6UAHnqLu8gyNrtHVL7Cf+WvNzOM10HXv5JigpMmX OB37Q1xHnAur04DrIIyHJly3512v/0w9jLIku36WC+nL268ui++H0hUdi1LgB90/TilK b88HluyaO18RkhJlZEXerexRdSV/+b+AfPUHTmqdZ9blkr+k5+X7hU7slA3aC8/xr1zI nWj5JELLRT9QQUuW9Wh6+XHhcAe6A4iFxEeV4bLy9Iji5LQ8rWWll/W1Ewg4s06JLAp+ hbxhzjjtB0vqzSf6+RzMii06M2CHX1KCtGzXBX/N1qLBtYAob7rnclEor6DOCcsjwnjP EdYA== 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=Z+voQ57DhJqtZ7/5RYnjv+eWpqatsqFqdIf++0Y+s4Y=; b=Cs5tE8vsHfq24wwHOdzSCQ4NFdgQiYBws6UfofT5qaHglAt+t4Vvu/afLs2kPdr3Ap T5e2qIlVSYiwLP3D6RUXJdGsT2z9YcqYQLISc6ScSGI+xzh2tZihlkF6go3wKMhAwIM7 aPcFTuaWRpVHL7OEWzJAu1NUSiQN2gK6gm/CmEwCT//ur0knS8iotfFjS8c0MLEYW6HG pidnDWds2QZIKAzUGbMuiY6K1kiG1NVwaGItgxQdQP4wtvHmg0RShJDW9XQsLPVHbG5S bl5vXWLpzWfpLaMR+OFSPkLZp56zrBxw09JjDzWqaZgyrMzd1icwNjGy61qvq0UDOidg qnkg== 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 js7-20020a17090797c700b0072f38ecf74asi2748988ejc.794.2022.08.24.10.56.36; Wed, 24 Aug 2022 10:57:02 -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 S238474AbiHXR33 (ORCPT + 99 others); Wed, 24 Aug 2022 13:29:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239141AbiHXR31 (ORCPT ); Wed, 24 Aug 2022 13:29:27 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 302697CABD; Wed, 24 Aug 2022 10:29:26 -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 2e5623db8190bb58; Wed, 24 Aug 2022 19:29:24 +0200 Received: from kreacher.localnet (unknown [213.134.169.54]) (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 C299766D157; Wed, 24 Aug 2022 19:29:23 +0200 (CEST) From: "Rafael J. Wysocki" To: Damien Le Moal Cc: linux-ide@vger.kernel.org, Linux ACPI , LKML , Mario Limonciello Subject: [PATCH] ATA: ACPI: Do not check ACPI_FADT_LOW_POWER_S0 Date: Wed, 24 Aug 2022 19:29:23 +0200 Message-ID: <4426478.LvFx2qVVIh@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.169.54 X-CLIENT-HOSTNAME: 213.134.169.54 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrvdejuddgudduhecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpeffffffkefgheehffelteeiveeffeevhfelteejvddvieejjeelvdeiheeuveeuffenucfkphepvddufedrudefgedrudeiledrheegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvddufedrudefgedrudeiledrheegpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeehpdhrtghpthhtohepuggrmhhivghnrdhlvghmohgrlhesohhpvghnshhouhhrtggvrdifuggtrdgtohhmpdhrtghpthhtoheplhhinhhugidqihguvgesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgv lhdrohhrghdprhgtphhtthhopehmrghrihhordhlihhmohhntghivghllhhosegrmhgurdgtohhm X-DCC--Metrics: v370.home.net.pl 1024; Body=5 Fuz1=5 Fuz2=5 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 From: Rafael J. Wysocki The ACPI_FADT_LOW_POWER_S0 flag merely means that it is better to use low-power S0 idle on the given platform than S3 (provided that the latter is supported) and it doesn't preclude using either of them (which of them will be used depends on the choices made by user space). For this reason, there is no benefit from checking that flag in ahci_update_initial_lpm_policy(). First off, it cannot be a bug to do S3 with policy set to either ATA_LPM_MIN_POWER_WITH_PARTIAL or ATA_LPM_MIN_POWER, because S3 can be used on systems with ACPI_FADT_LOW_POWER_S0 set and it must work if really supported, so the ACPI_FADT_LOW_POWER_S0 check is not needed to protect the S3-capable systems from failing. Second, suspend-to-idle can be carried out on a system with ACPI_FADT_LOW_POWER_S0 unset and it is expected to work, so if setting policy to either ATA_LPM_MIN_POWER_WITH_PARTIAL or ATA_LPM_MIN_POWER is needed to handle that case correctly, it should be done regardless of the ACPI_FADT_LOW_POWER_S0 value. Accordingly, drop the ACPI_FADT_LOW_POWER_S0 check from ahci_update_initial_lpm_policy(). Signed-off-by: Rafael J. Wysocki --- drivers/ata/ahci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) Index: linux-pm/drivers/ata/ahci.c =================================================================== --- linux-pm.orig/drivers/ata/ahci.c +++ linux-pm/drivers/ata/ahci.c @@ -1610,8 +1610,7 @@ static void ahci_update_initial_lpm_poli } #ifdef CONFIG_ACPI - if (policy > ATA_LPM_MED_POWER && - (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0)) { + if (policy > ATA_LPM_MED_POWER) { if (hpriv->cap & HOST_CAP_PART) policy = ATA_LPM_MIN_POWER_WITH_PARTIAL; else if (hpriv->cap & HOST_CAP_SSC)