summaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorAlban Browaeys <alban.browaeys@gmail.com>2016-08-16 10:18:04 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-08-16 09:42:47 +0200
commit0d2daaded82565f807a4435d678343f437b8b848 (patch)
tree3c3e62014f24134fe5a58ac9143bc6706f7641de /drivers/usb/host
parent33be126510974e2eb9679f1ca9bca4f67ee4c4c7 (diff)
downloadlinux-stable-0d2daaded82565f807a4435d678343f437b8b848.tar.gz
linux-stable-0d2daaded82565f807a4435d678343f437b8b848.tar.bz2
linux-stable-0d2daaded82565f807a4435d678343f437b8b848.zip
xhci: really enqueue zero length TRBs.
Enqueue the first TRB even if full_len is zero. Without this "adb install <apk>" freezes the system. Signed-off-by: Alban Browaeys <alban.browaeys@gmail.com> Fixes: 86065c2719a5 ("xhci: don't rely on precalculated value of needed trbs in the enqueue loop") Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/xhci-ring.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index fe5b70be61ba..fd9fd12e4861 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -3244,7 +3244,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
send_addr = addr;
/* Queue the TRBs, even if they are zero-length */
- for (enqd_len = 0; enqd_len < full_len; enqd_len += trb_buff_len) {
+ for (enqd_len = 0; first_trb || enqd_len < full_len;
+ enqd_len += trb_buff_len) {
field = TRB_TYPE(TRB_NORMAL);
/* TRB buffer should not cross 64KB boundaries */