linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: <Tudor.Ambarus@microchip.com>
To: <dinghao.liu@zju.edu.cn>, <kjlu@umn.edu>
Cc: thor.thayer@linux.intel.com, vigneshr@ti.com,
	bbrezillon@kernel.org, richard@nod.at,
	linux-kernel@vger.kernel.org, swboyd@chromium.org,
	michael@walle.cc, linux-mtd@lists.infradead.org,
	p.zabel@pengutronix.de, miquel.raynal@bootlin.com,
	tglx@linutronix.de
Subject: Re: [PATCH] mtd: spi-nor: Fix runtime PM imbalance in cqspi_probe
Date: Wed, 1 Jul 2020 07:58:52 +0000	[thread overview]
Message-ID: <328b6db3-3298-047e-51a1-d9a8bfded41a@microchip.com> (raw)
In-Reply-To: <20200522100520.22130-1-dinghao.liu@zju.edu.cn>

On 5/22/20 1:05 PM, Dinghao Liu wrote:
> When devm_reset_control_get_optional_exclusive() returns
> an error code, a pairing runtime PM usage counter
> decrement is needed to keep the counter balanced.
> 
> Also, call pm_runtime_disable() when pm_runtime_get_sync()
> and devm_reset_control_get_optional_exclusive() return an
> error code.
> 

I see that this is now fixed with the move to drivers/spi/spi-cadence-quadspi.c

Thanks,
ta

> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
> ---
>  drivers/mtd/spi-nor/controllers/cadence-quadspi.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/mtd/spi-nor/controllers/cadence-quadspi.c b/drivers/mtd/spi-nor/controllers/cadence-quadspi.c
> index 494dcab4aaaa..eabdf01e0d08 100644
> --- a/drivers/mtd/spi-nor/controllers/cadence-quadspi.c
> +++ b/drivers/mtd/spi-nor/controllers/cadence-quadspi.c
> @@ -1377,6 +1377,7 @@ static int cqspi_probe(struct platform_device *pdev)
>  	ret = pm_runtime_get_sync(dev);
>  	if (ret < 0) {
>  		pm_runtime_put_noidle(dev);
> +		pm_runtime_disable(dev);
>  		return ret;
>  	}
>  
> @@ -1390,12 +1391,16 @@ static int cqspi_probe(struct platform_device *pdev)
>  	rstc = devm_reset_control_get_optional_exclusive(dev, "qspi");
>  	if (IS_ERR(rstc)) {
>  		dev_err(dev, "Cannot get QSPI reset.\n");
> +		pm_runtime_put_sync(dev);
> +		pm_runtime_disable(dev);
>  		return PTR_ERR(rstc);
>  	}
>  
>  	rstc_ocp = devm_reset_control_get_optional_exclusive(dev, "qspi-ocp");
>  	if (IS_ERR(rstc_ocp)) {
>  		dev_err(dev, "Cannot get QSPI OCP reset.\n");
> +		pm_runtime_put_sync(dev);
> +		pm_runtime_disable(dev);
>  		return PTR_ERR(rstc_ocp);
>  	}
>  
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

      reply	other threads:[~2020-07-01  7:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-22 10:05 [PATCH] mtd: spi-nor: Fix runtime PM imbalance in cqspi_probe Dinghao Liu
2020-07-01  7:58 ` Tudor.Ambarus [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=328b6db3-3298-047e-51a1-d9a8bfded41a@microchip.com \
    --to=tudor.ambarus@microchip.com \
    --cc=bbrezillon@kernel.org \
    --cc=dinghao.liu@zju.edu.cn \
    --cc=kjlu@umn.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=michael@walle.cc \
    --cc=miquel.raynal@bootlin.com \
    --cc=p.zabel@pengutronix.de \
    --cc=richard@nod.at \
    --cc=swboyd@chromium.org \
    --cc=tglx@linutronix.de \
    --cc=thor.thayer@linux.intel.com \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).