]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
USB: serial gadget: rx path data loss fixes
authorDavid Brownell <dbrownell@users.sourceforge.net>
Mon, 7 Jul 2008 19:16:08 +0000 (12:16 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 14 Aug 2008 00:32:53 +0000 (17:32 -0700)
commit937ef73d5075997a8d1777abf217a48bef2ce029
treea52d840362b3421116c29aa9a2636a8c30d70154
parente8b24450a635bbbd3a2b4c2649eef060c742ebc0
USB: serial gadget: rx path data loss fixes

Update RX path handling in new serial gadget code to cope better with
RX blockage:  queue every RX packet until its contents can safely be
passed up to the ldisc.  Most of the RX path work is now done in the
RX tasklet, instead of just the final "push to ldisc" step.  This
addresses some cases of data loss:

  - A longstanding serial gadget bug: when tty_insert_flip_string()
    didn't copy the entire buffer, the rest of the characters were
    dropped!  Now that packet stays queued until the rest of its data
    is pushed to the ldisc.

  - Another longstanding issue:  in the unlikely case that an RX
    transfer returns data and also reports a fault, that data is
    no longer discarded.

  - In the recently added RX throttling logic:  it needs to stop
    pushing data into the TTY layer, instead of just not submitting
    new USB read requests.  When the TTY is throttled long enough,
    backpressure will eventually make the OUT endpoint NAK.

Also: an #ifdef is removed (no longer necessary); and start switching
to a better convention for debug messages (prefix them with tty name).

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/gadget/u_serial.c