Skip to content

Commit 1889dd2

Browse files
Anurag Duttabroonie
authored andcommitted
spi: cadence-quadspi: Fix clock disable on probe failure path
When cqspi_request_mmap_dma() returns -EPROBE_DEFER after runtime PM is enabled, the error path calls clk_disable_unprepare() on an already disabled clock, causing an imbalance. Use pm_runtime_get_sync() to increment the usage counter and resume the device. This prevents runtime_suspend() from being invoked and causing a double clock disable. Fixes: 1406234 ("mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller") Signed-off-by: Anurag Dutta <a-dutta@ti.com> Tested-by: Nishanth Menon <nm@ti.com> Link: https://patch.msgid.link/20251212072312.2711806-3-a-dutta@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent b1f54d7 commit 1889dd2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/spi/spi-cadence-quadspi.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2026,7 +2026,9 @@ static int cqspi_probe(struct platform_device *pdev)
20262026
probe_reset_failed:
20272027
if (cqspi->is_jh7110)
20282028
cqspi_jh7110_disable_clk(pdev, cqspi);
2029-
clk_disable_unprepare(cqspi->clk);
2029+
2030+
if (pm_runtime_get_sync(&pdev->dev) >= 0)
2031+
clk_disable_unprepare(cqspi->clk);
20302032
probe_clk_failed:
20312033
return ret;
20322034
}

0 commit comments

Comments
 (0)