xhci: properly prepare zero packet TD after normal bulk TD.
authorMathias Nyman <mathias.nyman@linux.intel.com>
Tue, 21 Jun 2016 07:57:58 +0000 (10:57 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 26 Jun 2016 18:43:39 +0000 (11:43 -0700)
commit5a83f04a7961bbbbae9f9ff389aef0e2c1b0d843
tree2843194527625afe2e315c77a798b64e97497cbb
parent5a5a0b1ae54c9467594e75957240b25863d7e997
xhci: properly prepare zero packet TD after normal bulk TD.

If a zero-length packet is needed after a bulk transfer, then an
additional zero length TD was prepared before enqueueing the bulk transfer
This set up the zero packet TD structure with incorrect td->start_seg
and td->first_trb pointers.

Prepare the zero packet TD after the data bulk TD is enqueued instead.
It sets these pointers correctly.

This change also simplifies unnecessary complexity related to keeping
track of the last trb when enqueuing trbs.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-ring.c