Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3336306pxu; Tue, 8 Dec 2020 09:21:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJywGwtkW+ZoSBsdG6TitWIJ2E3OBLT5Dnxs00CA4rfQ4rzphyySkvJvVmkjVQ1/Q9V/zMru X-Received: by 2002:a17:906:ccc5:: with SMTP id ot5mr23879889ejb.248.1607448095042; Tue, 08 Dec 2020 09:21:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607448095; cv=none; d=google.com; s=arc-20160816; b=nK3D1G6o29NHfyjhT5W9IBTUDT34zXzunI+MeUJD5yv+ghpuUchD7FpvIfWSRmn60N F4+aqvZB9tiieBNphLCbyLj15f36rtqkuSRPwHSCXmXMR37XEAVXGbEioAZC0g/uxgp4 yXJ0UCYmfB8bEkdWgcFAmvk2iefhAScwp/UOs648KHrz8HH+d4AQeOH2t6RgVHxANMuu N1j5fucYOWHCn+LsEVKRhDpPLxqrmGHvlRKTD3SDnVAy95Ehguu6hUNtIu/fDb/hkv5i vUTlyiYN4uUVkYhmQQkLsWVsLtQnTFUfiTOLORpN4fFRF/JYvIVZIyc8cqIjgLoGZd6y WL4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject:dkim-signature; bh=YsRTsMesCTliRWq4glF76HNwn9ElWJpIdmHckoW2bvo=; b=fWR31FCLfAyRLKCG6xlLuSQT0gqQ8onyIrhRJE+8YYM3q5QSS8u/wipFY2EsXvlSUo N6+7eUzvWolk1vWPJoE8wNM49foWiemj/u5i71yC17gF7SHq+dkVhUTASyA14X2dSzKs txNXFz7WaidxiwoQ7TdyfZp72lOLYuSu8ERUD8FRrfZakz7VHAS4FENdQYObIAEgeT6i seY0XQXV2pbIeWzLUh/l0zeEoYsIEEIt9kEi+LYTCBx8WbFF8xX18JbV9AbZOt7EIx5q ErcVkcysmYTFDJM9wCAoTGTPhcjIkeRkU1jAV17qbxHMD2xNVcSQvHM0D4ac/YzFRMir lBkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=C6rysrLL; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j18si10419835edj.99.2020.12.08.09.21.12; Tue, 08 Dec 2020 09:21:35 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=C6rysrLL; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730565AbgLHRTT (ORCPT + 99 others); Tue, 8 Dec 2020 12:19:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730436AbgLHRTT (ORCPT ); Tue, 8 Dec 2020 12:19:19 -0500 Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A06D7C061793; Tue, 8 Dec 2020 09:18:38 -0800 (PST) Received: by mail-ed1-x544.google.com with SMTP id k4so18408529edl.0; Tue, 08 Dec 2020 09:18:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=YsRTsMesCTliRWq4glF76HNwn9ElWJpIdmHckoW2bvo=; b=C6rysrLLV7sfxL+MVzuGx2dgpynoaKZwkG5aZ+HfF+/4msF1fH8Xam/Rm/CJWSwFmO 88pVRExhJ9bYiRSmD5noxb6tqNsZVnaRKHFQhBi46KliVnzSkyXxFp0Utd03rVh9HZr2 JbE/0mvw+PnMIl2HuB+rXqehij9oUY1LSyXIBclOeFtvHy+GsW0vFK6BOXHPw/5hgRxU g509UkB/dWzQyXPk+zVIh07+JliwiT2A1g+fFo0Fll5CyKSn4BqVhI/wDf9eWccBEu3g v4O7d6AYBUXLtWUGkZurD1PXupxAwqP0lBivwg+AVU+OKHpI7jrgFWhBRc+VuDFBRrZe S4Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=YsRTsMesCTliRWq4glF76HNwn9ElWJpIdmHckoW2bvo=; b=qgu5YK4SFAeoBEffn9nNcYaCRrF3A248gghwatWkRy7nibI/oPPxNkVfLAlvCzMR4z Xi6eDUyTUJJcdFcH2umsZnbgGFbp/lerTfwtkn6Twut5gxCHq1ByYZzctv45EVCSVkVr C6DT6g41HBfiTxy3vCroe6RJcxwuCy5bgEVAHnUZA9FWBB3Mn/Hu8A9C5RMEl27nPsQl Wc2oRcaj6a5B7UkoPA1z0kLcrpFzqo36Eq8Uk2ZLJ1FzrcLm2eEfNqbRXzd7RhiuAVrH xEkc4j8ycXIJ8XsztxvUTDnNsUJ4eI0Uoey0Rkk5sQNiptsJNsh8csqsVIr01XmR50mB HssA== X-Gm-Message-State: AOAM531ANcsjeQcAO8B13+CerG1n13+zqp49An0sSycWsJxFV/sURAfG 3FQX8CQMZ32LU7Ura0TtATopK/8Z+dc= X-Received: by 2002:a05:6402:8cc:: with SMTP id d12mr25266684edz.0.1607447917370; Tue, 08 Dec 2020 09:18:37 -0800 (PST) Received: from ?IPv6:2003:ea:8f06:5500:580f:b429:3aa2:f8b1? (p200300ea8f065500580fb4293aa2f8b1.dip0.t-ipconnect.de. [2003:ea:8f06:5500:580f:b429:3aa2:f8b1]) by smtp.googlemail.com with ESMTPSA id ef11sm3659979ejb.15.2020.12.08.09.18.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Dec 2020 09:18:36 -0800 (PST) Subject: Re: [PATCH 2/2] PCI/ASPM: Use capability to override ASPM via sysfs To: Kai-Heng Feng , bhelgaas@google.com Cc: "Saheed O. Bolarinwa" , Mika Westerberg , Yicong Yang , Xiongfeng Wang , "open list:PCI SUBSYSTEM" , open list References: <20201208082534.2460215-1-kai.heng.feng@canonical.com> <20201208082534.2460215-2-kai.heng.feng@canonical.com> From: Heiner Kallweit Message-ID: Date: Tue, 8 Dec 2020 18:18:30 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <20201208082534.2460215-2-kai.heng.feng@canonical.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 08.12.2020 um 09:25 schrieb Kai-Heng Feng: > 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); > I like the idea, because the policy can be changed by the user anyway. Therefore I don't see it as a hard system limit. However I think this change is not sufficient. Each call to pcie_config_aspm_link(link, policy_to_aspm_state(link)), e.g. in path pcie_aspm_pm_state_change -> pcie_config_aspm_path will reset the enabled states to the policy. > mutex_unlock(&aspm_lock); > up_read(&pci_bus_sem); >