From: Adrian Hunter <adrian.hunter@intel.com>
To: <palliprath@chromium.org>,
Asutosh Das <quic_asutoshd@quicinc.com>,
"Ritesh Harjani" <ritesh.list@gmail.com>,
Ulf Hansson <ulfh@kernel.org>
Cc: <linux-mmc@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] mmc: cqhci: Log error IRQ details and card R1 status on recovery
Date: Fri, 4 Dec 2026 12:53:22 +0200 [thread overview]
Message-ID: <2627cb5a-a67f-4d85-8c7b-d8f8382ebda1@intel.com> (raw)
In-Reply-To: <20261201-cqe-recovery-fix-v1-1-404b8d26fdcc@chromium.org>
On 01/12/2026 19:20, Athira Palliprath via B4 Relay wrote:
> From: Athira Palliprath <palliprath@chromium.org>
>
> Currently cqhci_error_irq() only logs the error IRQ status, cmd_error,
> data_error, and TERRI at pr_debug() level and never reads CQHCI_CRI or
> CQHCI_CRA (the eMMC R1 card response status on Response Error Detected).
> As a result, production kernel logs on CQE-enabled devices only record
> "running CQE recovery" without indicating whether recovery was triggered
> by an uncorrectable NAND ECC error (R1_CARD_ECC_FAILED), a bus CRC error
> (-EILSEQ), or a host timeout (-ETIMEDOUT).
What about making more use of mmc_debugfs_err_stats_inc() instead?
>
> Log these error details via pr_err_ratelimited() once per recovery
> trigger (after the recovery_halt guard and idle check so normal I/O and
> in-progress recoveries emit zero extra messages), including CRI and CRA
> when CQHCI_IS_RED is set.
>
> Signed-off-by: Athira Palliprath <palliprath@chromium.org>
> ---
> drivers/mmc/host/cqhci-core.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/mmc/host/cqhci-core.c b/drivers/mmc/host/cqhci-core.c
> index a466cd88b..69b125c1e 100644
> --- a/drivers/mmc/host/cqhci-core.c
> +++ b/drivers/mmc/host/cqhci-core.c
> @@ -724,6 +724,19 @@ static void cqhci_error_irq(struct mmc_host *mmc, u32 status, int cmd_error,
> goto out_unlock;
> }
>
> + if (status & CQHCI_IS_RED) {
> + u32 cri = cqhci_readl(cq_host, CQHCI_CRI);
> + u32 cra = cqhci_readl(cq_host, CQHCI_CRA);
> +
> + pr_err_ratelimited("%s: cqhci: error IRQ status: 0x%08x cmd error %d data error %d TERRI: 0x%08x CRI: 0x%08x CRA: 0x%08x\n",
> + mmc_hostname(mmc), status, cmd_error,
> + data_error, terri, cri, cra);
Might just as well put cqhci_readl(cq_host, CQHCI_CRI) and
cqhci_readl(cq_host, CQHCI_CRA) into the arguments list.
Also, we probably don't need to optimize the error path,
so could have only this version of the print, and drop
the 'if'
And it feels a bit redundant to keep the pr_debug() as well.
> + } else {
> + pr_err_ratelimited("%s: cqhci: error IRQ status: 0x%08x cmd error %d data error %d TERRI: 0x%08x\n",
> + mmc_hostname(mmc), status, cmd_error,
> + data_error, terri);
> + }
> +
> if (CQHCI_TERRI_C_VALID(terri)) {
> tag = CQHCI_TERRI_C_TASK(terri);
> slot = &cq_host->slot[tag];
>
next prev parent reply other threads:[~2026-12-04 10:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 17:20 [PATCH 0/2] mmc: cqe: Improve CQHCI error logging and recovery reset handling Athira Palliprath via B4 Relay
2026-12-01 17:20 ` [PATCH 1/2] mmc: cqhci: Log error IRQ details and card R1 status on recovery Athira Palliprath via B4 Relay
2026-12-04 10:53 ` Adrian Hunter [this message]
2026-12-01 17:20 ` [PATCH 2/2] mmc: cqe: Reset card on finish halt/clear failure and before final retry Athira Palliprath via B4 Relay
2026-12-04 12:02 ` Adrian Hunter
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=2627cb5a-a67f-4d85-8c7b-d8f8382ebda1@intel.com \
--to=adrian.hunter@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=palliprath@chromium.org \
--cc=quic_asutoshd@quicinc.com \
--cc=ritesh.list@gmail.com \
--cc=ulfh@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®