Skip to content

Commit 7c79d09

Browse files
Sebastian Andrzej Siewiorgregkh
authored andcommitted
USB: usbtest: use URB_ZERO_PACKET for BULK-OUT transfers
Executing | testusb -a -c 1 -t 3 -v 421 -s 2048 does not complete on the gadget side. g_zero enqueues a 4096 bytes long buffer. The host sends 2048bytes which is a multiple of wMaxPacketSize (either 64 or 512 bytes). The host is done with sending data but the gadget waits for more. Since the protocol does not include transfer-length-field sending a terminating zero packet seems the only way out. Reviewed-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent 39eb4ed commit 7c79d09

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎drivers/usb/misc/usbtest.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,8 +359,10 @@ static int simple_io(
359359
urb->context = &completion;
360360
while (retval == 0 && iterations-- > 0) {
361361
init_completion(&completion);
362-
if (usb_pipeout(urb->pipe))
362+
if (usb_pipeout(urb->pipe)) {
363363
simple_fill_buf(urb);
364+
urb->transfer_flags |= URB_ZERO_PACKET;
365+
}
364366
retval = usb_submit_urb(urb, GFP_KERNEL);
365367
if (retval != 0)
366368
break;

0 commit comments

Comments
 (0)