[PATCH v2 1/8] spi: cadence-xspi: fail on command errors without a known cause
From: Nuno Sá
Date: Wed Nov 11 2026 - 08:29:05 EST
cdns_xspi_check_command_status() only returns an error if one of the
known error bits is set along with the FAIL bit. If the controller
reports a failed command without any of those, the failure is silently
ignored and the operation is reported as successful.
Treat the FAIL bit on its own as an error, and log the whole command
status so the unknown cause can still be looked at.
Fixes: a16cc8077627 ("spi: cadence: add support for Cadence XSPI controller")
Signed-off-by: Nuno Sá <nuno.sa@xxxxxxxxxx>
---
drivers/spi/spi-cadence-xspi.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/spi/spi-cadence-xspi.c b/drivers/spi/spi-cadence-xspi.c
index 3687853e4ce4..85cf5cf81c9e 100644
--- a/drivers/spi/spi-cadence-xspi.c
+++ b/drivers/spi/spi-cadence-xspi.c
@@ -405,6 +405,12 @@ static int cdns_xspi_check_command_status(struct cdns_xspi_dev *cdns_xspi)
"Invalid command sequence detected\n");
ret = -EPROTO;
}
+ if (!ret) {
+ dev_err(cdns_xspi->dev,
+ "Unknown reported error (0x%08x)\n",
+ cmd_status);
+ ret = -EPROTO;
+ }
}
} else {
dev_err(cdns_xspi->dev, "Fatal err - command not completed\n");
--
2.56.0