[U-Boot] [PATCH v3] mmc: omap: timeout counter fix

Steve Sakoman sakoman at gmail.com
Thu Nov 4 22:34:57 CET 2010


On Tue, Oct 26, 2010 at 11:04 AM, Nishanth Menon <nm at ti.com> 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 timer
> to keep track of time elapse and we use an emperical number - 1sec
> for a worst case timeout.  This should never happen, and is adequate
> imaginary condition for us to fail with timeout.
>
> Signed-off-by: Nishanth Menon <nm at ti.com>
> ---
> V3: changed the delay logic, removed udelays which was introduced in
> v2 as the intent was purely to have predictable time delays. the timer
> logic is based on the discussion in ML using get_timer
>
> V2: http://www.mail-archive.com/u-boot@lists.denx.de/msg40972.html
> additional cleanups + made MAX_RETRY a macro for reuse throughout
> the file. tested on PandaBoard with 1GHz boot frequency and GCC4.5 on
> u-boot 2010.09 + mmc patches. Requesting testing on other platforms
>
> V1: http://www.mail-archive.com/u-boot@lists.denx.de/msg40969.html

Tested on Overo, Beagleboard xM, and Panda.  No issues found.

Tested-by: Steve Sakoman <steve.sakoman at linaro.org>

Steve


More information about the U-Boot mailing list