* [PATCH 6.18.y] spi: cadence-quadspi: fix unclocked access on unbind
@ 2026-06-11 6:37 Robert Garcia
2026-06-11 15:26 ` Sasha Levin
0 siblings, 1 reply; 2+ messages in thread
From: Robert Garcia @ 2026-06-11 6:37 UTC (permalink / raw)
To: stable, Johan Hovold
Cc: Mark Brown, Dhruva Gole, Apurva Nandan, Robert Garcia, linux-spi,
linux-kernel
From: Johan Hovold <johan@kernel.org>
[ 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.
Fixes: 0578a6dbfe75 ("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>
[ Context adaptation performed. ]
Signed-off-by: Robert Garcia <rob_garcia@163.com>
---
drivers/spi/spi-cadence-quadspi.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index d61bc678b6f8..0a32e28eefd5 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -2055,7 +2055,6 @@ 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);
@@ -2063,8 +2062,10 @@ static void cqspi_remove(struct platform_device *pdev)
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_disable(cqspi->clk);
+ }
if (cqspi->is_jh7110)
cqspi_jh7110_disable_clk(pdev, cqspi);
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 6.18.y] spi: cadence-quadspi: fix unclocked access on unbind
2026-06-11 6:37 [PATCH 6.18.y] spi: cadence-quadspi: fix unclocked access on unbind Robert Garcia
@ 2026-06-11 15:26 ` Sasha Levin
0 siblings, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2026-06-11 15:26 UTC (permalink / raw)
To: stable, Johan Hovold
Cc: Sasha Levin, Mark Brown, Dhruva Gole, Apurva Nandan,
Robert Garcia, linux-spi, linux-kernel
On Thu, Jun 11, 2026 at 02:37:19PM +0800, Robert Garcia wrote:
> [ Upstream commit 233db2cb14db8b1935dda52a6affd97276462b82 ]
>
> Make sure that the controller is runtime resumed before disabling it
> during driver unbind to avoid an unclocked register access.
Now that the 6.18.y backport is here, I've queued both. Queued for 6.18
and 6.12, thanks.
--
Thanks,
Sasha
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-11 15:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-11 6:37 [PATCH 6.18.y] spi: cadence-quadspi: fix unclocked access on unbind Robert Garcia
2026-06-11 15:26 ` Sasha Levin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.