linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: tegra194: Fix PM error handling in tegra_pcie_config_ep
@ 2022-06-02  3:19 Miaoqian Lin
  2022-06-02 11:34 ` Vidya Sagar
  2022-06-08 21:18 ` Bjorn Helgaas
  0 siblings, 2 replies; 3+ messages in thread
From: Miaoqian Lin @ 2022-06-02  3:19 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Rob Herring, Krzysztof Wilczyński,
	Bjorn Helgaas, Thierry Reding, Jonathan Hunter, Vidya Sagar,
	Om Prakash Singh, Fan Fei, Miaoqian Lin, linux-pci, linux-tegra,
	linux-kernel

The pm_runtime_enable() will increase power disable depth.
if dw_pcie_ep_init() fails, we should use pm_runtime_disable()
to balance it pm_runtime_enable().
Add missing pm_runtime_disable() for tegra_pcie_config_ep()

Fixes: c57247f940e8 ("PCI: tegra: Add support for PCIe endpoint mode in Tegra194")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 drivers/pci/controller/dwc/pcie-tegra194.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
index cc2678490162..d992371a36e6 100644
--- a/drivers/pci/controller/dwc/pcie-tegra194.c
+++ b/drivers/pci/controller/dwc/pcie-tegra194.c
@@ -1949,6 +1949,7 @@ static int tegra_pcie_config_ep(struct tegra194_pcie *pcie,
 	if (ret) {
 		dev_err(dev, "Failed to initialize DWC Endpoint subsystem: %d\n",
 			ret);
+		pm_runtime_disable(dev);
 		return ret;
 	}
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] PCI: tegra194: Fix PM error handling in tegra_pcie_config_ep
  2022-06-02  3:19 [PATCH] PCI: tegra194: Fix PM error handling in tegra_pcie_config_ep Miaoqian Lin
@ 2022-06-02 11:34 ` Vidya Sagar
  2022-06-08 21:18 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Vidya Sagar @ 2022-06-02 11:34 UTC (permalink / raw)
  To: Miaoqian Lin, Lorenzo Pieralisi, Rob Herring,
	Krzysztof Wilczyński, Bjorn Helgaas, Thierry Reding,
	Jonathan Hunter, Om Prakash Singh, Fan Fei, linux-pci,
	linux-tegra, linux-kernel

Thanks for pushing the change.

Reviewed-by: Vidya Sagar <vidyas@nvidia.com>

On 6/2/2022 8:49 AM, Miaoqian Lin wrote:
> External email: Use caution opening links or attachments
> 
> 
> The pm_runtime_enable() will increase power disable depth.
> if dw_pcie_ep_init() fails, we should use pm_runtime_disable()
> to balance it pm_runtime_enable().
> Add missing pm_runtime_disable() for tegra_pcie_config_ep()
> 
> Fixes: c57247f940e8 ("PCI: tegra: Add support for PCIe endpoint mode in Tegra194")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> ---
>   drivers/pci/controller/dwc/pcie-tegra194.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
> index cc2678490162..d992371a36e6 100644
> --- a/drivers/pci/controller/dwc/pcie-tegra194.c
> +++ b/drivers/pci/controller/dwc/pcie-tegra194.c
> @@ -1949,6 +1949,7 @@ static int tegra_pcie_config_ep(struct tegra194_pcie *pcie,
>          if (ret) {
>                  dev_err(dev, "Failed to initialize DWC Endpoint subsystem: %d\n",
>                          ret);
> +               pm_runtime_disable(dev);
>                  return ret;
>          }
> 
> --
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] PCI: tegra194: Fix PM error handling in tegra_pcie_config_ep
  2022-06-02  3:19 [PATCH] PCI: tegra194: Fix PM error handling in tegra_pcie_config_ep Miaoqian Lin
  2022-06-02 11:34 ` Vidya Sagar
@ 2022-06-08 21:18 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2022-06-08 21:18 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Lorenzo Pieralisi, Rob Herring, Krzysztof Wilczyński,
	Bjorn Helgaas, Thierry Reding, Jonathan Hunter, Vidya Sagar,
	Om Prakash Singh, Fan Fei, linux-pci, linux-tegra, linux-kernel

On Thu, Jun 02, 2022 at 07:19:08AM +0400, Miaoqian Lin wrote:
> The pm_runtime_enable() will increase power disable depth.
> if dw_pcie_ep_init() fails, we should use pm_runtime_disable()
> to balance it pm_runtime_enable().
> Add missing pm_runtime_disable() for tegra_pcie_config_ep()
> 
> Fixes: c57247f940e8 ("PCI: tegra: Add support for PCIe endpoint mode in Tegra194")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>

Applied with Vidya's ack to pci/ctrl/tegra194 for v5.20, thanks!

> ---
>  drivers/pci/controller/dwc/pcie-tegra194.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
> index cc2678490162..d992371a36e6 100644
> --- a/drivers/pci/controller/dwc/pcie-tegra194.c
> +++ b/drivers/pci/controller/dwc/pcie-tegra194.c
> @@ -1949,6 +1949,7 @@ static int tegra_pcie_config_ep(struct tegra194_pcie *pcie,
>  	if (ret) {
>  		dev_err(dev, "Failed to initialize DWC Endpoint subsystem: %d\n",
>  			ret);
> +		pm_runtime_disable(dev);
>  		return ret;
>  	}
>  
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-08 21:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-02  3:19 [PATCH] PCI: tegra194: Fix PM error handling in tegra_pcie_config_ep Miaoqian Lin
2022-06-02 11:34 ` Vidya Sagar
2022-06-08 21:18 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).