* [PATCH 1/3] spi: orion: fix runtime pm leak on unbind
2026-04-21 13:02 [PATCH 0/3] spi: orion: runtime PM fixes Johan Hovold
@ 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
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ 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] 5+ messages in thread* [PATCH 2/3] spi: orion: fix clock imbalance on registration failure
2026-04-21 13:02 [PATCH 0/3] spi: orion: runtime PM fixes Johan Hovold
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
2026-04-21 13:02 ` [PATCH 3/3] spi: orion: clean up probe return value Johan Hovold
2026-04-22 12:53 ` [PATCH 0/3] spi: orion: runtime PM fixes Mark Brown
3 siblings, 0 replies; 5+ 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] 5+ messages in thread* [PATCH 3/3] spi: orion: clean up probe return value
2026-04-21 13:02 [PATCH 0/3] spi: orion: runtime PM fixes Johan Hovold
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
@ 2026-04-21 13:02 ` Johan Hovold
2026-04-22 12:53 ` [PATCH 0/3] spi: orion: runtime PM fixes Mark Brown
3 siblings, 0 replies; 5+ 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
Drop the redundant initialisation and return explicit zero on successful
probe to make the code more readable.
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/spi/spi-orion.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
index a5ce970ff5a8..64bf215c1804 100644
--- a/drivers/spi/spi-orion.c
+++ b/drivers/spi/spi-orion.c
@@ -648,8 +648,8 @@ static int orion_spi_probe(struct platform_device *pdev)
struct orion_spi *spi;
struct resource *r;
unsigned long tclk_hz;
- int status = 0;
struct device_node *np;
+ int status;
host = spi_alloc_host(&pdev->dev, sizeof(*spi));
if (host == NULL) {
@@ -787,7 +787,7 @@ static int orion_spi_probe(struct platform_device *pdev)
pm_runtime_put_autosuspend(&pdev->dev);
- return status;
+ return 0;
out_rel_pm:
pm_runtime_disable(&pdev->dev);
--
2.52.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH 0/3] spi: orion: runtime PM fixes
2026-04-21 13:02 [PATCH 0/3] spi: orion: runtime PM fixes Johan Hovold
` (2 preceding siblings ...)
2026-04-21 13:02 ` [PATCH 3/3] spi: orion: clean up probe return value Johan Hovold
@ 2026-04-22 12:53 ` Mark Brown
3 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2026-04-22 12:53 UTC (permalink / raw)
To: Johan Hovold; +Cc: Russell King, linux-spi, linux-kernel
On Tue, 21 Apr 2026 15:02:08 +0200, Johan Hovold wrote:
> spi: orion: runtime PM fixes
>
> This series fixes some runtime PM related issues in the orion driver.
>
> Included is also a related clean up.
>
> Johan
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-7.1
Thanks!
[1/3] spi: orion: fix runtime pm leak on unbind
https://git.kernel.org/broonie/spi/c/97b17dd8266d
[2/3] spi: orion: fix clock imbalance on registration failure
https://git.kernel.org/broonie/spi/c/443cde0dc59c
[3/3] spi: orion: clean up probe return value
https://git.kernel.org/broonie/spi/c/fa5061daffe8
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