Re: Linux 2.6.28-rc2 i/o error on /dev/ttyUSB0

From: Alan Cox
Date: Thu Oct 30 2008 - 13:23:32 EST


> It looks partially fixed.
> No more I/O errors, and the gps unit works fine.
>
> But look at the attached dmesg file - there are WARNINGs still.

Thats an unrelated and long long standing bug - the USB serial close paths
are all racy versus the received URB handlers. The only reason you now
will occasionally get a warning message is that we bother to actually trap
the case rather than praying silently it doesn't blow up.

What actually occurs is that you enter usb-serial:usb_serial_close which
then drops port->port.count and calls type->close. Somewhere in there new
data arrives and the ldisc path gets to run. The n_tty path tries to echo
back bytes to the (closed) port and the WARN triggers.

Changing the order to clear the port->tty first requires auditing each and
every USB serial driver close method so isn't planned for this release -
but its not caused major disasters in the past few years the race has been
there.

I can push patches this release for it if Linus particularly wants
however.

Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/