Unverified Commit 233db2cb authored by Johan Hovold's avatar Johan Hovold Committed by Mark Brown
Browse files

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: 0578a6db ("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: default avatarJohan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260421125354.1534871-4-johan@kernel.org


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent cba53fe2
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -2024,14 +2024,13 @@ static void cqspi_remove(struct platform_device *pdev)
	if (cqspi->rx_chan)
		dma_release_channel(cqspi->rx_chan);

	cqspi_controller_enable(cqspi, 0);


	if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM)))
		ret = pm_runtime_get_sync(&pdev->dev);

	if (ret >= 0)
	if (ret >= 0) {
		cqspi_controller_enable(cqspi, 0);
		clk_bulk_disable_unprepare(CLK_QSPI_NUM, cqspi->clks);
	}

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