]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
PCI: tegra194: Don't allow suspend when Tegra PCIe is in EP mode
authorOm Prakash Singh <omp@nvidia.com>
Wed, 23 Jun 2021 10:05:24 +0000 (15:35 +0530)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Wed, 4 Aug 2021 11:28:17 +0000 (12:28 +0100)
When Tegra PCIe is in endpoint mode it should be available for root port.
PCIe link up by root port fails if it is in suspend state. So, don't allow
Tegra to suspend when endpoint mode is enabled.

Link: https://lore.kernel.org/r/20210623100525.19944-5-omp@nvidia.com
Signed-off-by: Om Prakash Singh <omp@nvidia.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Vidya Sagar <vidyas@nvidia.com>
drivers/pci/controller/dwc/pcie-tegra194.c

index f2e49dda2c83b05340b54c34a4bde8612c3e74a6..2d86e947bf1fff4f49d6f9e6d4ab175ee5f4aa75 100644 (file)
@@ -2246,6 +2246,11 @@ static int tegra_pcie_dw_resume_early(struct device *dev)
        struct tegra_pcie_dw *pcie = dev_get_drvdata(dev);
        u32 val;
 
+       if (pcie->mode == DW_PCIE_EP_TYPE) {
+               dev_err(dev, "Suspend is not supported in EP mode");
+               return -ENOTSUPP;
+       }
+
        if (!pcie->link_state)
                return 0;