Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4166055pxu; Wed, 9 Dec 2020 09:55:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJxg+CmrfCIZjn1caKkOKxAIiJiouWNfAMqiiI7A3M0RfQbTBYRXpLsFxxftfelmYp2KSVbf X-Received: by 2002:a50:eb97:: with SMTP id y23mr3090979edr.29.1607536530332; Wed, 09 Dec 2020 09:55:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607536530; cv=none; d=google.com; s=arc-20160816; b=LXCNmTnIe7oWAgvq31gshnwW/XR+fL89suMquJtP+n5I0GjnGL7KpF8gFbUMv9YUXK 4TJ9SKiz92m/ae9gpF2anz0Fb6xVoPCx9H7MfXC/ApLT9nZ5+qLQWLTkMCuYaZpWk4iY CpmITgjL+ivj+rQQB3UEOGyrjvzenJdwvZEJ1ygVbE52S4VxggV4er+uzaBnEynlrF4O z8lFH0tWGLMcIM8TcTFcAq8nzMQBkz3g5T+gH8CQT6gg08UeCpiCxtBM+kknSfFJYKcg 6aNFXwXR1iwKGHKPiz6gqsJO3Sm/KFljRziQa8hlH8fknX6PDzUDmQgD8XoVgoJNYWWP hH4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=BoKr4rNRSBE/iWeBNiUFWpAtJSPWKEsJ/6iFlBQt450=; b=A4P4Ma7a1+MJU4DmmK92lCn7x9CkbKL4ki4lsMBb4Cn/p7tDT2P994QnKJzuo7QUIr i5ZKdzPk9mCmeXmk6JVpDhNCrXc7MCobgF+1mmf6eOun/tI8oiDvP8FnnPJcEVWAWP55 //P7ey9gzv9uKQFV9hyzwOtKKnjyu0Mirvk3qcjtywmXtidOGk+6jYuwtnPw2Aykl6t5 zOM/G5OQ02BcVthNMttIrx+GqIkpJqZD/c8E+5F+eaehbR4nXh+FyZ+VSik4sRUN1kVU ZP34/wTG4VnK4I9bVUwOREeFnOYP1QO9gz/ygtvWaOFTsqZvNKALdc+/xBmxa2U2gSfg MY7g== 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 x91si1159178edc.442.2020.12.09.09.55.07; Wed, 09 Dec 2020 09:55:30 -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 S1728791AbgLIRvM convert rfc822-to-8bit (ORCPT + 99 others); Wed, 9 Dec 2020 12:51:12 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:34089 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728723AbgLIRvM (ORCPT ); Wed, 9 Dec 2020 12:51:12 -0500 Received: from mail-pj1-f69.google.com ([209.85.216.69]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kn3bh-0007iU-De for linux-kernel@vger.kernel.org; Wed, 09 Dec 2020 17:50:29 +0000 Received: by mail-pj1-f69.google.com with SMTP id hg11so1246785pjb.2 for ; Wed, 09 Dec 2020 09:50:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=WOZeix5vvOQuXdsJGlu4vfA3jFYuqZ94agmcIqxRVFU=; b=iehlgCpTGKNqxdQlNnUCPVKu3IkGSSR3MQgOBi1j1mXbFeeGRJsKVMfcSqld5e7j69 79Ie1/uFlsIf8OBgCTtvZSEaSbNF6Oh5w/A0Jh7Bxq6wswcnVaVvymdeS4Zu6LRtLrzL rmsVy5MQ5OZhPSnZ2ui0ZwFr7OCWeve8u7cYtEu+mRKJGTtp1wzB6ckDgA9uGWVaX7yn 0DDwMw2X3S7su+5pKZDMCoe68Hh7Fb2iF210ihflML7DBdkpNxaCmvjmh3Q0rqRv9ncm DI/qg+8S9XeEGpif0ngUm2z93vdszcH7kygOIE7LzUg0ctYghfB2kLyImkcZrxNZG2kR w38g== X-Gm-Message-State: AOAM530EhUF+l2k8ODw83qF9AhVO0ttFFenox6cOzcf5HEJ/Rv2gRLiK 1Sxzi8kEKGpmm2SMhO9IiaWDoGmVo1SNBLIbVbWuutSo8JCnodd5Dy1MRPt12iCHKVo1ub7wU2A bg6XUBHJWy/+hgF7iaidfVdlJiZRRt+mcZvM+/247Uw== X-Received: by 2002:a17:90a:4606:: with SMTP id w6mr3270205pjg.10.1607536228056; Wed, 09 Dec 2020 09:50:28 -0800 (PST) X-Received: by 2002:a17:90a:4606:: with SMTP id w6mr3270185pjg.10.1607536227740; Wed, 09 Dec 2020 09:50:27 -0800 (PST) Received: from [192.168.1.104] (36-229-231-79.dynamic-ip.hinet.net. [36.229.231.79]) by smtp.gmail.com with ESMTPSA id z65sm3525325pfz.126.2020.12.09.09.50.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2020 09:50:27 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.20.0.2.21\)) Subject: Re: [PATCH 2/2] PCI/ASPM: Use capability to override ASPM via sysfs From: Kai-Heng Feng In-Reply-To: Date: Thu, 10 Dec 2020 01:50:23 +0800 Cc: Bjorn Helgaas , "Saheed O. Bolarinwa" , Mika Westerberg , Yicong Yang , Xiongfeng Wang , "open list:PCI SUBSYSTEM" , open list Content-Transfer-Encoding: 8BIT Message-Id: References: <20201208082534.2460215-1-kai.heng.feng@canonical.com> <20201208082534.2460215-2-kai.heng.feng@canonical.com> To: Heiner Kallweit X-Mailer: Apple Mail (2.3654.20.0.2.21) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Dec 9, 2020, at 01:18, Heiner Kallweit wrote: > > 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. That's right, let me work this in v2. Kai-Heng > >> mutex_unlock(&aspm_lock); >> up_read(&pci_bus_sem); >> >