Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp925559rwe; Thu, 25 Aug 2022 11:39:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR6pODo+1drBZXBEObLP4gv5l5qWsWO5wzRLqSzZTIOZaLvYIU+rD4A4zTXGW3dbBnTj2rX7 X-Received: by 2002:a17:907:2173:b0:73d:c95d:1179 with SMTP id rl19-20020a170907217300b0073dc95d1179mr3256696ejb.89.1661452777122; Thu, 25 Aug 2022 11:39:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661452777; cv=none; d=google.com; s=arc-20160816; b=nv0tm2hke1zmskocsI2CarRJS1765W/OgAWwSCa2p2eg7FuT4M/hp2mOw/MvDYr5wz A72JBzlAOadzAiKLie5c8RxUAXbDrkJagNvrjhnrFpunruuFRISIRtqm+bODc1nNsAYy cRoA7JBZMG+9SxFktYw2wV6VbLO4Ih3WvtUoc/VBjFmhb01XLzt+Te2Rk4gfACZsUPpG R97eaCnikbEmsG/FFkiVVH57nqYB5TucmTjLsgR6N3IdeG0JrU87pjkoZvdgix2YApoF Am2vTj7v9o+rpBIZrQJ2W9KRmvJsY8ESgFFVrfxC9HFN4pzFoGw17BkWuYYrKAo/xwsD omQw== 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=370ik16v6dYL1bFtjau2dwlmCcITDyw5iM6cZPv0MIQ=; b=kf8Nyf1B2BtBuyQEbCUaW7ubBJp/rWfNyXyZsXresRep8YP3TBFUrtUUnD3XRVM96q pXosYoVdKsCto46s0eDpqAoLkGCUkilBPABD8ueK9LwfgOQUXVQYhOqdEVLjZd98ikiJ N9KPLlLlm9AswQCVp0yyYaHSOY2sXUJ66GJl1pOWERXVXkx26jhf91fJQSJBn6zJZQ0U svCiiQSOnrsPSgwJdROCKgr515fgvjYy1tE8pSn2D33lzBjZL9W7HkstLWeYx/nxK1BC SzI1r0numwktwXWo4oUFsdFpU1BVZ736TJ+ltbqUCIG3H50/OcIlZX6q/0k9wCa4a5wa TGsA== 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 m8-20020a056402510800b00446ba684e2asi116386edd.367.2022.08.25.11.39.08; Thu, 25 Aug 2022 11:39:37 -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 S240821AbiHYSBM (ORCPT + 99 others); Thu, 25 Aug 2022 14:01:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230101AbiHYSBK (ORCPT ); Thu, 25 Aug 2022 14:01:10 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3A01BC121; Thu, 25 Aug 2022 11:01:06 -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 c651a619d1409391; Thu, 25 Aug 2022 20:01:03 +0200 Received: from kreacher.localnet (unknown [213.134.169.168]) (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 6788C66D1C6; Thu, 25 Aug 2022 20:01:02 +0200 (CEST) From: "Rafael J. Wysocki" To: Damien Le Moal Cc: linux-ide@vger.kernel.org, Linux ACPI , LKML , Mario Limonciello Subject: [PATCH v2] ata: ahci: Do not check ACPI_FADT_LOW_POWER_S0 Date: Thu, 25 Aug 2022 20:01:01 +0200 Message-ID: <5607133.DvuYhMxLoT@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.169.168 X-CLIENT-HOSTNAME: 213.134.169.168 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrvdejfedguddujecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpeffffffkefgheehffelteeiveeffeevhfelteejvddvieejjeelvdeiheeuveeuffenucfkphepvddufedrudefgedrudeiledrudeikeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvudefrddufeegrdduieelrdduieekpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeehpdhrtghpthhtohepuggrmhhivghnrdhlvghmohgrlhesohhpvghnshhouhhrtggvrdifuggtrdgtohhmpdhrtghpthhtoheplhhinhhugidqihguvgesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghr nhgvlhdrohhrghdprhgtphhtthhopehmrghrihhordhlihhmohhntghivghllhhosegrmhgurdgtohhm 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() along with the CONFIG_ACPI #ifdef around it that is not necessary any more. Signed-off-by: Rafael J. Wysocki --- v1 -> v2: * Adjust subject (Damien). * Drop #ifdef CONFIG_ACPI that is not necessary any more (Mario). * Update the changelog. --- drivers/ata/ahci.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) Index: linux-pm/drivers/ata/ahci.c =================================================================== --- linux-pm.orig/drivers/ata/ahci.c +++ linux-pm/drivers/ata/ahci.c @@ -1609,15 +1609,12 @@ static void ahci_update_initial_lpm_poli goto update_policy; } -#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) policy = ATA_LPM_MIN_POWER; } -#endif update_policy: if (policy >= ATA_LPM_UNKNOWN && policy <= ATA_LPM_MIN_POWER)