linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Clark Wang <xiaoning.wang@nxp.com>
To: broonie@kernel.org
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/5] spi: lpspi: fix the imbalance of runtime pm function call
Date: Tue, 14 Jul 2020 15:52:47 +0800	[thread overview]
Message-ID: <20200714075251.12777-2-xiaoning.wang@nxp.com> (raw)
In-Reply-To: <20200714075251.12777-1-xiaoning.wang@nxp.com>

Call the put function after probe successfully. Otherwise, the lpspi
module will keep active status until the first spi transfer called.

Disable runtime pm when probe fails. There is no need to active runtime
pm after probe failed.

Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
---
 drivers/spi/spi-fsl-lpspi.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c
index 1552b28b9515..a1555bbc5e5a 100644
--- a/drivers/spi/spi-fsl-lpspi.c
+++ b/drivers/spi/spi-fsl-lpspi.c
@@ -954,10 +954,15 @@ static int fsl_lpspi_probe(struct platform_device *pdev)
 	if (ret < 0)
 		dev_err(&pdev->dev, "dma setup error %d, use pio\n", ret);
 
+	pm_runtime_mark_last_busy(fsl_lpspi->dev);
+	pm_runtime_put_autosuspend(fsl_lpspi->dev);
+
 	return 0;
 
 out_pm_get:
-	pm_runtime_put_noidle(fsl_lpspi->dev);
+	pm_runtime_dont_use_autosuspend(fsl_lpspi->dev);
+	pm_runtime_put_sync(fsl_lpspi->dev);
+	pm_runtime_disable(fsl_lpspi->dev);
 out_controller_put:
 	spi_controller_put(controller);
 
-- 
2.17.1


  reply	other threads:[~2020-07-14  7:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-14  7:52 [PATCH 0/5] Some bug fix for lpspi Clark Wang
2020-07-14  7:52 ` Clark Wang [this message]
2020-07-14  7:52 ` [PATCH 2/5] spi: lpspi: add NULL check when probe device Clark Wang
2020-07-21 23:44   ` Mark Brown
2020-07-14  7:52 ` [PATCH 3/5] spi: lpspi: fix kernel warning dump when probe fail after calling spi_register Clark Wang
2020-07-14 11:37   ` Mark Brown
2020-07-21 22:47   ` Mark Brown
2020-07-14  7:52 ` [PATCH 4/5] spi: lpspi: handle EPROBE_DEFER when get cs-gpios number Clark Wang
2020-07-14  7:52 ` [PATCH 5/5] spi: lpspi: fix using CS discontinuously on i.MX8DXLEVK Clark Wang
2020-07-22 13:45 ` [PATCH 0/5] Some bug fix for lpspi Mark Brown

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=20200714075251.12777-2-xiaoning.wang@nxp.com \
    --to=xiaoning.wang@nxp.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    /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).