kern/65769: Call to tcflush(x, TCIFLUSH) stops input on usb-serial
cejkar at fit.vutbr.cz
Mon Apr 19 09:10:19 PDT 2004
>Synopsis: Call to tcflush(x, TCIFLUSH) stops input on usb-serial forever
>Arrival-Date: Mon Apr 19 09:10:19 PDT 2004
>Originator: Rudolf Cejka
FIT, Brno University of Technology, Czech Republic
Tested on -current, but it seems that -stable has the same problem.
I have tried remote kernel debugging over serial line with usb-to-serial
converter on local debugging machine. However, it does not work. I have
found, that gdb calls tcflush(x, TCIFLUSH) in contrib/gdb/gdb/ser-unix.c
and tcflush() itself calls t_stop() in both read and write cases, which
is function ucomstop() for USB code. However, ucomstop() hardware-disables
receiver, which is not expected from tcflush() side, because there is no
place, which would enable receiver again. It means that caling
tcflush(x, TCIFLUSH) or tcflush(x, TCIOFLUSH) flushes and disables input,
but it should just flush it.
It seems that function t_stop() should not be called in tcflush() at all
as is in NetBSD case, however I tried just partial thing - I have tried
to remove t_stop() just from the read path (as was for revisions 1.1 - 1.15
of sys/kern/tty.c), which does work for me and remote kernel debugging works
again for me. However, it still does not solve anything, if
tcflush(x, TCIOFLUSH) is called.
Simply try remote debugging session with gdb over serial line with
usb-to-serial converter - it does not work, because there is not
input from target machine, however it is possible to read the input
with tip utility, because tip does not call tcflush().
More information about the freebsd-bugs