Patchwork [U-Boot,3/5] mmc: sdhci: exit cmd on error status

login
register
mail settings
Submitter Rob Herring
Date June 1, 2011, 7:10 p.m.
Message ID <1306955427-18940-4-git-send-email-robherring2@gmail.com>
Download mbox | patch
Permalink /patch/98243/
State Superseded
Headers show

Comments

Rob Herring - June 1, 2011, 7:10 p.m.
From: Rob Herring <rob.herring@calxeda.com>

If the controller has an error condition, then stop polling for command
complete and exit mmc_send_cmd.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 drivers/mmc/sdhci.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Patch

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index f184821..b116b8c 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -204,6 +204,10 @@  static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
 				writel(mask, &host->reg->norintsts);
 			break;
 		}
+		if (mask & (1 << 15)) {
+			writel(mask, &host->reg->norintsts);
+			return -1;
+		}
 	}
 
 	if (i == retry) {