Unverified Commit 9d651a6c authored by Mark Brown's avatar Mark Brown
Browse files

spi: cadence-quadspi: Fix probe error path and logging

Merge series from Anurag Dutta <a-dutta@ti.com>:

This series addresses issues in the cadence-quadspi driver's probe
error path:

Patch 1 fixes a clock disable imbalance that occurs when probe fails
after runtime PM is enabled, particularly when DMA request returns
-EPROBE_DEFER.

Patch 2 adds proper error logging for DMA request failures using
dev_err_probe() to improve diagnostics and handle probe deferral
appropriately.

logs : https://gist.github.com/anuragdutta731/59925cd11a50913b7128c88cd5394db7
parents 8c04b77f 1889dd20
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -2001,9 +2001,11 @@ static int cqspi_probe(struct platform_device *pdev)

	if (cqspi->use_direct_mode) {
		ret = cqspi_request_mmap_dma(cqspi);
		if (ret == -EPROBE_DEFER)
		if (ret == -EPROBE_DEFER) {
			dev_err_probe(&pdev->dev, ret, "Failed to request mmap DMA\n");
			goto probe_setup_failed;
		}
	}

	ret = spi_register_controller(host);
	if (ret) {
@@ -2024,6 +2026,8 @@ static int cqspi_probe(struct platform_device *pdev)
probe_reset_failed:
	if (cqspi->is_jh7110)
		cqspi_jh7110_disable_clk(pdev, cqspi);

	if (pm_runtime_get_sync(&pdev->dev) >= 0)
		clk_disable_unprepare(cqspi->clk);
probe_clk_failed:
	return ret;