All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI: cadence: fix runtime pm imbalance on error
@ 2020-05-20  9:02 Dinghao Liu
  2020-07-06 11:12 ` Lorenzo Pieralisi
  0 siblings, 1 reply; 2+ messages in thread
From: Dinghao Liu @ 2020-05-20  9:02 UTC (permalink / raw)
  To: dinghao.liu, kjlu
  Cc: Tom Joseph, Lorenzo Pieralisi, Rob Herring, Bjorn Helgaas,
	linux-pci, linux-kernel

pm_runtime_get_sync() increments the runtime PM usage counter even
it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
---
 drivers/pci/controller/cadence/pcie-cadence-plat.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pci/controller/cadence/pcie-cadence-plat.c b/drivers/pci/controller/cadence/pcie-cadence-plat.c
index f5c6bf6dfcb8..33c3868e6dbd 100644
--- a/drivers/pci/controller/cadence/pcie-cadence-plat.c
+++ b/drivers/pci/controller/cadence/pcie-cadence-plat.c
@@ -115,9 +115,8 @@ static int cdns_plat_pcie_probe(struct platform_device *pdev)
 	}
 
  err_init:
-	pm_runtime_put_sync(dev);
-
  err_get_sync:
+	pm_runtime_put_sync(dev);
 	pm_runtime_disable(dev);
 	cdns_pcie_disable_phy(cdns_plat_pcie->pcie);
 	phy_count = cdns_plat_pcie->pcie->phy_count;
-- 
2.17.1


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

* Re: [PATCH] PCI: cadence: fix runtime pm imbalance on error
  2020-05-20  9:02 [PATCH] PCI: cadence: fix runtime pm imbalance on error Dinghao Liu
@ 2020-07-06 11:12 ` Lorenzo Pieralisi
  0 siblings, 0 replies; 2+ messages in thread
From: Lorenzo Pieralisi @ 2020-07-06 11:12 UTC (permalink / raw)
  To: Dinghao Liu
  Cc: kjlu, Tom Joseph, Rob Herring, Bjorn Helgaas, linux-pci, linux-kernel

On Wed, May 20, 2020 at 05:02:53PM +0800, Dinghao Liu wrote:
> pm_runtime_get_sync() increments the runtime PM usage counter even
> it returns an error code. Thus a pairing decrement is needed on
> the error handling path to keep the counter balanced.
> 
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
> ---
>  drivers/pci/controller/cadence/pcie-cadence-plat.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/controller/cadence/pcie-cadence-plat.c b/drivers/pci/controller/cadence/pcie-cadence-plat.c
> index f5c6bf6dfcb8..33c3868e6dbd 100644
> --- a/drivers/pci/controller/cadence/pcie-cadence-plat.c
> +++ b/drivers/pci/controller/cadence/pcie-cadence-plat.c
> @@ -115,9 +115,8 @@ static int cdns_plat_pcie_probe(struct platform_device *pdev)
>  	}
>  
>   err_init:
> -	pm_runtime_put_sync(dev);
> -
>   err_get_sync:
> +	pm_runtime_put_sync(dev);
>  	pm_runtime_disable(dev);
>  	cdns_pcie_disable_phy(cdns_plat_pcie->pcie);
>  	phy_count = cdns_plat_pcie->pcie->phy_count;

Applied to pci/runtime-pm, thanks.

Lorenzo

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

end of thread, other threads:[~2020-07-06 11:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-20  9:02 [PATCH] PCI: cadence: fix runtime pm imbalance on error Dinghao Liu
2020-07-06 11:12 ` Lorenzo Pieralisi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.