All of lore.kernel.org
 help / color / mirror / Atom feed
* Issue with Enable LTR while pcie_aspm off
@ 2018-04-13  6:46 Srinath Mannam
  2018-04-13 13:56 ` Bjorn Helgaas
  0 siblings, 1 reply; 16+ messages in thread
From: Srinath Mannam @ 2018-04-13  6:46 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: Ray Jui, linux-pci

Hi Bjorn,

In our platform we disable aspm using boot_arg "pcie_aspm=off".
But with the below patch, LTR is enabled which is part of ASPM.
even we keep disable aspm using "pcie_aspm=off" then why we need to
enable LTR. This is causing issues with few NVMe cards.

Please advice us how can we proceed in this scenario.

commit c46fd358070f22ba68d6e74c22016a33b914c20a
Author: Bjorn Helgaas <bhelgaas@google.com>
Date:   Tue Nov 28 16:43:50 2017 -0600

    PCI/ASPM: Enable Latency Tolerance Reporting when supported

    Enable Latency Tolerance Reporting (LTR).  Note that LTR must be enabled in
    the Root Port first, and must not be enabled in any downstream device
    unless the Root Port and all intermediate Switches also support LTR.
    See PCIe r3.1, sec 6.18.

    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Reviewed-by: Vidya Sagar <vidyas@nvidia.com>

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 14e0ea1..3761b13 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1875,6 +1875,38 @@ static void
pci_configure_relaxed_ordering(struct pci_dev *dev)
        }
 }

+static void pci_configure_ltr(struct pci_dev *dev)
+{
+#ifdef CONFIG_PCIEASPM
+       u32 cap;
+       struct pci_dev *bridge;
+
+       if (!pci_is_pcie(dev))
+               return;
+
+       pcie_capability_read_dword(dev, PCI_EXP_DEVCAP2, &cap);
+       if (!(cap & PCI_EXP_DEVCAP2_LTR))
+               return;
+
+       /*
+        * Software must not enable LTR in an Endpoint unless the Root
+        * Complex and all intermediate Switches indicate support for LTR.
+        * PCIe r3.1, sec 6.18.
+        */
+       if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT)
+               dev->ltr_path = 1;
+       else {
+               bridge = pci_upstream_bridge(dev);
+               if (bridge && bridge->ltr_path)
+                       dev->ltr_path = 1;
+       }
+
+       if (dev->ltr_path)
+               pcie_capability_set_word(dev, PCI_EXP_DEVCTL2,
+                                        PCI_EXP_DEVCTL2_LTR_EN);
+#endif
+}
+
 static void pci_configure_device(struct pci_dev *dev)
 {
        struct hotplug_params hpp;
@@ -1883,6 +1915,7 @@ static void pci_configure_device(struct pci_dev *dev)
        pci_configure_mps(dev);
        pci_configure_extended_tags(dev, NULL);
        pci_configure_relaxed_ordering(dev);


Regards,
Srinath.

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2018-04-18  9:05 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-13  6:46 Issue with Enable LTR while pcie_aspm off Srinath Mannam
2018-04-13 13:56 ` Bjorn Helgaas
2018-04-13 15:43   ` Srinath Mannam
2018-04-13 19:04     ` Rajat Jain
2018-04-13 21:16     ` Bjorn Helgaas
2018-04-14  3:34       ` Srinath Mannam
2018-04-14 16:09         ` Bjorn Helgaas
2018-04-16 15:33           ` Srinath Mannam
2018-04-16 21:35             ` Bjorn Helgaas
2018-04-16 21:35               ` Bjorn Helgaas
2018-04-17  9:03               ` Srinath Mannam
2018-04-17  9:03                 ` Srinath Mannam
2018-04-17 17:11                 ` Bjorn Helgaas
2018-04-17 17:11                   ` Bjorn Helgaas
2018-04-18  9:05                   ` Srinath Mannam
2018-04-18  9:05                     ` Srinath Mannam

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.