Received: by 10.192.165.148 with SMTP id m20csp115427imm; Thu, 19 Apr 2018 14:08:41 -0700 (PDT) X-Google-Smtp-Source: AIpwx480MuQXKTW/5baGgQJHlDOJ2drjWYHvoc7A0vR8HeTqoCWDP6/zstwumDlJ86zxjpJ+LXK1 X-Received: by 10.98.212.67 with SMTP id u3mr7031191pfl.58.1524172121019; Thu, 19 Apr 2018 14:08:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524172120; cv=none; d=google.com; s=arc-20160816; b=MZGTggg8UABNTlzorTGmSqP2EB4hVVsQIR+j18SWKni//9Pk0Rb3ziGjqgoOBJmvXH 9i1qsxLYtDzgk76dl2A16FedSvTAxxjqlIQYeAjLR1OfvlrQ+2UkgF9bIXIZGdSlzumj u2n1TrnJt3MuJI8KVT6DzWhmdJqf1FyQEoR/ntnuHwTOmmYI0XFil5F1mLvsBTFim+UH sIah1B50u4J8W4GrNFTX9IMyUYC4zDggs2Fl4jdPk7BALlHCSlA5CsQ/zAS8YJRp1p51 MwQ4Y6nWxsTNSMdmXs2GJ6lnV8z3CQo/0p1My82mhvjQj+j9LNUvb7RcWcbg31sCZPcN rFxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:dmarc-filter:arc-authentication-results; bh=gDnAffb6nNw+Bxjr9UXKYpDiaN+yylghDfg+URZAIHI=; b=E487zYYNQFxD0VWQhTC2mXg5OrMSSXt7vLkKveSpTT9Yj4gHT4zxH8N0JXSbVg8YoB ZSc7Ej03yoQHWECzq8GrF3piHy1d5vEKrWdOxfY3XN71wwtQF5+xVqtGqORszU+dXkxN uJvB/6ZHwcTtA8UI0KtbWZy7UiU6fSOA3WBmYaYxLDb6VJjOhA1LzScCJcS2UqqRpgZw 5LMIuG89BbmU/8AgftlfXUNz8QZKfGQKIC2b81qlyt0pf9C5ywRpumyM5Ehp/uNbyfI/ izvI8+g0fGJfdwS/bISW7RREmmk5V7S5LYovTenJUzDFhl76PScdEL5K/5MP9XZrTKUZ X74Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e17si3509308pgt.179.2018.04.19.14.08.23; Thu, 19 Apr 2018 14:08:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753462AbeDSVFe (ORCPT + 99 others); Thu, 19 Apr 2018 17:05:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:60428 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753396AbeDSVFc (ORCPT ); Thu, 19 Apr 2018 17:05:32 -0400 Received: from localhost (unknown [69.71.5.252]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3A2D12177E; Thu, 19 Apr 2018 21:05:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3A2D12177E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=helgaas@kernel.org Subject: [PATCH v1 1/2] PCI/ASPM: Disable ASPM L1.2 Substate if we don't have LTR From: Bjorn Helgaas To: linux-pci@vger.kernel.org Cc: "Rafael J. Wysocki" , Sinan Kaya , Rajat Jain , Srinath Mannam , Ray Jui , Keith Busch , linux-acpi@vger.kernel.org, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Date: Thu, 19 Apr 2018 16:05:29 -0500 Message-ID: <152417192976.76853.5171081412139699180.stgit@bhelgaas-glaptop.roam.corp.google.com> In-Reply-To: <152417080402.76853.4258398181136860884.stgit@bhelgaas-glaptop.roam.corp.google.com> References: <152417080402.76853.4258398181136860884.stgit@bhelgaas-glaptop.roam.corp.google.com> User-Agent: StGit/0.18 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bjorn Helgaas When in the ASPM L1.0 state (but not the PCI-PM L1.0 state), the most recent LTR value and the LTR_L1.2_THRESHOLD determines whether the link enters the L1.2 substate. If we don't have LTR enabled, prevent the use of ASPM L1.2. PCI-PM L1.2 may still be used because it doesn't depend on LTR_L1.2_THRESHOLD (see PCIe r4.0, sec 5.5.1). Signed-off-by: Bjorn Helgaas --- drivers/pci/pcie/aspm.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c index f76eb7704f64..c687c817b47d 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c @@ -400,6 +400,15 @@ static void pcie_get_aspm_reg(struct pci_dev *pdev, info->l1ss_cap = 0; return; } + + /* + * If we don't have LTR for the entire path from the Root Complex + * to this device, we can't use ASPM L1.2 because it relies on the + * LTR_L1.2_THRESHOLD. See PCIe r4.0, secs 5.5.4, 6.18. + */ + if (!pdev->ltr_path) + info->l1ss_cap &= ~PCI_L1SS_CAP_ASPM_L1_2; + pci_read_config_dword(pdev, info->l1ss_cap_ptr + PCI_L1SS_CTL1, &info->l1ss_ctl1); pci_read_config_dword(pdev, info->l1ss_cap_ptr + PCI_L1SS_CTL2,