Skip to content

Commit 0d2daad

Browse files
prahalgregkh
authored andcommitted
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: 86065c2 ("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>
1 parent 33be126 commit 0d2daad

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/usb/host/xhci-ring.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3244,7 +3244,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
32443244
send_addr = addr;
32453245

32463246
/* Queue the TRBs, even if they are zero-length */
3247-
for (enqd_len = 0; enqd_len < full_len; enqd_len += trb_buff_len) {
3247+
for (enqd_len = 0; first_trb || enqd_len < full_len;
3248+
enqd_len += trb_buff_len) {
32483249
field = TRB_TYPE(TRB_NORMAL);
32493250

32503251
/* TRB buffer should not cross 64KB boundaries */

0 commit comments

Comments
 (0)