spi: spi-rpc-if: Implement 200ms runtime PM autosuspend delay

Enable and configure the runtime PM autosuspend infrastructure during
the controller probe sequence to safeguard chunked flash operations.

The underlying hardware controller handles memory-mapped page programming
by dividing data transfers into an automated sequence of consecutive
64-byte chunks. To prevent the power management framework from
aggressively gating the interface between these individual chunk frames
or during immediate out-of-band status checks, an explicit 200ms delay
window is required.

Configure this temporal cushion using pm_runtime_set_autosuspend_delay()
and pm_runtime_use_autosuspend() at probe time, ensuring proper cleanup
via pm_runtime_dont_use_autosuspend() in error and driver removal
pathways. This guarantees interface continuity across the full lifecycle
of a multi-chunk write operation.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://patch.msgid.link/20260715222417.2997712-7-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Lad Prabhakar
2026-07-15 23:24:16 +01:00
committed by Mark Brown
parent b247067fb1
commit af4b98e33d

View File

@@ -161,6 +161,8 @@ static int rpcif_spi_probe(struct platform_device *pdev)
ctlr->dev.of_node = parent->of_node;
pm_runtime_set_autosuspend_delay(rpc->dev, 200);
pm_runtime_use_autosuspend(rpc->dev);
pm_runtime_enable(rpc->dev);
ctlr->num_chipselect = 1;
@@ -183,6 +185,7 @@ static int rpcif_spi_probe(struct platform_device *pdev)
return 0;
out_disable_rpm:
pm_runtime_dont_use_autosuspend(rpc->dev);
pm_runtime_disable(rpc->dev);
return error;
}
@@ -193,6 +196,7 @@ static void rpcif_spi_remove(struct platform_device *pdev)
struct rpcif *rpc = spi_controller_get_devdata(ctlr);
spi_unregister_controller(ctlr);
pm_runtime_dont_use_autosuspend(rpc->dev);
pm_runtime_disable(rpc->dev);
}