diff mbox series

[V2,4/5] PCI: tegra: Don't allow suspend when Tegra PCIe is in EP mode

Message ID 20210606082204.14222-5-omp@nvidia.com (mailing list archive)
State New
Delegated to: Lorenzo Pieralisi
Headers show
Series Update pcie-tegra194 driver | expand

Commit Message

Om Prakash Singh June 6, 2021, 8:22 a.m. UTC
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.

Signed-off-by: Om Prakash Singh <omp@nvidia.com>
---

Changes in V2:
	- Update return value and error log as per comment from Krzysztof Wilczyński

 drivers/pci/controller/dwc/pcie-tegra194.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Vidya Sagar June 8, 2021, 10:38 a.m. UTC | #1
On 6/6/2021 1:52 PM, Om Prakash Singh wrote:
> 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.
> 
> Signed-off-by: Om Prakash Singh <omp@nvidia.com>
> ---
> 
> Changes in V2:
> 	- Update return value and error log as per comment from Krzysztof Wilczyński
> 
>   drivers/pci/controller/dwc/pcie-tegra194.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
> index 64ec0da31b5b..ae4c0a29818d 100644
> --- a/drivers/pci/controller/dwc/pcie-tegra194.c
> +++ b/drivers/pci/controller/dwc/pcie-tegra194.c
> @@ -2276,6 +2276,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, "Suspend is not supported in EP mode");
> +		return -ENOTSUPP;
> +	}
> +
>   	if (!pcie->link_state)
>   		return 0;
>   
> 
Acked-by: Vidya Sagar <vidyas@nvidia.com>
diff mbox series

Patch

diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
index 64ec0da31b5b..ae4c0a29818d 100644
--- a/drivers/pci/controller/dwc/pcie-tegra194.c
+++ b/drivers/pci/controller/dwc/pcie-tegra194.c
@@ -2276,6 +2276,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, "Suspend is not supported in EP mode");
+		return -ENOTSUPP;
+	}
+
 	if (!pcie->link_state)
 		return 0;