CPM_UART: tcdrain() is broken
Laurent Pinchart
laurent.pinchart at tbox.biz
Tue Nov 14 02:56:23 EST 2006
Hi everybody,
while working with a CPM UART port (SMC2), I noticed that tcdrain() doesn't
actually wait until all the characters hit the wire. After some
investigation, I found out that uart_wait_until_sent() (in
drivers/serial/serial_core.c) returns immediately because port->fifosize is
equal to 0.
The following patch improves the situation by setting fifosize and calling
uart_update_timeout() when the baud rate is modified. It didn't break might
system, but further testing is probably needed.
There is, however, a problem left. The SCC controllers have a 32-byte FIFO
between the buffer descriptors and the wires. cpm_uart_tx_empty() checks if
all buffer descriptors have been processed, but doesn't check if the transmit
FIFO is actually empty. I can't figure out how to do so from the datasheet.
Does anyone have an idea ?
Best regards,
Laurent Pinchart
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cpm-tcdrain.diff
Type: text/x-diff
Size: 1851 bytes
Desc: not available
Url : http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20061113/2c9ab27f/attachment.diff
More information about the Linuxppc-embedded
mailing list