linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: tegra20-sflash: call pm_runtime_put in case of pm_runtime_get failure
@ 2020-06-02  4:40 Navid Emamdoost
  2020-06-05  6:10 ` Jon Hunter
  0 siblings, 1 reply; 2+ messages in thread
From: Navid Emamdoost @ 2020-06-02  4:40 UTC (permalink / raw)
  To: Laxman Dewangan, Mark Brown, Thierry Reding, Jonathan Hunter,
	linux-spi, linux-tegra, linux-kernel
  Cc: emamd001, wu000273, kjlu, smccaman, Navid Emamdoost

The counter is incremented via pm_runtime_get even in failure case.
To correct the counter call pm_runtime_put in case of failure, too.

Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
---
 drivers/spi/spi-tegra20-sflash.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-tegra20-sflash.c b/drivers/spi/spi-tegra20-sflash.c
index 514429379206..33c34f9c2021 100644
--- a/drivers/spi/spi-tegra20-sflash.c
+++ b/drivers/spi/spi-tegra20-sflash.c
@@ -552,6 +552,7 @@ static int tegra_sflash_resume(struct device *dev)
 
 	ret = pm_runtime_get_sync(dev);
 	if (ret < 0) {
+		pm_runtime_put(dev);
 		dev_err(dev, "pm runtime failed, e = %d\n", ret);
 		return ret;
 	}
-- 
2.17.1


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

* Re: [PATCH] spi: tegra20-sflash: call pm_runtime_put in case of pm_runtime_get failure
  2020-06-02  4:40 [PATCH] spi: tegra20-sflash: call pm_runtime_put in case of pm_runtime_get failure Navid Emamdoost
@ 2020-06-05  6:10 ` Jon Hunter
  0 siblings, 0 replies; 2+ messages in thread
From: Jon Hunter @ 2020-06-05  6:10 UTC (permalink / raw)
  To: Navid Emamdoost, Laxman Dewangan, Mark Brown, Thierry Reding,
	linux-spi, linux-tegra, linux-kernel
  Cc: emamd001, wu000273, kjlu, smccaman


On 02/06/2020 05:40, Navid Emamdoost wrote:
> The counter is incremented via pm_runtime_get even in failure case.
> To correct the counter call pm_runtime_put in case of failure, too.
> 
> Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
> ---
>  drivers/spi/spi-tegra20-sflash.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/spi/spi-tegra20-sflash.c b/drivers/spi/spi-tegra20-sflash.c
> index 514429379206..33c34f9c2021 100644
> --- a/drivers/spi/spi-tegra20-sflash.c
> +++ b/drivers/spi/spi-tegra20-sflash.c
> @@ -552,6 +552,7 @@ static int tegra_sflash_resume(struct device *dev)
>  
>  	ret = pm_runtime_get_sync(dev);
>  	if (ret < 0) {
> +		pm_runtime_put(dev);
>  		dev_err(dev, "pm runtime failed, e = %d\n", ret);
>  		return ret;
>  	}

There is another instance of this in this driver that needs fixing.

Jon

-- 
nvpublic

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

end of thread, other threads:[~2020-06-05  6:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-02  4:40 [PATCH] spi: tegra20-sflash: call pm_runtime_put in case of pm_runtime_get failure Navid Emamdoost
2020-06-05  6:10 ` Jon Hunter

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