[#4271] Large overhead from udelay(500) in bfin SPORT driver
Submitted By: Michael McTernan
2008-07-22 06:17:19 Close Date
Closed Fixed In Release:
Found In Release:
ALL Silicon Revision:
Is this bug repeatable?:
Uboot version or rev.:
Toolchain version or rev.:
App binary format:
Summary: Large overhead from udelay(500) in bfin SPORT driver
The bfin_sport driver contains udelay(500) to allow the last byte of a transfer to be completely serialised prior to disabling the SPORT logic. Having already waited until !(status & TXHRE), this delay need only wait for the serialisation of one word as the holding register and therefore FIFO are already empty.
A SPORT configured at 30MHz need only wait 33.3ns per bit to transfer. Assuming a 16 bit word size + early frame sync, a delay of just more than 566.6ns is sufficient.
When making lots of small transfers out of the SPORT, the 0.5ms delay busy waiting per block can sap performance. The delay would be better calculated as:
I'm not sure if it helps, but the udelay() calls were added to your trunk at revision 2507, Modified Wed Dec 6 07:32:56 2006 UTC by royhuang, with the comment:
"If use internal clock, this driver will hang system. This patch fix this bug"
--- Mike Frysinger 2009-05-05 16:26:05
another example of delay being incorrect (too short in this case):
--- Sonic Zhang 2009-06-18 06:34:15
500 us block wait is not necessary any more after a dummy data is put into tx
fifo to ensure the sport tx stops just after all bytes are shifted out except
the demmy data.
File Name File Type File Size Posted By
No Files Were Found