summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/mmc/mmc.c3
-rw-r--r--include/mmc.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index d67af80c011..b4c8e7f293b 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -841,7 +841,8 @@ static int __mmc_switch(struct mmc *mmc, u8 set, u8 index, u8 value,
value);
return -EIO;
}
- if (!ret && (status & MMC_STATUS_RDY_FOR_DATA))
+ if (!ret && (status & MMC_STATUS_RDY_FOR_DATA) &&
+ (status & MMC_STATUS_CURR_STATE) == MMC_STATE_TRANS)
return 0;
udelay(100);
} while (get_timer(start) < timeout_ms);
diff --git a/include/mmc.h b/include/mmc.h
index c12c7a0b5cf..effccaaca08 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -178,6 +178,7 @@ static inline bool mmc_is_tuning_cmd(uint cmdidx)
#define MMC_STATUS_ERROR (1 << 19)
#define MMC_STATE_PRG (7 << 9)
+#define MMC_STATE_TRANS (4 << 9)
#define MMC_VDD_165_195 0x00000080 /* VDD voltage 1.65 - 1.95 */
#define MMC_VDD_20_21 0x00000100 /* VDD voltage 2.0 ~ 2.1 */