All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiawen Liu <liu1298662399@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: linux-spi@vger.kernel.org
Subject: [PATCH] spi: cadence-quadspi: Fail probe on reference reset deassertion error
Date: Sun, 29 Nov 2026 19:25:33 +0000	[thread overview]
Message-ID: <179598034377.2.7621737283468520430.pattern-ext-147.26@gmail.com> (raw)

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

             reply	other threads:[~2026-11-29 19:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29 19:25 Jiawen Liu [this message]
2026-11-30  2:11 ` [PATCH] spi: cadence-quadspi: Fail probe on reference reset deassertion error Krzysztof Kozlowski
2026-11-30 19:31 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179598034377.2.7621737283468520430.pattern-ext-147.26@gmail.com \
    --to=liu1298662399@gmail.com \
    --cc=broonie@kernel.org \
    --cc=linux-spi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.