linux/drivers/usb/class
Bjørn Mork 8dd5cd5395 usb: cdc-wdm: avoid hanging on zero length reads
commit 73e06865ea ("USB: cdc-wdm: support back-to-back
USB_CDC_NOTIFY_RESPONSE_AVAILABLE notifications") implemented
queued response handling. This added a new requirement: The read
urb must be resubmitted every time we clear the WDM_READ flag if
the response counter indicates that the device is waiting for a
read.

Fix by factoring out the code handling the WMD_READ clearing and
possible urb submission, calling it everywhere we clear the flag.

Without this fix, the driver ends up in a state where the read urb
is inactive, but the response counter is positive after a zero
length read.  This prevents the read urb from ever being submitted
again and the driver appears to be hanging.

Fixes: 73e06865ea ("USB: cdc-wdm: support back-to-back USB_CDC_NOTIFY_RESPONSE_AVAILABLE notifications")
Cc: Greg Suarez <gsuarez@smithmicro.com>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Cc: stable <stable@vger.kernel.org> # 3.13
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 12:06:46 -08:00
..
cdc-acm.c Merge branch 3.13-rc4 into usb-next 2013-12-16 08:46:03 -08:00
cdc-acm.h cdc-acm: add TIOCMIWAIT 2013-12-03 10:23:46 -08:00
cdc-wdm.c usb: cdc-wdm: avoid hanging on zero length reads 2013-12-20 12:06:46 -08:00
Kconfig USB: regroup all depends on USB within an if USB block 2013-04-09 16:49:07 -07:00
Makefile
usblp.c USB: usblp.c: remove dbg() usage 2012-05-01 21:33:31 -07:00
usbtmc.c USB: usbtmc: fix up attribute permissions 2013-08-25 15:12:03 -07:00