From dbfc138f5ef308675071acde3678cbc6d2d2d2b4 Mon Sep 17 00:00:00 2001 From: Om Prakash Singh Date: Thu, 1 Apr 2021 16:50:50 +0530 Subject: 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 Signed-off-by: Om Prakash Singh Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2509192 Reviewed-by: Vidya Sagar Reviewed-by: Bibek Basu Reviewed-by: mobile promotions Tested-by: mobile promotions GVS: Gerrit_Virtual_Submit --- drivers/pci/dwc/pcie-tegra.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 @@ /* - * Copyright (c) 2017 - 2020, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017 - 2021, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * 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) struct tegra_pcie_dw *pcie = dev_get_drvdata(dev); u32 val; + if (pcie->mode == DW_PCIE_EP_TYPE) { + dev_err(dev, "Tegra PCIe is in EP mode, suspend not allowed"); + return -EPERM; + } + if (!pcie->link_state && pcie->power_down_en) return 0; -- cgit v1.2.2