Skip to content

Commit

Permalink
mmc: tmio: Add data timeout error detection
Browse files Browse the repository at this point in the history
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 <[email protected]>
[saito: rework commit message.]
Signed-off-by: Takeshi Saito <[email protected]>
[shimoda: rebase, add commit description]
Signed-off-by: Yoshihiro Shimoda <[email protected]>
Reviewed-by: Wolfram Sang <[email protected]>
Tested-by: Wolfram Sang <[email protected]>
Link: https://lore.kernel.org/r/1608708622-29668-2-git-send-email-yoshihiro.shimoda.uh@renesas.com
Signed-off-by: Ulf Hansson <[email protected]>
  • Loading branch information
Masaharu Hayakawa authored and storulf committed Feb 1, 2021
1 parent e085b51 commit 35cdcd1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/mmc/host/tmio_mmc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 35cdcd1

Please sign in to comment.