xhci: don't finish a TD if we get a short transfer event mid TD
authorMathias Nyman <mathias.nyman@linux.intel.com>
Mon, 12 Oct 2015 08:30:11 +0000 (11:30 +0300)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 17 Nov 2015 15:54:43 +0000 (15:54 +0000)
commit7c6aca1947a312bcc23dc8e1000e4f13c7b43555
treea3508c77840d58411460247e01cb3bd1be87fcdc
parentcca532890dad576fbe5cbff1ba9411d710292a9a
xhci: don't finish a TD if we get a short transfer event mid TD

commit e210c422b6fdd2dc123bedc588f399aefd8bf9de upstream.

If the difference is big enough between the bytes asked and received
in a bulk transfer we can get a short transfer event pointing to a TRB in
the middle of the TD. We don't want to handle the TD yet as we will anyway
receive a new event for the last TRB in the TD.

Hold off from finishing the TD and removing it from the list until we
receive an event for the last TRB in the TD

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/usb/host/xhci-ring.c