spi: cadence-quadspi: fix unclocked access on unbind
Subsystems (2)
PATCH 1/1 spi: cadence-quadspi: fix unclocked access on unbind
From: Johan Hovold <[email protected]>
[ Upstream commit 233db2cb14db8b1935dda52a6affd97276462b82 ]
Make sure that the controller is runtime resumed before disabling it during driver unbind to avoid an unclocked register access.
This issue was flagged by Sashiko when reviewing a controller deregistration fix.
--- drivers/spi/spi-cadence-quadspi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/spi/spi-cadence-quadspi.c +3 -2
@@ -2013,13 +2013,14 @@ static void cqspi_remove(struct platform_device *pdev)cqspi_wait_idle (cqspi);spi_unregister_controller (cqspi->host); -cqspi_controller_enable (cqspi,0 );if (cqspi->rx_chan)dma_release_channel (cqspi->rx_chan); -if (pm_runtime_get_sync (&pdev->dev) >=0 ) +if (pm_runtime_get_sync (&pdev->dev) >=0 ) { +cqspi_controller_enable (cqspi,0 );clk_disable (cqspi->clk); + }if (cqspi->is_jh7110)cqspi_jh7110_disable_clk (pdev, cqspi);
Signature · 1 line
2.44.3
Sasha Levin
maintainerQuoted 1 line · Robert Garcia
[PATCH 6.12.y] spi: cadence-quadspi: fix unclocked access on unbind
I can't take this into 6.12 on its own. We don't backport a fix to an older tree while it's missing from a newer one, and 233db2cb14db isn't in 6.18.y yet.
If you can send a 6.18.y backport as well (adapted to the older cqspi_remove() there), I'll queue both together; the 6.12 patch itself looks fine.
--
Thanks,
Sasha