2004-04-21 09:59:58

by Petr Slansky

[permalink] [raw]
Subject: PROBLEM: serial port loopback serious bug

Description:

I observe the bug in kernel 2.4.21 and 2.4.22, I guess it is general problem
in 2.4.xx kernel. Command 'cat file >/dev/ttyS0' sends the first 4096 bytes
again and again...

DETAILS:

I have generic serial port on i586 machine (PC). I created loopback cable
(TX-RX and RTS-CTS pins connected) and conected the cable to serial port
ttyS0. Simple serial port loopback.

Configuration:
#stty 38400 raw clocal crtscts </dev/ttyS0

Command in console1 (capture ttyS0 to file):
#cat /dev/ttyS0 > fileI.bin

Command in console2 (send a longer file to ttyS0):
#cat fileO.bin >/dev/ttyS0

The file fileO.bin have to be at least 4096 bytes long.

I guess you know what is expected result but I bet you don't know real
result under Linux. I will tell you. Only first 4096 bytes are sent to
/dev/ttyS0. After that this sequence is read from /dev/ttyS0 again and
again..., even when no data are send to /dev/ttyS0 anymore. I tested this
sequence on FreeBSD 4.9 too and I had no problem with loopback like
this there. Something is seriosly wrong in kernel 2.4.x What about 2.6.x??

With regards,
Petr


---------------------------------
Petr Slansky, [email protected]
---------------------------------