linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next 0/3] Fix PM disable depth imbalance in probe
@ 2022-09-24 12:13 Zhang Qilong
  2022-09-24 12:13 ` [PATCH -next 1/3] spi: cadence-quadspi: Fix PM disable depth imbalance in cqspi_probe Zhang Qilong
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Zhang Qilong @ 2022-09-24 12:13 UTC (permalink / raw)
  To: broonie; +Cc: linux-spi

The pm_runtime_enable will increase power disable depth. Thus
a pairing decrement is needed when error returns to keep it
balanced. This series of patches fixed it in spi probe.

Zhang Qilong (3):
  spi: cadence-quadspi: Fix PM disable depth imbalance in cqspi_probe
  spi: dw: Fix PM disable depth imbalance in dw_spi_bt1_probe
  spi/omap100k:Fix PM disable depth imbalance in omap1_spi100k_probe

 drivers/spi/spi-cadence-quadspi.c | 3 ++-
 drivers/spi/spi-dw-bt1.c          | 4 +++-
 drivers/spi/spi-omap-100k.c       | 1 +
 3 files changed, 6 insertions(+), 2 deletions(-)

-- 
2.25.1


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

* [PATCH -next 1/3] spi: cadence-quadspi: Fix PM disable depth imbalance in cqspi_probe
  2022-09-24 12:13 [PATCH -next 0/3] Fix PM disable depth imbalance in probe Zhang Qilong
@ 2022-09-24 12:13 ` Zhang Qilong
  2022-09-24 12:13 ` [PATCH -next 2/3] spi: dw: Fix PM disable depth imbalance in dw_spi_bt1_probe Zhang Qilong
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Zhang Qilong @ 2022-09-24 12:13 UTC (permalink / raw)
  To: broonie; +Cc: linux-spi

The pm_runtime_enable will increase power disable depth. Thus
a pairing decrement is needed on the error handling path to
keep it balanced according to context.

Fixes:73d5fe0462702 ("spi: cadence-quadspi: Remove spi_master_put() in probe failure path")
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
---
 drivers/spi/spi-cadence-quadspi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index e12ab5b43f34..447230547945 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -1645,7 +1645,7 @@ static int cqspi_probe(struct platform_device *pdev)
 	pm_runtime_enable(dev);
 	ret = pm_runtime_resume_and_get(dev);
 	if (ret < 0)
-		return ret;
+		goto probe_pm_failed;
 
 	ret = clk_prepare_enable(cqspi->clk);
 	if (ret) {
@@ -1740,6 +1740,7 @@ static int cqspi_probe(struct platform_device *pdev)
 	clk_disable_unprepare(cqspi->clk);
 probe_clk_failed:
 	pm_runtime_put_sync(dev);
+probe_pm_failed:
 	pm_runtime_disable(dev);
 	return ret;
 }
-- 
2.25.1


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

* [PATCH -next 2/3] spi: dw: Fix PM disable depth imbalance in dw_spi_bt1_probe
  2022-09-24 12:13 [PATCH -next 0/3] Fix PM disable depth imbalance in probe Zhang Qilong
  2022-09-24 12:13 ` [PATCH -next 1/3] spi: cadence-quadspi: Fix PM disable depth imbalance in cqspi_probe Zhang Qilong
@ 2022-09-24 12:13 ` Zhang Qilong
  2022-09-24 12:13 ` [PATCH -next 3/3] spi/omap100k:Fix PM disable depth imbalance in omap1_spi100k_probe Zhang Qilong
  2022-09-27 10:34 ` [PATCH -next 0/3] Fix PM disable depth imbalance in probe Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Zhang Qilong @ 2022-09-24 12:13 UTC (permalink / raw)
  To: broonie; +Cc: linux-spi

The pm_runtime_enable will increase power disable depth. Thus
a pairing decrement is needed on the error handling path to
keep it balanced according to context.

Fixes:abf00907538e2 ("spi: dw: Add Baikal-T1 SPI Controller glue driver")
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
---
 drivers/spi/spi-dw-bt1.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-dw-bt1.c b/drivers/spi/spi-dw-bt1.c
index c06553416123..3fb89dee595e 100644
--- a/drivers/spi/spi-dw-bt1.c
+++ b/drivers/spi/spi-dw-bt1.c
@@ -293,8 +293,10 @@ static int dw_spi_bt1_probe(struct platform_device *pdev)
 	pm_runtime_enable(&pdev->dev);
 
 	ret = dw_spi_add_host(&pdev->dev, dws);
-	if (ret)
+	if (ret) {
+		pm_runtime_disable(&pdev->dev);
 		goto err_disable_clk;
+	}
 
 	platform_set_drvdata(pdev, dwsbt1);
 
-- 
2.25.1


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

* [PATCH -next 3/3] spi/omap100k:Fix PM disable depth imbalance in omap1_spi100k_probe
  2022-09-24 12:13 [PATCH -next 0/3] Fix PM disable depth imbalance in probe Zhang Qilong
  2022-09-24 12:13 ` [PATCH -next 1/3] spi: cadence-quadspi: Fix PM disable depth imbalance in cqspi_probe Zhang Qilong
  2022-09-24 12:13 ` [PATCH -next 2/3] spi: dw: Fix PM disable depth imbalance in dw_spi_bt1_probe Zhang Qilong
@ 2022-09-24 12:13 ` Zhang Qilong
  2022-09-27 10:34 ` [PATCH -next 0/3] Fix PM disable depth imbalance in probe Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Zhang Qilong @ 2022-09-24 12:13 UTC (permalink / raw)
  To: broonie; +Cc: linux-spi

The pm_runtime_enable will increase power disable depth. Thus
a pairing decrement is needed on the error handling path to
keep it balanced according to context.

Fixes:db91841b58f9a ("spi/omap100k: Convert to runtime PM")
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
---
 drivers/spi/spi-omap-100k.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-omap-100k.c b/drivers/spi/spi-omap-100k.c
index 20b047172965..061f7394e5b9 100644
--- a/drivers/spi/spi-omap-100k.c
+++ b/drivers/spi/spi-omap-100k.c
@@ -412,6 +412,7 @@ static int omap1_spi100k_probe(struct platform_device *pdev)
 	return status;
 
 err_fck:
+	pm_runtime_disable(&pdev->dev);
 	clk_disable_unprepare(spi100k->fck);
 err_ick:
 	clk_disable_unprepare(spi100k->ick);
-- 
2.25.1


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

* Re: [PATCH -next 0/3] Fix PM disable depth imbalance in probe
  2022-09-24 12:13 [PATCH -next 0/3] Fix PM disable depth imbalance in probe Zhang Qilong
                   ` (2 preceding siblings ...)
  2022-09-24 12:13 ` [PATCH -next 3/3] spi/omap100k:Fix PM disable depth imbalance in omap1_spi100k_probe Zhang Qilong
@ 2022-09-27 10:34 ` Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2022-09-27 10:34 UTC (permalink / raw)
  To: Zhang Qilong; +Cc: linux-spi

On Sat, 24 Sep 2022 20:13:06 +0800, Zhang Qilong wrote:
> The pm_runtime_enable will increase power disable depth. Thus
> a pairing decrement is needed when error returns to keep it
> balanced. This series of patches fixed it in spi probe.
> 
> Zhang Qilong (3):
>   spi: cadence-quadspi: Fix PM disable depth imbalance in cqspi_probe
>   spi: dw: Fix PM disable depth imbalance in dw_spi_bt1_probe
>   spi/omap100k:Fix PM disable depth imbalance in omap1_spi100k_probe
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/3] spi: cadence-quadspi: Fix PM disable depth imbalance in cqspi_probe
      commit: 4d0ef0a1c35189a6e8377d8ee8310ea5ef22c5f3
[2/3] spi: dw: Fix PM disable depth imbalance in dw_spi_bt1_probe
      commit: 618d815fc93477b1675878f3c04ff32657cc18b4
[3/3] spi/omap100k:Fix PM disable depth imbalance in omap1_spi100k_probe
      commit: 29f65f2171c85a9633daa380df14009a365f42f2

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

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

end of thread, other threads:[~2022-09-27 10:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-24 12:13 [PATCH -next 0/3] Fix PM disable depth imbalance in probe Zhang Qilong
2022-09-24 12:13 ` [PATCH -next 1/3] spi: cadence-quadspi: Fix PM disable depth imbalance in cqspi_probe Zhang Qilong
2022-09-24 12:13 ` [PATCH -next 2/3] spi: dw: Fix PM disable depth imbalance in dw_spi_bt1_probe Zhang Qilong
2022-09-24 12:13 ` [PATCH -next 3/3] spi/omap100k:Fix PM disable depth imbalance in omap1_spi100k_probe Zhang Qilong
2022-09-27 10:34 ` [PATCH -next 0/3] Fix PM disable depth imbalance in probe Mark Brown

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