linux-stable/drivers/usb
Sarah Sharp f2d9b991c5 xhci: Set scatter-gather limit to avoid failed block writes.
Commit 35773dac5f "usb: xhci: Link TRB
must not occur within a USB payload burst" attempted to fix an issue
found with USB ethernet adapters, and inadvertently broke USB storage
devices.  The patch attempts to ensure that transfers never span a
segment, and rejects transfers that have more than 63 entries (or
possibly less, if some entries cross 64KB boundaries).

usb-storage limits the maximum transfer size to 120K, and we had assumed
the block layer would pass a scatter-gather list of 4K entries,
resulting in no more than 31 sglist entries:

http://marc.info/?l=linux-usb&m=138498190419312&w=2

That assumption was wrong, since we've seen the driver reject a write
that was 218 sectors long (of probably 512 bytes each):

Jan  1 07:04:49 jidanni5 kernel: [  559.624704] xhci_hcd 0000:00:14.0: Too many fragments 79, max 63
...
Jan  1 07:04:58 jidanni5 kernel: [  568.622583] Write(10): 2a 00 00 06 85 0e 00 00 da 00

Limit the number of scatter-gather entries to half a ring segment.  That
should be margin enough in case some entries cross 64KB boundaries.
Increase the number of TRBs per segment from 64 to 256, which should
result in ring segments fitting on a 4K page.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Reported-by: jidanni@jidanni.org
References: http://bugs.debian.org/733907
Fixes: 35773dac5f ('usb: xhci: Link TRB must not occur within a USB payload burst')
Cc: stable <stable@vger.kernel.org> # 3.12
2014-01-08 11:00:52 -08:00
..
atm Usb: atm: usbatm: fixed a pointer variable format issue 2013-12-08 18:01:56 -08:00
c67x00 USB: c67x00: move URB private data allocation from under spinlock 2014-01-07 16:15:39 -08:00
chipidea usb: chipidea: imx: set CI_HDRC_IMX28_WRITE_FIX for imx28 2014-01-07 16:26:05 -08:00
class Merge 3.13-rc5 into usb-next 2013-12-24 10:18:03 -08:00
core USB: core: correct spelling mistakes in comments and warning 2014-01-07 16:17:40 -08:00
dwc3 Merge 3.13-rc5 into usb-next 2013-12-24 10:18:03 -08:00
early USB: ehci-dbgp: drop dead code. 2013-09-26 16:25:21 -07:00
gadget usb: gadget: remove unused variable in gr_queue_int() 2014-01-07 16:30:25 -08:00
host xhci: Set scatter-gather limit to avoid failed block writes. 2014-01-08 11:00:52 -08:00
image
misc USB: misc: idmouse: correct spelling mistake in error string 2014-01-03 12:39:31 -08:00
mon
musb USB: musb: correct spelling mistakes in comment and error string 2014-01-03 12:39:31 -08:00
phy usb: changes for v3.14 merge window 2014-01-03 12:15:10 -08:00
renesas_usbhs usb: changes for v3.14 merge window 2014-01-03 12:15:10 -08:00
serial USB: ftdi_sio: added CS5 quirk for broken smartcard readers 2014-01-07 16:28:43 -08:00
storage USB: Nokia 502 is an unusual device 2014-01-03 12:40:22 -08:00
wusbcore USB: wusbcore: fix up coding style issues in wa-nep.c 2014-01-07 16:19:31 -08:00
Kconfig usb: musb: Rework USB and USB_GADGET dependency 2013-12-23 10:28:56 -06:00
Makefile
README
usb-common.c
usb-skeleton.c

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.