]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mmc: cqhci: Capture eMMC and SD card errors
authorShaik Sajida Bhanu <quic_c_sbhanu@quicinc.com>
Fri, 27 May 2022 17:53:56 +0000 (23:23 +0530)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 12 Jul 2022 10:25:35 +0000 (12:25 +0200)
Add changes to capture eMMC and SD card errors.
This is useful for debug and testing.

Signed-off-by: Liangliang Lu <quic_luliang@quicinc.com>
Signed-off-by: Sayali Lokhande <quic_sayalil@quicinc.com>
Signed-off-by: Bao D. Nguyen <quic_nguyenb@quicinc.com>
Signed-off-by: Ram Prakash Gupta <quic_rampraka@quicinc.com>
Signed-off-by: Shaik Sajida Bhanu <quic_c_sbhanu@quicinc.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/1653674036-21829-6-git-send-email-quic_c_sbhanu@quicinc.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/cqhci-core.c

index b0d30c35c390c7dfda70fa73b2b0880ca492c480..b3d7d6d8d654852dfc38c5ee6a1dadce2c7b6ec7 100644 (file)
@@ -822,8 +822,15 @@ irqreturn_t cqhci_irq(struct mmc_host *mmc, u32 intmask, int cmd_error,
        pr_debug("%s: cqhci: IRQ status: 0x%08x\n", mmc_hostname(mmc), status);
 
        if ((status & (CQHCI_IS_RED | CQHCI_IS_GCE | CQHCI_IS_ICCE)) ||
-           cmd_error || data_error)
+           cmd_error || data_error) {
+               if (status & CQHCI_IS_RED)
+                       mmc_debugfs_err_stats_inc(mmc, MMC_ERR_CMDQ_RED);
+               if (status & CQHCI_IS_GCE)
+                       mmc_debugfs_err_stats_inc(mmc, MMC_ERR_CMDQ_GCE);
+               if (status & CQHCI_IS_ICCE)
+                       mmc_debugfs_err_stats_inc(mmc, MMC_ERR_CMDQ_ICCE);
                cqhci_error_irq(mmc, status, cmd_error, data_error);
+       }
 
        if (status & CQHCI_IS_TCC) {
                /* read TCN and complete the request */