summaryrefslogtreecommitdiff
path: root/drivers/mmc/bcm2835_sdhost.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/bcm2835_sdhost.c')
-rw-r--r--drivers/mmc/bcm2835_sdhost.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/mmc/bcm2835_sdhost.c b/drivers/mmc/bcm2835_sdhost.c
index 1ce019af57..7f70acaf39 100644
--- a/drivers/mmc/bcm2835_sdhost.c
+++ b/drivers/mmc/bcm2835_sdhost.c
@@ -234,7 +234,7 @@ static void bcm2835_reset_internal(struct bcm2835_host *host)
static int bcm2835_wait_transfer_complete(struct bcm2835_host *host)
{
- int timediff = 0;
+ ulong tstart_ms = get_timer(0);
while (1) {
u32 edm, fsm;
@@ -254,11 +254,13 @@ static int bcm2835_wait_transfer_complete(struct bcm2835_host *host)
break;
}
- /* Error out after 100000 register reads (~1s) */
- if (timediff++ == 100000) {
+ /* Error out after ~1s */
+ ulong tlapse_ms = get_timer(tstart_ms);
+ if ( tlapse_ms > 1000 /* ms */ ) {
+
dev_err(host->dev,
- "wait_transfer_complete - still waiting after %d retries\n",
- timediff);
+ "wait_transfer_complete - still waiting after %lu ms\n",
+ tlapse_ms);
bcm2835_dumpregs(host);
return -ETIMEDOUT;
}