From: Wolfgang Denk Date: Tue, 26 Oct 2010 06:36:16 +0200 Subject: [U-Boot] [PATCH v2] mmc: omap: timeout counter fix In-Reply-To: <1288054924-24989-1-git-send-email-nm@ti.com> References: <1288054924-24989-1-git-send-email-nm@ti.com> Message-ID: <20101026043616.E2B87135DE3@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Nishanth Menon, In message <1288054924-24989-1-git-send-email-nm@ti.com> you wrote: > Having a loop with a counter is no timing guarentee for timing > accuracy or compiler optimizations. For e.g. the same loop counter > which runs when the MPU is running at 600MHz will timeout in around > half the time when running at 1GHz. or the example where GCC 4.5 > compiles with different optimization compared to GCC 4.4. > use a udelay(10) to ensure we have a predictable delay. > use an emperical number - 100000 uSec ~= 1sec for a worst case timeout. Hm... 100000 usec = 0.1 sec only... Guess you mean 100,000 x 10 usec = 1 sec ? 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 Anyone can count the seeds in an apple. No one can count the apples in a seed.