[V3,19/21] PCI: tegra194: Free up EP resources during remove()

Message ID 20221013183854.21087-20-vidyas@nvidia.com
State New
Headers
Series Enhancements to pcie-tegra194 driver |

Commit Message

Vidya Sagar Oct. 13, 2022, 6:38 p.m. UTC
  Free up the resources during remove() that were acquired by the DesignWare
driver for the endpoint mode during proble().

Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
---
V3:
* This is a new patch in this series

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

Comments

Lorenzo Pieralisi Jan. 13, 2023, 3:28 p.m. UTC | #1
On Fri, Oct 14, 2022 at 12:08:52AM +0530, Vidya Sagar wrote:
> Free up the resources during remove() that were acquired by the DesignWare
> driver for the endpoint mode during proble().

s/proble/probe

> Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
> ---
> V3:
> * This is a new patch in this series
> 
>  drivers/pci/controller/dwc/pcie-tegra194.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
> index 3baf1a26fe68..c88c36d85ee5 100644
> --- a/drivers/pci/controller/dwc/pcie-tegra194.c
> +++ b/drivers/pci/controller/dwc/pcie-tegra194.c
> @@ -2383,6 +2383,7 @@ static int tegra_pcie_dw_probe(struct platform_device *pdev)
>  static int tegra_pcie_dw_remove(struct platform_device *pdev)
>  {
>  	struct tegra_pcie_dw *pcie = platform_get_drvdata(pdev);
> +	struct dw_pcie_ep *ep = &pcie->pci.ep;
>  
>  	if (pcie->of_data->mode == DW_PCIE_RC_TYPE) {
>  		if (!pcie->link_state && !pcie->slot_pluggable)
> @@ -2396,6 +2397,7 @@ static int tegra_pcie_dw_remove(struct platform_device *pdev)
>  	} else {
>  		disable_irq(pcie->pex_rst_irq);
>  		pex_ep_event_pex_rst_assert(pcie);
> +		dw_pcie_ep_exit(ep);
>  	}
>  
>  	pm_runtime_disable(pcie->dev);
> -- 
> 2.17.1
> 
> 
> -- 
> linux-phy mailing list
> linux-phy@lists.infradead.org
> https://lists.infradead.org/mailman/listinfo/linux-phy
  

Patch

diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
index 3baf1a26fe68..c88c36d85ee5 100644
--- a/drivers/pci/controller/dwc/pcie-tegra194.c
+++ b/drivers/pci/controller/dwc/pcie-tegra194.c
@@ -2383,6 +2383,7 @@  static int tegra_pcie_dw_probe(struct platform_device *pdev)
 static int tegra_pcie_dw_remove(struct platform_device *pdev)
 {
 	struct tegra_pcie_dw *pcie = platform_get_drvdata(pdev);
+	struct dw_pcie_ep *ep = &pcie->pci.ep;
 
 	if (pcie->of_data->mode == DW_PCIE_RC_TYPE) {
 		if (!pcie->link_state && !pcie->slot_pluggable)
@@ -2396,6 +2397,7 @@  static int tegra_pcie_dw_remove(struct platform_device *pdev)
 	} else {
 		disable_irq(pcie->pex_rst_irq);
 		pex_ep_event_pex_rst_assert(pcie);
+		dw_pcie_ep_exit(ep);
 	}
 
 	pm_runtime_disable(pcie->dev);