[PATCH 0/2] mmc: cqe: Improve CQHCI error logging and recovery reset handling

From: Athira Palliprath via B4 Relay

Date: Tue Dec 01 2026 - 12:20:18 EST


This 2-patch series addresses two diagnostics and recovery gaps in the
eMMC CQE / CQHCI error handling path observed in field crash logs:

1. cqhci_error_irq() currently logs status/cmd_error/data_error/TERRI
only at pr_debug() level and never reads CQHCI_CRI or CQHCI_CRA on
Response Error Detected (RED), making bus CRC errors, host timeouts,
and card NAND ECC errors indistinguishable in production logs.
2. cqhci_recovery_finish() discards failures from its final cqhci_halt()
and cqhci_clear_all_tasks() calls, and unlike non-CQE recovery, CQE
never performs mmc_blk_reset() before a failing request's final
retry as long as CMD48 (which ignores CRC) succeeds.

Patch 1 logs the error IRQ details (plus CRI/CRA when CQHCI_IS_RED is
set) via pr_err_ratelimited() once per recovery trigger.

Patch 2 changes struct mmc_cqe_ops::cqe_recovery_finish() to return int
so final halt/task-clear failures propagate -EIO to mmc_cqe_recovery(),
and triggers mmc_blk_reset() before dispatching a failing request's
final CQE retry.

Signed-off-by: Athira Palliprath <palliprath@xxxxxxxxxxxx>
---
Athira Palliprath (2):
mmc: cqhci: Log error IRQ details and card R1 status on recovery
mmc: cqe: Reset card on finish halt/clear failure and before final retry

drivers/mmc/core/block.c | 6 +++++-
drivers/mmc/core/core.c | 9 ++++++---
drivers/mmc/core/queue.h | 1 +
drivers/mmc/host/cqhci-core.c | 25 +++++++++++++++++++++----
drivers/mmc/host/mmc_hsq.c | 4 +++-
include/linux/mmc/host.h | 2 +-
6 files changed, 37 insertions(+), 10 deletions(-)
---
base-commit: d2616724e01132376c78872b8324f38659af9f28
change-id: 20261201-cqe-recovery-fix-bbd460447801

Best regards,
--
Athira Palliprath <palliprath@xxxxxxxxxxxx>