Skip to contentSkip to conversation

spi: rockchip-sfc: disable runtime PM in remove

PATCH In review Jiawen Liu 3 participants 4 messages Aug 18 – Sep 10

Subsystems (3)
lore
Share & tools
lore

Jiawen Liu

author
#0 lore raw

PATCH 1/1 spi: rockchip-sfc: disable runtime PM in remove

rockchip_sfc_probe enables runtime PM and leaves the device active with a usage count held by pm_runtime_get_noresume(). The remove callback only disables the clocks and does not disable runtime PM, leaving the device in an inconsistent state and leaking the runtime PM reference. Add the missing runtime PM teardown in rockchip_sfc_remove to balance the probe's enable and get_noresume calls.

---

drivers/spi/spi-rockchip-sfc.c +5 -0
@@ -743,6 +743,11 @@
 	struct spi_controller *host = sfc->host;
 
 	spi_unregister_controller(host);
+	pm_runtime_get_sync(&pdev->dev);
+	pm_runtime_put_noidle(&pdev->dev);
+	pm_runtime_disable(&pdev->dev);
+	pm_runtime_set_suspended(&pdev->dev);
+	pm_runtime_dont_use_autosuspend(&pdev->dev);
 	dma_unmap_single(&pdev->dev, sfc->dma_buffer, sfc->max_iosize,
 			 DMA_BIDIRECTIONAL);
 	free_pages((unsigned long)sfc->buffer, get_order(sfc->max_iosize));
maintainer
#1 lore raw
Quoted 8 lines · Jiawen Liu

rockchip_sfc_probe enables runtime PM and leaves the device active with a usage count held by pm_runtime_get_noresume(). The remove callback only disables the clocks and does not disable runtime PM, leaving the device in an inconsistent state and leaking the runtime PM reference. Add the missing runtime PM teardown in rockchip_sfc_remove to balance the probe's enable and get_noresume calls.

Your name here doesn't match the name you're using in the From: of your mail, that's going to make tooling think you've not provided a signoff.

#2 lore raw
In reply to Jiawen Liu
maintainer
#3 lore raw
In reply to Jiawen Liu
Quoted 1 line · Jiawen Liu

spi: rockchip-sfc: disable runtime PM in remove

Applied to

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

Thanks!

[1/1] spi: rockchip-sfc: disable runtime PM in remove

      https://git.kernel.org/broonie/spi/c/34e32e9ade58

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