Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp905866rdb; Tue, 30 Jan 2024 02:04:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IEJblDnHB6jA3kraNH08tLpWpqc3PJDKzkgIG3Wb/2jhpd5+h3vYWwvr7YfWPN20tiPmLsi X-Received: by 2002:a05:6214:2346:b0:68c:369e:c62c with SMTP id hu6-20020a056214234600b0068c369ec62cmr7181700qvb.71.1706609057035; Tue, 30 Jan 2024 02:04:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706609057; cv=pass; d=google.com; s=arc-20160816; b=bzj+b5QkzGX/aBMfQPsH1jTM6ePu6saEz35xqUXJDL71VkvjCjbWrt1HKZxphfFZqf QWb2WPW8Oim5BGbpMNTKX+PSo4tyDLkga+C97ibV5vhO3GoAjSi9gkZ17xqG30H/vHs8 fVSWYhdar2unm0vtQ/X4+nSOjAoMz5NQ7EV531zn9jDQLK29BjKaPKpq5qpPTJYMEia6 S35SGD6Fg01luoBqZsGdkKhWePEa4ohVzUweV4LoVvHAiAaEm61sXgr9D/fL/ehTGc/S WvAaihLXSIdRV3teUepKguqVnT8K+Uvs7rPcpdYHfIW9/Eb2pzcV59xN7tfNN672+/QM 2gJQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=b8wT6bcymUslDtltBZzAISdjS3jJfOOrz/LevDJCQnA=; fh=tBTIidyhDS9E7J3McbqbZa3c/zGMWarlKyvCcJI/R8o=; b=C84dsW2ynIoouOspygFMIw9NZMriD24T5rRXvXJBw9tMPMobzo9KAABB9rHYKkFIxN mO9R/xuB38dkmsp/PRUifarFNVqIGzpoAI2mzAONLEvWaohq47CnmGODVJO1ifgcULxD s1GoGE4gZ5poWDXvIKv8hY00hFRq31aHnxnAVKrQYRE+qGEa/PxwRAhN1AsySIycpEZt 6TQeWAH5nDLRibDNMFtDzM7dydWvSUw0DIjfnJNWZ3/9s2MdOunJ1eG80sD+5jBbVYJf Z8GZpCRbO+YS7zG9Er6mW1iUpwkLExBLAwtY1pUHGD/mb9fXbFMGZCWVoNM4n5lD9LPq WNrw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@endlessos.org header.s=google header.b=XFxZfmIC; arc=pass (i=1 spf=pass spfdomain=endlessos.org dkim=pass dkdomain=endlessos.org dmarc=pass fromdomain=endlessos.org); spf=pass (google.com: domain of linux-kernel+bounces-44341-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44341-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=endlessos.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id i14-20020ad45c6e000000b00681b44eed98si9801224qvh.136.2024.01.30.02.04.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 02:04:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44341-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@endlessos.org header.s=google header.b=XFxZfmIC; arc=pass (i=1 spf=pass spfdomain=endlessos.org dkim=pass dkdomain=endlessos.org dmarc=pass fromdomain=endlessos.org); spf=pass (google.com: domain of linux-kernel+bounces-44341-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44341-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=endlessos.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C8A631C26EC8 for ; Tue, 30 Jan 2024 10:04:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 72A806A343; Tue, 30 Jan 2024 10:00:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=endlessos.org header.i=@endlessos.org header.b="XFxZfmIC" Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36D266A32C for ; Tue, 30 Jan 2024 10:00:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706608829; cv=none; b=kr5f4lsmKmXNO/jPnLZTf1BY6BlKlku0GuMBw6XmoHgLeTppJEAQFgqRVFjh4izFvpAyiz8WwkHeI0mHthd3RLOcrw1l94x3oMZQZRXe9SU8qFJSM0tLjZWM0bRZH/L2dmBH+rKu5TtLAY3XGfizO4IyNN79yPzP7HshQQZqSj4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706608829; c=relaxed/simple; bh=UXxOFnzyPjSmWhL7VN01cLQZkxTaV1mX68f4OmqP1C8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=MCR/AJ8EvHMnhMc+xqA6KS4T34qSLXpoSDUdu2mAsM1epGBnLmSzYURbq5vgTzLmupBZ+4+Wmrds+LJVhS/IlEPNkLsNowkIVW30ZMbX4dZHWhCpFgBHDFjkIUm8uezeRJPK4kG6+5S5gIhV346b+UigtjgieAiyqUEt3PyUEWM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=endlessos.org; spf=pass smtp.mailfrom=endlessos.org; dkim=pass (2048-bit key) header.d=endlessos.org header.i=@endlessos.org header.b=XFxZfmIC; arc=none smtp.client-ip=209.85.210.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=endlessos.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=endlessos.org Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-6ddcfda697cso2825362b3a.2 for ; Tue, 30 Jan 2024 02:00:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=endlessos.org; s=google; t=1706608826; x=1707213626; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=b8wT6bcymUslDtltBZzAISdjS3jJfOOrz/LevDJCQnA=; b=XFxZfmICV3268PQyy8LsPPvJWfUwpbnkOgIuLrCTHiIIwHU4+G5pj/9KBrVGiA5DZI gr3rHTmTnECx62dynyV94UXRv3x1wDvmOlfPUYN7aN3NxfKHRB7XPL2kTk8PUJUKwGBQ kfu1Mb1rTwfZZLiB6IFgnybZyYoY8Fmd5lLW93r6C2ElBL8CH/q4jEgI8gcAgJMRbdvF p9o11P5r1oSSjGGYVP5+Z4pOqIEQnMpoEDCSBw7tfLWYWLq52vhuSwB72ZwFCexnUki4 QUSHGgyiy4r/nWhL2YwWyOIUSbLJ9xv8NlQWP8ocphquFTM4Oj3tNY/tQXVD33w5nMg5 V61g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706608826; x=1707213626; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=b8wT6bcymUslDtltBZzAISdjS3jJfOOrz/LevDJCQnA=; b=XHFMfHzsz+J1btJKM4OsxeqfakprrrAiJ3tR+gW1R0XPPAMbDqCrUGD0hsITxVx2x2 kCosrMxW+HZ5TtYgE0RhwhdRb1iDv11YX3S01v2jHGypM51AQcyWs00KsZ0OEYPOvIS/ WhqTHdm6WE9JQtZz39W2XUc6pkIVl/PfFd//ikdBQ8OIbO7TbBnkYFI8lZHmBLKUWCFy jrqDMe4paRNqH5fC+r82MtvPSHitMjk6gFX4UEHTlHrMgLZefZNY+BNH9O/UfaGmGQQT g7iUo5QwSwpGwHOjrn1JDM+5wOpGg7hfrMvOARiW+M7oWUOqBETTVW53wgQiOH+fJ22n SatQ== X-Gm-Message-State: AOJu0YwGtel1DJy8/luc/GwfyW0MDDhPdC8ALQgvRJP0G4BBH7/g8lT4 9qBIfxU47EvV3goel7mskmP1zrsNw2DW5kAVVjrW2hsmQslu/9RpB2PFHwi8vhQ= X-Received: by 2002:a05:6a00:179c:b0:6dd:7fd4:9fa1 with SMTP id s28-20020a056a00179c00b006dd7fd49fa1mr6712516pfg.8.1706608826374; Tue, 30 Jan 2024 02:00:26 -0800 (PST) Received: from localhost.localdomain ([123.51.167.56]) by smtp.googlemail.com with ESMTPSA id w22-20020aa78596000000b006dde44a2d16sm7345021pfn.199.2024.01.30.02.00.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 02:00:26 -0800 (PST) From: Jian-Hong Pan To: Mika Westerberg , David Box , Damien Le Moal , Niklas Cassel , Nirmal Patel , Jonathan Derrick Cc: linux-ide@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux@endlessos.org, Jian-Hong Pan Subject: [PATCH 1/2] ata: ahci: Add force LPM policy quirk for ASUS B1400CEAE Date: Tue, 30 Jan 2024 17:59:33 +0800 Message-ID: <20240130095933.14158-1-jhp@endlessos.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Some systems, like ASUS B1400CEAE equipped with the SATA controller [8086:a0d3] can use LPM policy to save power, especially for s2idle. However, the same controller may be failed on other platforms. So, commit (ata: ahci: Revert "ata: ahci: Add Tiger Lake UP{3,4} AHCI controller") drops LPM policy for [8086:a0d3]. But, this blocks going to deeper CPU Package C-state when s2idle with enabled Intel VMD. This patch adds ahci_force_lpm_policy DMI quirk for ASUS B1400CEAE to fix s2idle's power consumption issue when Intel VMD feature is enabled. Link: https://bugzilla.kernel.org/show_bug.cgi?id=218394 Signed-off-by: Jian-Hong Pan --- drivers/ata/ahci.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index d2460fa985b7..6bc5298a4adf 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -1434,6 +1434,33 @@ static bool ahci_broken_devslp(struct pci_dev *pdev) return pci_match_id(ids, pdev); } +static bool ahci_force_lpm_policy(void) +{ + /* + * Some systems, like ASUS B1400CEAE equipped with the SATA controller + * [8086:a0d3] can use LPM policy to save power, especially for s2idle. + * However, the same controller may be failed on other platforms. So, + * commit (ata: ahci: Revert "ata: ahci: Add Tiger Lake UP{3,4} AHCI + * controller") drops LPM policy for [8086:a0d3]. + * + * https://bugzilla.kernel.org/show_bug.cgi?id=218394 + */ + static const struct dmi_system_id sysids[] = { + { + .ident = "ASUS B1400CEAE", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, + "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, + "ASUS EXPERTBOOK B1400CEAE"), + }, + }, + { } /* terminate list */ + }; + + return dmi_first_match(sysids); +} + #ifdef CONFIG_ATA_ACPI static void ahci_gtf_filter_workaround(struct ata_host *host) { @@ -1760,6 +1787,11 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ahci_pci_bar = AHCI_PCI_BAR_LOONGSON; } + if (ahci_force_lpm_policy()) { + pi = ahci_port_info[board_ahci_low_power]; + dev_info(&pdev->dev, "force controller follow LPM policy\n"); + } + /* acquire resources */ rc = pcim_enable_device(pdev); if (rc) -- 2.43.0