[PATCH v2 03/11] mci: sdhci: bail out on ADMA/transfer errors instead of hanging
Johannes Schneider <[email protected]> Sat, 4 Jul 2026 12:26:20 +0000
| Newsgroups | org.infradead.lists.barebox |
|---|---|
| Message-ID | <[email protected]> |
sdhci_transfer_data_dma() only watched for the completion and DMA-boundary interrupts, so a transfer/ADMA error (SDHCI_INT_ERROR, e.g. an ADMA descriptor fault) left it spinning until the 10s timeout. Check the error bits and abort the transfer with -EIO, dumping the ADMA error status. Assisted-by: Claude Opus 4.8 (1M context) Signed-off-by: Johannes Schneider <[email protected]> --- Notes: v2: - Drop the sdhci.h SDHCI_INT_ADMA_ERROR define; upstream now provides it. Rebased on next. drivers/mci/sdhci.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/mci/sdhci.c b/drivers/mci/sdhci.c index 3474ef129b..ccd5d4b83c 100644 --- a/drivers/mci/sdhci.c +++ b/drivers/mci/sdhci.c @@ -779,6 +779,14 @@ int sdhci_transfer_data_dma(struct sdhci *sdhci, struct mci_cmd *cmd, goto out; } + /* e.g. ADMA error: SDHCI_INT_ERROR without a data-error bit */ + if (irqstat & SDHCI_INT_ERROR) { + dev_err(dev, "transfer error: int 0x%08x adma 0x%02x\n", + irqstat, sdhci_read8(sdhci, SDHCI_ADMA_ERROR)); + ret = -EIO; + goto out; + } + /* * We currently don't do anything fancy with DMA * boundaries, but as we can't disable the feature -- 2.43.0