Skip to content

Commit 233db2c

Browse files
jhovoldbroonie
authored andcommitted
spi: cadence-quadspi: fix unclocked access on unbind
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. Fixes: 0578a6d ("spi: spi-cadence-quadspi: add runtime pm support") Cc: stable@vger.kernel.org # 6.7 Cc: Dhruva Gole <d-gole@ti.com> Link: https://sashiko.dev/#/patchset/20260414134319.978196-1-johan%40kernel.org?part=2 Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://patch.msgid.link/20260421125354.1534871-4-johan@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent cba53fe commit 233db2c

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

drivers/spi/spi-cadence-quadspi.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2024,14 +2024,13 @@ static void cqspi_remove(struct platform_device *pdev)
20242024
if (cqspi->rx_chan)
20252025
dma_release_channel(cqspi->rx_chan);
20262026

2027-
cqspi_controller_enable(cqspi, 0);
2028-
2029-
20302027
if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM)))
20312028
ret = pm_runtime_get_sync(&pdev->dev);
20322029

2033-
if (ret >= 0)
2030+
if (ret >= 0) {
2031+
cqspi_controller_enable(cqspi, 0);
20342032
clk_bulk_disable_unprepare(CLK_QSPI_NUM, cqspi->clks);
2033+
}
20352034

20362035
if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM))) {
20372036
pm_runtime_put_sync(&pdev->dev);

0 commit comments

Comments
 (0)