[U-Boot] Timer implementations

Wolfgang Denk wd at denx.de
Tue Oct 26 17:17:48 CEST 2010


Dear Nishanth Menon,

In message <4CC6EFB1.9000701 at 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.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The first thing we do is kill all the lawyers.
(Shakespeare. II Henry VI, Act IV, scene ii)


More information about the U-Boot mailing list