diff mbox series

[v1,4/6] mmc: sdhci-of-esdhc: add erratum eSDHC7 support

Message ID 20190218031716.9308-4-yinbo.zhu@nxp.com (mailing list archive)
State New, archived
Headers show
Series [v1,1/6] mmc: sdhci-of-esdhc: add erratum eSDHC5 support | expand

Commit Message

Yinbo Zhu Feb. 18, 2019, 3:16 a.m. UTC
From: Yinbo Zhu <yinbo.zhu@nxp.com>

Invalid Transfer Complete (IRQSTAT[TC]) bit could be set during
multi-write operation even when the BLK_CNT in BLKATTR register
has not reached zero. Therefore, Transfer Complete might be
reported twice due to this erratum since a valid Transfer Complete
occurs when BLK_CNT reaches zero. This erratum is to fix this issue

Signed-off-by: Yinbo Zhu <yinbo.zhu@nxp.com>
---
 drivers/mmc/host/sdhci.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
diff mbox series

Patch

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 6f604d6..8f72889 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2988,6 +2988,15 @@  static void sdhci_data_irq(struct sdhci_host *host, u32 intmask)
 		}
 
 		if (intmask & SDHCI_INT_DATA_END) {
+			if (of_find_compatible_node(NULL, NULL,
+							"fsl,p2020-esdhc")) {
+				command = SDHCI_GET_CMD(sdhci_readw(host,
+								SDHCI_COMMAND));
+				if (command == MMC_WRITE_MULTIPLE_BLOCK &&
+					sdhci_readw(host, SDHCI_BLOCK_COUNT)
+					 != 0)
+					return;
+			}
 			if (host->cmd == host->data_cmd) {
 				/*
 				 * Data managed to finish before the