summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDoug Anderson <dianders@chromium.org>2011-09-28 17:06:23 -0700
committerDoug Anderson <dianders@chromium.org>2011-10-03 15:24:27 -0700
commit5cac8a8221c9470c75f81399e3a92eeda28a9851 (patch)
treec2b56cc4ab9ce2cb3596e6bd85e5c6e783b603f6 /drivers
parent0112daa9bc65775dbea58f99bfaaa3261ca38cd7 (diff)
CHROMIUM: tegra: mmc: Fixed handling of timeouts.
For some reason we are getting timeouts in the tegra MMC code when we're reading from external MMC cards. These don't seem to be detrimental if we handle them 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. BUG=chromium-os:20947 TEST=Booted from MMC 1 Also did the following for detailed test: 0. Ran with legacy u-boot and held space at bootup to get prompt. 1. mmc rescan 1 2. fatload mmc 1:c 0x408000 /u-boot/boot.scr.uimg ff 3. md.b 0x408000 0xff 4. Validated that the above looked like the bootscript (aka contained text like "boot-A.scr"). Change-Id: Ie4e7736d9b2055dcb4b28775545291b7eb3e633e Signed-off-by: Doug Anderson <dianders@chromium.org> Reviewed-on: http://gerrit.chromium.org/gerrit/8469 Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Sean Paul <seanpaul@chromium.org> Reviewed-by: Sean Paul <seanpaul@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/tegra2_mmc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mmc/tegra2_mmc.c b/drivers/mmc/tegra2_mmc.c
index 94605a3c32..62d9fd5f83 100644
--- a/drivers/mmc/tegra2_mmc.c
+++ b/drivers/mmc/tegra2_mmc.c
@@ -347,16 +347,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 & (1 << 16)) {
/* Timeout Error */
debug("timeout: %08x cmd %d\n", mask, cmd->cmdidx);
+ writel(mask, &host->reg->norintsts);
return TIMEOUT;
} else if (mask & (1 << 15)) {
/* Error Interrupt */
debug("error: %08x cmd %d\n", mask, cmd->cmdidx);
+ writel(mask, &host->reg->norintsts);
return -1;
}
@@ -385,6 +388,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;
}