Rockbox mail archive
Subject: TMS320DM320 udelay() problem
TMS320DM320 udelay() problem
Recently (r31376) I have commited changes that made udelay() for
TMS320DM320 pretty precise. However nasty bug was discovered later
that would cause the udelay() to never return when interrupts are
disabled. This problem was resolved in r31394, although a new issue
Current udelay() implementation can exit before specified time if
called with interrupts disabled. This can happen if TIMER1 interrupt
goes into active state before values count gets loaded with
One crude way to make sure the udelay() won't finish before specified
amount of time is to explicitly clear the TIMER1 interrupt state. In
worst case that would make the delay take one tick longer than
Are there any other suggestions how to deal with that corner case?
Is having this crude fix actually better than letting the udelay()
exit before expected?
I think in general, having to wait a bit longer in special cases is
reasonable trade-off which shouldn't cause problems.
Received on 2011-12-21
Page was last modified "Jan 10 2012" The Rockbox Crew