summaryrefslogtreecommitdiff
path: root/drivers/mmc/mmc.c
diff options
context:
space:
mode:
authorStefan Bosch <stefan_b@posteo.net>2021-01-23 13:37:41 +0100
committerPeng Fan <peng.fan@nxp.com>2021-02-19 15:04:15 +0800
commit8e2b0af7216d78b60fccb46a107a4a047938aea9 (patch)
tree0873aa2c1e0e584812d6d0301a5fa8dbf9742eb2 /drivers/mmc/mmc.c
parent37e1362efc2ba9be5355b3c55f9f4f7a43f02de2 (diff)
downloadu-boot-8e2b0af7216d78b60fccb46a107a4a047938aea9.tar.gz
u-boot-8e2b0af7216d78b60fccb46a107a4a047938aea9.tar.bz2
u-boot-8e2b0af7216d78b60fccb46a107a4a047938aea9.zip
mmc: fix response timeout after switch command
After issuing the switch command: Wait until 'current state' of the card status becomes 'tran'. This prevents from response timeout at the next command because of 'current state' = 'data'. Signed-off-by: Stefan Bosch <stefan_b@posteo.net> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Diffstat (limited to 'drivers/mmc/mmc.c')
-rw-r--r--drivers/mmc/mmc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index d67af80c01..b4c8e7f293 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);