Received: by 10.192.165.148 with SMTP id m20csp114145imm; Thu, 19 Apr 2018 14:07:05 -0700 (PDT) X-Google-Smtp-Source: AIpwx48PclX0rCNMQzlwhgn9W+TX1l739S7zRRxSTpjp3NIDmPMM4OY5Cmzaz3hWVDTEhIiqFaSO X-Received: by 10.98.21.73 with SMTP id 70mr7151035pfv.91.1524172025736; Thu, 19 Apr 2018 14:07:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524172025; cv=none; d=google.com; s=arc-20160816; b=y75ZZnw4rB0y3vrzJTgh/IGAdbJz8I9qIpyMZmzOt6QqrVt4/rBAesuJTbDlHLTFGO mf/qbFYojzPSpjRSb4707OcZS2az6kYRHPLQI11Hh+VT+6XZ/AtS+R5UD4WoI5KM43g7 iC9gnw9In8/30979x8viBIpZzLnFvyC/vRWlgaO1vgr8Dp3C655q6SqIzz975ZKLmSYu XMQ0aQcml5CObOU9ThtFiJoajGnDL03EWw53SadnXPGgDUngVbDYtC/aoo8V8n9i8WWV T6DNY2lckjNecWiQI47ShIIk43DxoGtmbVb1RbHp+g8MZ3v0JAS18QX/yr4ctTBaBhn3 yh9g== 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:message-id:date:cc:to:from:subject:dmarc-filter :arc-authentication-results; bh=iGKlmPh4IUwCO2BTm33eZuoma6T8ZyPy+U8npIxQ36g=; b=TZfjJtPe/rt8ZdirIiP/9+jqpiz09aquhaxVSC8qvs6ERqCK8Vl5W947bThjICVyvc kAnxiMOVcj7+bPoaE4waRUr3ZIvNtoVIr5CJi5F6IPdOZEuIjm9VR6DNWS9f2hmtpL4B B7WDbn7JmXj851dqKW8ViZzoCbJLIeTi6N+rnlX3VVOh2WC+q/OfymGqr+PQdWQLXSTd 9nt0ODiE/nj25OA5BEatRyCnjkLi1Y76tZ0smRTNVTTeRw6+A9xLXE/0lWcwbJgWV/zI zpatZ+kI3hsNR3lIx8gFH+w+77n3fHf3Kvlg6LJK4gw7rc7cCOxNbVDpMbzXMloweA06 WSBA== 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 q7si3771700pga.86.2018.04.19.14.06.48; Thu, 19 Apr 2018 14:07:05 -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 S1753505AbeDSVFf (ORCPT + 99 others); Thu, 19 Apr 2018 17:05:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:60404 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753187AbeDSVFZ (ORCPT ); Thu, 19 Apr 2018 17:05:25 -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 4E30A2077A; Thu, 19 Apr 2018 21:05:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4E30A2077A 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 0/2] PCI/ASPM: Tighten up ASPM L1.2 and LTR usage 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:19 -0500 Message-ID: <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 The ASPM L1.2 substate depends on LTR information. Per the PCI Firmware spec, the OS is supposed to negotiate with the platform for control of the LTR feature, but previously we didn't do that. In addition, we must not enable LTR in an endpoint unless the Root Complex and all intermediate switches also support LTR. We already took care of that in pci_configure_ltr(), but we didn't ensure that LTR was enabled before allowing ASPM L1.2 to be enabled. These patches fix both of these issues. Or rather, they *should* fix them. I don't have hardware to test them, so any help with testing would be appreciated. I think the most likely issue would be a platform where the hardware supports LTR and the ASPM L1.2 substate, but the BIOS doesn't support LTR in _OSC. In that case, we previously could have enabled ASPM L1.2 (though it probably wouldn't work correctly), and after these patches, we should not enable ASPM L1.2. You can look for issues by comparing dmesg and "lspci -vv" output before and after these patches. It would also be interesting to collect an acpidump from platforms that support LTR, even if there's no endpoint that supports ASPM L1.2. The acpidump should show that _OSC supports LTR. I included some NVMe folks because these were motivated by Srinath's recent report of LTR and ASPM issues with a Samsung NVMe SSD Controller SM961/PM961 device, so this is sort of FYI in case you see similar issues or are in a position to test these. --- Bjorn Helgaas (2): PCI/ASPM: Disable ASPM L1.2 Substate if we don't have LTR PCI/ACPI: Request LTR control from platform before using it drivers/acpi/pci_root.c | 7 +++++++ drivers/pci/pcie/aspm.c | 9 +++++++++ drivers/pci/probe.c | 5 +++++ include/linux/acpi.h | 3 ++- include/linux/pci.h | 1 + 5 files changed, 24 insertions(+), 1 deletion(-)