Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3004174pxu; Tue, 8 Dec 2020 00:29:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJzm5z/zTBKtjFtW1jpwlKs8+pJAonvS820LW+/ZCQLzoJ4IUxMy6GhQCOXhvk0PYy/FY7u3 X-Received: by 2002:a17:906:6713:: with SMTP id a19mr23169322ejp.468.1607416173649; Tue, 08 Dec 2020 00:29:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607416173; cv=none; d=google.com; s=arc-20160816; b=NdoMM8+VtCMpYrALvDaEsU/y+VJ0a/ANYIuPvIDu4das99P893mG5HPMvhJ/mW6QB2 uO3vaoY2sUC6tsr9MK9ae0ldo+6+Qr/E4ZlRFchCtX8IG1NXD0mSe+f9Vz2gw0x7lW4w AtuNHaPIxSPfGok8jfE2rtk7JUzAmnVyUgccdjhPc7x+qQLxDTRHsjSqr1xoL0XOmUXf NQg9YXE3w2utdFEHFoGHDWMMnfwm5GczMk+U2t8HEGCHryJmBwhxtkMcYkjWKKkbMYP7 Xr6mLW0jb6SVhb1rGHf8nJxCoZOAAdrFWZ2WXyMffX6SnN12/R06JDH9TwRObeK1rZ/N 5jAA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=kvTWbIGiMuYVa3FUpMy8SY7CcsURom/34h1qJTZ1aJo=; b=FloywJNtKNoQE590hTs+gHQp6P/BzkdNAPjIyzpUogNKBNMJQYG5Gope4R8uil+oav vviTmFa1uzKH/tgRdOQcGguAwNsBo151YC7kJMbdcgVXe63zZJj3gJ+vUr4Mpqjskogt pnYO6pjUvE7PYIcDmCFVuUzYNynM4A+WEgcVpNGkoR4TuWwC0JKh5YJWk3jiHkO0KfRC 7jhpVeHLUBxvVb8XIMcgFWSi8FdSR5zAbfyXEmSnUYcWE9+4AhuZ0/lkATxyONwOJI9Z kXX2uMwO+eu73r+Emh6ObsTNLW4I4q1zS7Jg6kW9zGaYHQnqUd86Cpg1Ni/Z8b8zJxjL 0hUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cb16si8036742ejb.392.2020.12.08.00.29.11; Tue, 08 Dec 2020 00:29:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728128AbgLHI0h (ORCPT + 99 others); Tue, 8 Dec 2020 03:26:37 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:34653 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727135AbgLHI0g (ORCPT ); Tue, 8 Dec 2020 03:26:36 -0500 Received: from 36-229-231-79.dynamic-ip.hinet.net ([36.229.231.79] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kmYJg-0007bw-Pq; Tue, 08 Dec 2020 08:25:49 +0000 From: Kai-Heng Feng To: bhelgaas@google.com Cc: hkallweit1@gmail.com, Kai-Heng Feng , "Saheed O. Bolarinwa" , Mika Westerberg , Yicong Yang , Xiongfeng Wang , linux-pci@vger.kernel.org (open list:PCI SUBSYSTEM), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 2/2] PCI/ASPM: Use capability to override ASPM via sysfs Date: Tue, 8 Dec 2020 16:25:34 +0800 Message-Id: <20201208082534.2460215-2-kai.heng.feng@canonical.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201208082534.2460215-1-kai.heng.feng@canonical.com> References: <20201208082534.2460215-1-kai.heng.feng@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If we are to use sysfs to change ASPM settings, we may want to override the default ASPM policy. So use ASPM capability, instead of default policy, to be able to use all possible ASPM states. Signed-off-by: Kai-Heng Feng --- drivers/pci/pcie/aspm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c index 2ea9fddadfad..326da7bbc84d 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c @@ -1239,8 +1239,7 @@ static ssize_t aspm_attr_store_common(struct device *dev, link->aspm_disable |= state; } - - pcie_config_aspm_link(link, policy_to_aspm_state(link)); + pcie_config_aspm_link(link, link->aspm_capable); mutex_unlock(&aspm_lock); up_read(&pci_bus_sem); -- 2.29.2