
Wolfgang Denk had written, on 10/26/2010 10:17 AM, the following:
Dear Nishanth Menon,
In message 4CC6EFB1.9000701@ti.com you wrote:
uint64_t etime; /* actually this could be u32 */
etime = get_ticks() + usec2ticks(MAX_RETRY_US); while (!(readl(&mmc_base->stat) & CC_MASK)) { if (get_ticks() <= etime) { printf("%s: timedout waiting for cc2!\n", __func__); return; } }
sounds right?
No. This code is always wrong. Please fix it as described.
Apologies on being a dudhead, I suppose you mean the following:
ulong start; start = get_timer(0); while (!(readl(&mmc_base->stat) & CC_MASK)) { if (get_timer(start) > usec2ticks(MAX_RETRY_US)) { printf("%s: timedout waiting for cc2!\n", __func__); return; } }
would this be better?