diff options
author | Tom Warren <twarren.nvidia@gmail.com> | 2012-02-07 06:17:16 +0000 |
---|---|---|
committer | Andy Fleming <afleming@freescale.com> | 2012-02-15 17:42:22 -0600 |
commit | cf39cf55971136b54c5aba3de9d0ac0c038c230b (patch) | |
tree | 65ebec119a4c8208734116a457cb0ae2fe1dd184 /drivers/mmc/tegra2_mmc.c | |
parent | a7778f8fbee098c78b1fa1e1331313a7e217fb30 (diff) | |
download | u-boot-imx-cf39cf55971136b54c5aba3de9d0ac0c038c230b.zip u-boot-imx-cf39cf55971136b54c5aba3de9d0ac0c038c230b.tar.gz u-boot-imx-cf39cf55971136b54c5aba3de9d0ac0c038c230b.tar.bz2 |
Tegra: mmc: Fixed handling of interrupts in timeouts.
We are seeing occasional timeouts in the Tegra mmc code when
we are reading from external MMC cards. These don't seem to be
detrimental if they are handled properly. This CL properly
clears the "normal interrupt status register" (norintsts) in
error conditions. If we don't do this, when we come back into
mmc_send_cmd() the register will still contain status from the
last transaction.
Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Tom Warren <twarren@nvidia.com>
Diffstat (limited to 'drivers/mmc/tegra2_mmc.c')
-rw-r--r-- | drivers/mmc/tegra2_mmc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mmc/tegra2_mmc.c b/drivers/mmc/tegra2_mmc.c index 3191557..33cc8fb 100644 --- a/drivers/mmc/tegra2_mmc.c +++ b/drivers/mmc/tegra2_mmc.c @@ -227,16 +227,19 @@ static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, if (i == retry) { printf("%s: waiting for status update\n", __func__); + writel(mask, &host->reg->norintsts); return TIMEOUT; } if (mask & TEGRA_MMC_NORINTSTS_CMD_TIMEOUT) { /* Timeout Error */ debug("timeout: %08x cmd %d\n", mask, cmd->cmdidx); + writel(mask, &host->reg->norintsts); return TIMEOUT; } else if (mask & TEGRA_MMC_NORINTSTS_ERR_INTERRUPT) { /* Error Interrupt */ debug("error: %08x cmd %d\n", mask, cmd->cmdidx); + writel(mask, &host->reg->norintsts); return -1; } @@ -265,6 +268,7 @@ static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, if (i == retry) { printf("%s: card is still busy\n", __func__); + writel(mask, &host->reg->norintsts); return TIMEOUT; } |