linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: tegra20-slink: add missing pm_runtime_put
@ 2020-06-02  5:26 Navid Emamdoost
       [not found] ` <20200602052602.91374-1-navid.emamdoost-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Navid Emamdoost @ 2020-06-02  5:26 UTC (permalink / raw)
  To: Laxman Dewangan, Mark Brown, Thierry Reding, Jonathan Hunter,
	linux-spi-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: emamd001-OJFnDUYgAso, wu000273-OJFnDUYgAso, kjlu-OJFnDUYgAso,
	smccaman-OJFnDUYgAso, Navid Emamdoost

Call to pm_runtime_get_sync increments counter even in case of
failure leading to incorrect ref count.
Call pm_runtime_put if pm_runtime_get_sync fails.

Signed-off-by: Navid Emamdoost <navid.emamdoost-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 drivers/spi/spi-tegra20-slink.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c
index 7f4d932dade7..0675b36d647b 100644
--- a/drivers/spi/spi-tegra20-slink.c
+++ b/drivers/spi/spi-tegra20-slink.c
@@ -1192,6 +1192,7 @@ static int tegra_slink_resume(struct device *dev)
 	ret = pm_runtime_get_sync(dev);
 	if (ret < 0) {
 		dev_err(dev, "pm runtime failed, e = %d\n", ret);
+		pm_runtime_put(dev);
 		return ret;
 	}
 	tegra_slink_writel(tspi, tspi->command_reg, SLINK_COMMAND);
-- 
2.17.1

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

* Re: [PATCH] spi: tegra20-slink: add missing pm_runtime_put
       [not found] ` <20200602052602.91374-1-navid.emamdoost-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2020-06-05  6:02   ` Jon Hunter
  0 siblings, 0 replies; 2+ messages in thread
From: Jon Hunter @ 2020-06-05  6:02 UTC (permalink / raw)
  To: Navid Emamdoost, Laxman Dewangan, Mark Brown, Thierry Reding,
	linux-spi-u79uwXL29TY76Z2rM5mHXA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: emamd001-OJFnDUYgAso, wu000273-OJFnDUYgAso, kjlu-OJFnDUYgAso,
	smccaman-OJFnDUYgAso


On 02/06/2020 06:26, Navid Emamdoost wrote:
> Call to pm_runtime_get_sync increments counter even in case of
> failure leading to incorrect ref count.
> Call pm_runtime_put if pm_runtime_get_sync fails.
> 
> Signed-off-by: Navid Emamdoost <navid.emamdoost-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
>  drivers/spi/spi-tegra20-slink.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c
> index 7f4d932dade7..0675b36d647b 100644
> --- a/drivers/spi/spi-tegra20-slink.c
> +++ b/drivers/spi/spi-tegra20-slink.c
> @@ -1192,6 +1192,7 @@ static int tegra_slink_resume(struct device *dev)
>  	ret = pm_runtime_get_sync(dev);
>  	if (ret < 0) {
>  		dev_err(dev, "pm runtime failed, e = %d\n", ret);
> +		pm_runtime_put(dev);
>  		return ret;
>  	}
>  	tegra_slink_writel(tspi, tspi->command_reg, SLINK_COMMAND);

Please squash this patch with the other 2 that are fixing the same
issues in the same driver.

Jon

-- 
nvpublic

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-02  5:26 [PATCH] spi: tegra20-slink: add missing pm_runtime_put Navid Emamdoost
     [not found] ` <20200602052602.91374-1-navid.emamdoost-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-06-05  6:02   ` 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).