public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] spi: orion: fix runtime pm leak on unbind
       [not found] <20260421130211.1537628-1-johan@kernel.org>
@ 2026-04-21 13:02 ` Johan Hovold
  2026-04-21 13:02 ` [PATCH 2/3] spi: orion: fix clock imbalance on registration failure Johan Hovold
  1 sibling, 0 replies; 2+ messages in thread
From: Johan Hovold @ 2026-04-21 13:02 UTC (permalink / raw)
  To: Mark Brown; +Cc: Russell King, linux-spi, linux-kernel, Johan Hovold, stable

Make sure to balance the runtime PM usage count on driver unbind so that
the controller can be suspended when a driver is rebound.

Also restore the autosuspend setting.

This issue was flagged by Sashiko when reviewing a controller
deregistration fix.

Fixes: 5c6786945b4e ("spi: spi-orion: add runtime PM support")
Cc: stable@vger.kernel.org	# 3.17
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Link: https://sashiko.dev/#/patchset/20260414134319.978196-1-johan%40kernel.org?part=6
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/spi/spi-orion.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
index c54cd4ef09bd..c61ebfd1d18d 100644
--- a/drivers/spi/spi-orion.c
+++ b/drivers/spi/spi-orion.c
@@ -811,6 +811,9 @@ static void orion_spi_remove(struct platform_device *pdev)
 	spi_controller_put(host);
 
 	pm_runtime_disable(&pdev->dev);
+	pm_runtime_put_noidle(&pdev->dev);
+	pm_runtime_set_suspended(&pdev->dev);
+	pm_runtime_dont_use_autosuspend(&pdev->dev);
 }
 
 MODULE_ALIAS("platform:" DRIVER_NAME);
-- 
2.52.0


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

* [PATCH 2/3] spi: orion: fix clock imbalance on registration failure
       [not found] <20260421130211.1537628-1-johan@kernel.org>
  2026-04-21 13:02 ` [PATCH 1/3] spi: orion: fix runtime pm leak on unbind Johan Hovold
@ 2026-04-21 13:02 ` Johan Hovold
  1 sibling, 0 replies; 2+ messages in thread
From: Johan Hovold @ 2026-04-21 13:02 UTC (permalink / raw)
  To: Mark Brown; +Cc: Russell King, linux-spi, linux-kernel, Johan Hovold, stable

Make sure that the controller is not runtime suspended before disabling
clocks on probe failure.

Also restore the autosuspend setting.

Fixes: 5c6786945b4e ("spi: spi-orion: add runtime PM support")
Cc: stable@vger.kernel.org	# 3.17
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/spi/spi-orion.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
index c61ebfd1d18d..a5ce970ff5a8 100644
--- a/drivers/spi/spi-orion.c
+++ b/drivers/spi/spi-orion.c
@@ -774,6 +774,7 @@ static int orion_spi_probe(struct platform_device *pdev)
 	pm_runtime_set_active(&pdev->dev);
 	pm_runtime_use_autosuspend(&pdev->dev);
 	pm_runtime_set_autosuspend_delay(&pdev->dev, SPI_AUTOSUSPEND_TIMEOUT);
+	pm_runtime_get_noresume(&pdev->dev);
 	pm_runtime_enable(&pdev->dev);
 
 	status = orion_spi_reset(spi);
@@ -784,10 +785,15 @@ static int orion_spi_probe(struct platform_device *pdev)
 	if (status < 0)
 		goto out_rel_pm;
 
+	pm_runtime_put_autosuspend(&pdev->dev);
+
 	return status;
 
 out_rel_pm:
 	pm_runtime_disable(&pdev->dev);
+	pm_runtime_put_noidle(&pdev->dev);
+	pm_runtime_set_suspended(&pdev->dev);
+	pm_runtime_dont_use_autosuspend(&pdev->dev);
 out_rel_axi_clk:
 	clk_disable_unprepare(spi->axi_clk);
 out:
-- 
2.52.0


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

end of thread, other threads:[~2026-04-21 13:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260421130211.1537628-1-johan@kernel.org>
2026-04-21 13:02 ` [PATCH 1/3] spi: orion: fix runtime pm leak on unbind Johan Hovold
2026-04-21 13:02 ` [PATCH 2/3] spi: orion: fix clock imbalance on registration failure Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox