[PATCH 1/3] spi: orion: fix runtime pm leak on unbind

From: Johan Hovold

Date: Tue Apr 21 2026 - 09:03:36 EST


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@xxxxxxxxxxxxxxx # 3.17
Cc: Russell King <rmk+kernel@xxxxxxxxxxxxxxxx>
Link: https://sashiko.dev/#/patchset/20260414134319.978196-1-johan%40kernel.org?part=6
Signed-off-by: Johan Hovold <johan@xxxxxxxxxx>
---
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