summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOm Prakash Singh <omp@nvidia.com>2021-04-01 07:20:50 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2021-04-16 15:55:09 -0400
commitdbfc138f5ef308675071acde3678cbc6d2d2d2b4 (patch)
tree71d2710e22329741971caa213806f1bef9cf977a
parent1eceeacf73b14e3684457e4e828bd572077e6ad6 (diff)
PCI: tegra: Don't allow suspend when Tegra PCIe is in EP mode
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. Bug 200715162 Change-Id: I11f8f0c2f4e293535646147c81f2486791f51dbe Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com> Signed-off-by: Om Prakash Singh <omp@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2509192 Reviewed-by: Vidya Sagar <vidyas@nvidia.com> Reviewed-by: Bibek Basu <bbasu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit
-rw-r--r--drivers/pci/dwc/pcie-tegra.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/pci/dwc/pcie-tegra.c b/drivers/pci/dwc/pcie-tegra.c
index 210c96162..923cf7c30 100644
--- a/drivers/pci/dwc/pcie-tegra.c
+++ b/drivers/pci/dwc/pcie-tegra.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2017 - 2020, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2017 - 2021, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License, 5 * under the terms and conditions of the GNU General Public License,
@@ -4591,6 +4591,11 @@ static int tegra_pcie_dw_suspend_late(struct device *dev)
4591 struct tegra_pcie_dw *pcie = dev_get_drvdata(dev); 4591 struct tegra_pcie_dw *pcie = dev_get_drvdata(dev);
4592 u32 val; 4592 u32 val;
4593 4593
4594 if (pcie->mode == DW_PCIE_EP_TYPE) {
4595 dev_err(dev, "Tegra PCIe is in EP mode, suspend not allowed");
4596 return -EPERM;
4597 }
4598
4594 if (!pcie->link_state && pcie->power_down_en) 4599 if (!pcie->link_state && pcie->power_down_en)
4595 return 0; 4600 return 0;
4596 4601