linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: dwc: pci-dra7xx: fix runtime pm imbalance on error
@ 2020-05-20  8:47 Dinghao Liu
  2020-07-06 11:11 ` Lorenzo Pieralisi
  0 siblings, 1 reply; 2+ messages in thread
From: Dinghao Liu @ 2020-05-20  8:47 UTC (permalink / raw)
  To: dinghao.liu, kjlu
  Cc: Kishon Vijay Abraham I, Lorenzo Pieralisi, Rob Herring,
	Bjorn Helgaas, linux-omap, 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/dwc/pci-dra7xx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pci/controller/dwc/pci-dra7xx.c b/drivers/pci/controller/dwc/pci-dra7xx.c
index 3b0e58f2de58..8fd9f2281e02 100644
--- a/drivers/pci/controller/dwc/pci-dra7xx.c
+++ b/drivers/pci/controller/dwc/pci-dra7xx.c
@@ -1000,9 +1000,8 @@ static int __init dra7xx_pcie_probe(struct platform_device *pdev)
 	return 0;
 
 err_gpio:
-	pm_runtime_put(dev);
-
 err_get_sync:
+	pm_runtime_put(dev);
 	pm_runtime_disable(dev);
 	dra7xx_pcie_disable_phy(dra7xx);
 
-- 
2.17.1


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

* Re: [PATCH] PCI: dwc: pci-dra7xx: fix runtime pm imbalance on error
  2020-05-20  8:47 [PATCH] PCI: dwc: pci-dra7xx: fix runtime pm imbalance on error Dinghao Liu
@ 2020-07-06 11:11 ` Lorenzo Pieralisi
  0 siblings, 0 replies; 2+ messages in thread
From: Lorenzo Pieralisi @ 2020-07-06 11:11 UTC (permalink / raw)
  To: Dinghao Liu
  Cc: kjlu, Kishon Vijay Abraham I, Rob Herring, Bjorn Helgaas,
	linux-omap, linux-pci, linux-kernel

On Wed, May 20, 2020 at 04:47:56PM +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/dwc/pci-dra7xx.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/controller/dwc/pci-dra7xx.c b/drivers/pci/controller/dwc/pci-dra7xx.c
> index 3b0e58f2de58..8fd9f2281e02 100644
> --- a/drivers/pci/controller/dwc/pci-dra7xx.c
> +++ b/drivers/pci/controller/dwc/pci-dra7xx.c
> @@ -1000,9 +1000,8 @@ static int __init dra7xx_pcie_probe(struct platform_device *pdev)
>  	return 0;
>  
>  err_gpio:
> -	pm_runtime_put(dev);
> -
>  err_get_sync:
> +	pm_runtime_put(dev);
>  	pm_runtime_disable(dev);
>  	dra7xx_pcie_disable_phy(dra7xx);

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:11 UTC | newest]

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

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).