summaryrefslogtreecommitdiff
path: root/drivers/mmc/tmio-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/tmio-common.c')
-rw-r--r--drivers/mmc/tmio-common.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/mmc/tmio-common.c b/drivers/mmc/tmio-common.c
index 890c496b535..0b396122b46 100644
--- a/drivers/mmc/tmio-common.c
+++ b/drivers/mmc/tmio-common.c
@@ -4,7 +4,6 @@
* Author: Masahiro Yamada <yamada.masahiro@socionext.com>
*/
-#include <common.h>
#include <clk.h>
#include <cpu_func.h>
#include <fdtdec.h>
@@ -299,7 +298,13 @@ static int tmio_sd_dma_wait_for_irq(struct udevice *dev, u32 flag,
struct tmio_sd_priv *priv = dev_get_priv(dev);
long wait = 1000000 + 10 * blocks;
- while (!(tmio_sd_readl(priv, TMIO_SD_DMA_INFO1) & flag)) {
+ for (;;) {
+ if (tmio_sd_readl(priv, TMIO_SD_DMA_INFO1) & flag)
+ break;
+
+ if (tmio_sd_readl(priv, TMIO_SD_INFO1) & TMIO_SD_INFO1_CMP)
+ break;
+
if (wait-- < 0) {
dev_err(dev, "timeout during DMA\n");
return -ETIMEDOUT;