summaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorMasaharu Hayakawa <masaharu.hayakawa.ry@renesas.com>2020-12-23 16:30:21 +0900
committerUlf Hansson <ulf.hansson@linaro.org>2021-02-01 11:54:43 +0100
commit35cdcd1268f654f55e2308767349c44bd25d8009 (patch)
treeda7d8cefa69aab28bcb244d39ca5a46a90ba6e87 /drivers/mmc
parente085b51c74cc99334c290f7c67d039c95f788239 (diff)
downloadlinux-stable-35cdcd1268f654f55e2308767349c44bd25d8009.tar.gz
linux-stable-35cdcd1268f654f55e2308767349c44bd25d8009.tar.bz2
linux-stable-35cdcd1268f654f55e2308767349c44bd25d8009.zip
mmc: tmio: Add data timeout error detection
Currently, busy timeout is not checked for data transfer command. But, if the temperature condition changes, the data cannot be acquired correctly and timeout may occur. Also, we could reproduce an issue by using mmc_test driver (e.g. "Correct xfer_size at write (start failure)"). Therefore, this adds timeout error check. Signed-off-by: Masaharu Hayakawa <masaharu.hayakawa.ry@renesas.com> [saito: rework commit message.] Signed-off-by: Takeshi Saito <takeshi.saito.xv@renesas.com> [shimoda: rebase, add commit description] Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Link: https://lore.kernel.org/r/1608708622-29668-2-git-send-email-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/tmio_mmc_core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c
index 942b8375179c..21492b56b253 100644
--- a/drivers/mmc/host/tmio_mmc_core.c
+++ b/drivers/mmc/host/tmio_mmc_core.c
@@ -477,8 +477,10 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host, unsigned int stat)
if (!data)
goto out;
- if (stat & TMIO_STAT_CRCFAIL || stat & TMIO_STAT_STOPBIT_ERR ||
- stat & TMIO_STAT_TXUNDERRUN)
+ if (stat & TMIO_STAT_DATATIMEOUT)
+ data->error = -ETIMEDOUT;
+ else if (stat & TMIO_STAT_CRCFAIL || stat & TMIO_STAT_STOPBIT_ERR ||
+ stat & TMIO_STAT_TXUNDERRUN)
data->error = -EILSEQ;
if (host->dma_on && (data->flags & MMC_DATA_WRITE)) {
u32 status = sd_ctrl_read16_and_16_as_32(host, CTL_STATUS);