[MPC5200B] strange data loss on uart reception

Albrecht Dreß albrecht.dress at arcor.de
Fri Oct 29 19:54:24 EST 2010


Hi all,

I'm not sure if this is the right list, so please excuse me if I'm totally
wrong here, or if my question is really dumb...

My platform is a MPC5200B (roughly Icecube) based board with kernel 2.6.32.
>From a PC I try to send data through the MPC5200B's serial port, using the
standard mpc52xx_uart driver.  The reading process is rather slow in
processing the incoming data.  Thus, the uart is configured to use rts/cts
 handshaking.  The port is opened in (O_EXCL | O_RDWR) mode.

Sending large data blocks to the 5200, I noticed that complete chunks of
data are missing in the output read in user space.  This is apparently *not*
a problem on the uart layer; the result of the TIOCGICOUNT ioctl does not
report any errors from the uart, and the serial_icounter_struct.rx field
contains *exactly* the correct number of data bytes I transmitted.  The
data loss seems to occur only if the block is larger than 64 kByte, but I
didn't find a scheme of the actually missing number of bytes.  However, it's
always a larger chunk of several hundred bytes to kBytes.

Am I simply too dumb to use the uart correctly, or is there some issue in
the kernel causing this effect?  I noticed that the function
mpc52xx_uart_int_rx_chars() does not check the return value of
tty_insert_flip_char().  If the system runs out of space (actually, the
maximum buffer size used should be limited, in particular on embedded
systems!), might this be undetected?  This might explain the bigger
"chunks", as the '5200's uart has a rather big fifo.

Any insight would be really appreciated!

Thanks in advance,
Albrecht.


More information about the Linuxppc-dev mailing list