Linux SPI subsystem development
 help / color / mirror / Atom feed
* [PATCH] spi: cadence-quadspi: Fail probe on reference reset deassertion error
@ 2026-11-29 19:25 Jiawen Liu
  0 siblings, 0 replies; only message in thread
From: Jiawen Liu @ 2026-11-29 19:25 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi

On StarFive JH7110, cqspi_probe() deasserts the QSPI reference reset
through the SYSCRG reset controller. The provider returns -ETIMEDOUT
if hardware does not acknowledge deassertion. Ignoring the error can
leave the driver initializing and registering a controller still in
reset, preventing SPI NOR identification.

Report the deassert error with dev_err_probe() and use the existing
clock cleanup path to return the original errno before IRQ registration
or controller initialization.

Verified by source review,
git diff --check, checkpatch, and driver object builds on RISC-V
StarFive with reset support enabled and x86-64 with it disabled.
Runtime and hardware reproduction were not performed.

Fixes: 47fef94afeae ("spi: cadence-quadspi: Add support for StarFive JH7110 QSPI")
Signed-off-by: Jiawen Liu <liu1298662399@gmail.com>
---
 drivers/spi/spi-cadence-quadspi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 44d96b8cf8f0c..dd9fd5b7cdbff 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -1896,7 +1896,11 @@ static int cqspi_probe(struct platform_device *pdev)
 			goto disable_clks;
 		}
 		reset_control_assert(rstc_ref);
-		reset_control_deassert(rstc_ref);
+		ret = reset_control_deassert(rstc_ref);
+		if (ret) {
+			dev_err_probe(dev, ret, "Failed to deassert QSPI REF reset\n");
+			goto disable_clks;
+		}
 	}
 
 	reset_control_assert(rstc);
-- 
2.34.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-29 19:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-29 19:25 [PATCH] spi: cadence-quadspi: Fail probe on reference reset deassertion error Jiawen Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox