From: Tom Warren Date: Tue, 7 Feb 2012 09:17:16 -0700 Subject: [U-Boot] [PATCH] Tegra: mmc: Fixed handling of interrupts in timeouts. Message-ID: <1328631436-22063-1-git-send-email-twarren@nvidia.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 Signed-off-by: Tom Warren --- 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 5b4c9f6..e1d9067 100644 --- a/drivers/mmc/tegra2_mmc.c +++ b/drivers/mmc/tegra2_mmc.c @@ -219,16 +219,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; } @@ -257,6 +260,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; } -- 1.7.7.1