Skip to content

Commit 678a461

Browse files
jhovoldgregkh
authored andcommitted
spi: orion: fix runtime pm leak on unbind
commit 97b17dd upstream. 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: 5c67869 ("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> Link: https://patch.msgid.link/20260421130211.1537628-2-johan@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 1f120e1 commit 678a461

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/spi/spi-orion.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,9 @@ static void orion_spi_remove(struct platform_device *pdev)
814814

815815
spi_unregister_controller(host);
816816
pm_runtime_disable(&pdev->dev);
817+
pm_runtime_put_noidle(&pdev->dev);
818+
pm_runtime_set_suspended(&pdev->dev);
819+
pm_runtime_dont_use_autosuspend(&pdev->dev);
817820
}
818821

819822
MODULE_ALIAS("platform:" DRIVER_NAME);

0 commit comments

Comments
 (0)