All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: rawnand: Fix runtime PM imbalance on error
@ 2020-05-22 10:40 ` Dinghao Liu
  0 siblings, 0 replies; 6+ messages in thread
From: Dinghao Liu @ 2020-05-22 10:40 UTC (permalink / raw)
  To: dinghao.liu, kjlu
  Cc: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Thomas Gleixner, Allison Randal, Greg Kroah-Hartman, linux-mtd,
	linux-kernel

pm_runtime_get_sync() increments the runtime PM usage counter even
when 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/mtd/nand/raw/omap_elm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/nand/raw/omap_elm.c b/drivers/mtd/nand/raw/omap_elm.c
index 3fa0e2cbbe53..078b1022ac2a 100644
--- a/drivers/mtd/nand/raw/omap_elm.c
+++ b/drivers/mtd/nand/raw/omap_elm.c
@@ -411,6 +411,7 @@ static int elm_probe(struct platform_device *pdev)
 	pm_runtime_enable(&pdev->dev);
 	if (pm_runtime_get_sync(&pdev->dev) < 0) {
 		ret = -EINVAL;
+		pm_runtime_put_sync(&pdev->dev);
 		pm_runtime_disable(&pdev->dev);
 		dev_err(&pdev->dev, "can't enable clock\n");
 		return ret;
-- 
2.17.1


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

* [PATCH] mtd: rawnand: Fix runtime PM imbalance on error
@ 2020-05-22 10:40 ` Dinghao Liu
  0 siblings, 0 replies; 6+ messages in thread
From: Dinghao Liu @ 2020-05-22 10:40 UTC (permalink / raw)
  To: dinghao.liu, kjlu
  Cc: Vignesh Raghavendra, Richard Weinberger, Miquel Raynal,
	linux-kernel, linux-mtd, Greg Kroah-Hartman, Thomas Gleixner,
	Allison Randal

pm_runtime_get_sync() increments the runtime PM usage counter even
when 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/mtd/nand/raw/omap_elm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/nand/raw/omap_elm.c b/drivers/mtd/nand/raw/omap_elm.c
index 3fa0e2cbbe53..078b1022ac2a 100644
--- a/drivers/mtd/nand/raw/omap_elm.c
+++ b/drivers/mtd/nand/raw/omap_elm.c
@@ -411,6 +411,7 @@ static int elm_probe(struct platform_device *pdev)
 	pm_runtime_enable(&pdev->dev);
 	if (pm_runtime_get_sync(&pdev->dev) < 0) {
 		ret = -EINVAL;
+		pm_runtime_put_sync(&pdev->dev);
 		pm_runtime_disable(&pdev->dev);
 		dev_err(&pdev->dev, "can't enable clock\n");
 		return ret;
-- 
2.17.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH] mtd: rawnand: Fix runtime PM imbalance on error
  2020-05-22 10:40 ` Dinghao Liu
@ 2020-05-24 19:02   ` Miquel Raynal
  -1 siblings, 0 replies; 6+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:02 UTC (permalink / raw)
  To: Dinghao Liu, kjlu
  Cc: Miquel Raynal, Vignesh Raghavendra, Richard Weinberger,
	linux-kernel, linux-mtd, Greg Kroah-Hartman, Thomas Gleixner,
	Allison Randal

On Fri, 2020-05-22 at 10:40:06 UTC, Dinghao Liu wrote:
> pm_runtime_get_sync() increments the runtime PM usage counter even
> when 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>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

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

* Re: [PATCH] mtd: rawnand: Fix runtime PM imbalance on error
@ 2020-05-24 19:02   ` Miquel Raynal
  0 siblings, 0 replies; 6+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:02 UTC (permalink / raw)
  To: Dinghao Liu, kjlu
  Cc: Vignesh Raghavendra, Richard Weinberger, Miquel Raynal,
	linux-kernel, linux-mtd, Greg Kroah-Hartman, Thomas Gleixner,
	Allison Randal

On Fri, 2020-05-22 at 10:40:06 UTC, Dinghao Liu wrote:
> pm_runtime_get_sync() increments the runtime PM usage counter even
> when 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>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH] mtd: rawnand: Fix runtime PM imbalance on error
  2020-05-24 19:02   ` Miquel Raynal
@ 2020-05-24 19:08     ` Miquel Raynal
  -1 siblings, 0 replies; 6+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:08 UTC (permalink / raw)
  To: Dinghao Liu, kjlu
  Cc: Vignesh Raghavendra, Richard Weinberger, linux-kernel, linux-mtd,
	Greg Kroah-Hartman, Thomas Gleixner, Allison Randal


Miquel Raynal <miquel.raynal@bootlin.com> wrote on Sun, 24 May 2020
21:02:59 +0200:

> On Fri, 2020-05-22 at 10:40:06 UTC, Dinghao Liu wrote:
> > pm_runtime_get_sync() increments the runtime PM usage counter even
> > when 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>  
> 
> Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.
> 
> Miquel

FYI I changed the title to integrate the driver's name.

Miquèl

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

* Re: [PATCH] mtd: rawnand: Fix runtime PM imbalance on error
@ 2020-05-24 19:08     ` Miquel Raynal
  0 siblings, 0 replies; 6+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:08 UTC (permalink / raw)
  To: Dinghao Liu, kjlu
  Cc: Vignesh Raghavendra, Richard Weinberger, linux-kernel, linux-mtd,
	Greg Kroah-Hartman, Thomas Gleixner, Allison Randal


Miquel Raynal <miquel.raynal@bootlin.com> wrote on Sun, 24 May 2020
21:02:59 +0200:

> On Fri, 2020-05-22 at 10:40:06 UTC, Dinghao Liu wrote:
> > pm_runtime_get_sync() increments the runtime PM usage counter even
> > when 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>  
> 
> Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.
> 
> Miquel

FYI I changed the title to integrate the driver's name.

Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

end of thread, other threads:[~2020-05-24 19:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-22 10:40 [PATCH] mtd: rawnand: Fix runtime PM imbalance on error Dinghao Liu
2020-05-22 10:40 ` Dinghao Liu
2020-05-24 19:02 ` Miquel Raynal
2020-05-24 19:02   ` Miquel Raynal
2020-05-24 19:08   ` Miquel Raynal
2020-05-24 19:08     ` Miquel Raynal

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.