linux-stable/drivers/usb
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
..
atm Usb: atm: usbatm: fixed a pointer variable format issue 2013-12-08 18:01:56 -08:00
c67x00 USB: c67x00: remove CONFIG_USB_DEBUG dependancy 2013-12-20 11:46:19 -08:00
chipidea usb: chipidea: usbmisc: Add support for i.MX51 CPU 2013-12-08 18:02:55 -08:00
class usb: cdc-wdm: avoid hanging on zero length reads 2013-12-20 12:06:46 -08:00
core Merge branch 3.13-rc4 into usb-next 2013-12-16 08:46:03 -08:00
dwc3 Merge branch 3.13-rc4 into usb-next 2013-12-16 08:46:03 -08:00
early USB: ehci-dbgp: drop dead code. 2013-09-26 16:25:21 -07:00
gadget Merge branch 3.13-rc4 into usb-next 2013-12-16 08:46:03 -08:00
host USB: ohci-octeon: Use devm_ioremap_resource() 2013-12-18 16:36:11 -08:00
image USB: regroup all depends on USB within an if USB block 2013-04-09 16:49:07 -07:00
misc drivers: usb: Mark function as static in usbsevseg.c 2013-12-19 10:23:12 -08:00
mon USB: regroup all depends on USB within an if USB block 2013-04-09 16:49:07 -07:00
musb Merge branch 3.13-rc4 into usb-next 2013-12-16 08:46:03 -08:00
phy Merge branch 3.13-rc4 into usb-next 2013-12-16 08:46:03 -08:00
renesas_usbhs usb: hcd: move controller wakeup setting initialization to individual driver 2013-12-08 18:06:46 -08:00
serial drivers: usb: Mark function as static in metro-usb.c 2013-12-19 10:23:12 -08:00
storage USB: storage: fix compile warning 2013-12-09 23:45:39 -08:00
wusbcore usb: wusbcore: add isochronous IN support to HWA 2013-12-17 17:01:46 -08:00
Kconfig usb: Move definition of USB_EHCI_BIG_ENDIAN_MMIO et al. out side of the ifs. 2013-08-12 12:18:38 -07:00
Makefile usb: patches for v3.12 merge window 2013-08-13 15:28:01 -07:00
README
usb-common.c usb: common: introduce of_usb_get_maximum_speed() 2013-07-29 13:56:46 +03:00
usb-skeleton.c USB: usb-skeleton.c: add retry for nonblocking read 2013-07-25 12:01:13 -07:00

To understand all the Linux-USB framework, you'll use these resources:

    * This source code.  This is necessarily an evolving work, and
      includes kerneldoc that should help you get a current overview.
      ("make pdfdocs", and then look at "usb.pdf" for host side and
      "gadget.pdf" for peripheral side.)  Also, Documentation/usb has
      more information.

    * The USB 2.0 specification (from www.usb.org), with supplements
      such as those for USB OTG and the various device classes.
      The USB specification has a good overview chapter, and USB
      peripherals conform to the widely known "Chapter 9".

    * Chip specifications for USB controllers.  Examples include
      host controllers (on PCs, servers, and more); peripheral
      controllers (in devices with Linux firmware, like printers or
      cell phones); and hard-wired peripherals like Ethernet adapters.

    * Specifications for other protocols implemented by USB peripheral
      functions.  Some are vendor-specific; others are vendor-neutral
      but just standardized outside of the www.usb.org team.

Here is a list of what each subdirectory here is, and what is contained in
them.

core/		- This is for the core USB host code, including the
		  usbfs files and the hub class driver ("khubd").

host/		- This is for USB host controller drivers.  This
		  includes UHCI, OHCI, EHCI, and others that might
		  be used with more specialized "embedded" systems.

gadget/		- This is for USB peripheral controller drivers and
		  the various gadget drivers which talk to them.


Individual USB driver directories.  A new driver should be added to the
first subdirectory in the list below that it fits into.

image/		- This is for still image drivers, like scanners or
		  digital cameras.
../input/	- This is for any driver that uses the input subsystem,
		  like keyboard, mice, touchscreens, tablets, etc.
../media/	- This is for multimedia drivers, like video cameras,
		  radios, and any other drivers that talk to the v4l
		  subsystem.
../net/		- This is for network drivers.
serial/		- This is for USB to serial drivers.
storage/	- This is for USB mass-storage drivers.
class/		- This is for all USB device drivers that do not fit
		  into any of the above categories, and work for a range
		  of USB Class specified devices. 
misc/		- This is for all USB device drivers that do not fit
		  into any of the above categories.