Commit 977e209a authored by Alexandre Bailon's avatar Alexandre Bailon Committed by Johan Hovold

greybus: es1/es2: set transfer flag to send a zero-length packet

Greybus messages with a multiple size of 512B generate timeouts
(any other message size doesn't).
512B is exactly the packet size of a bulk out endpoint.
Hence USB device is expecting a short (< 512B)
or zero-length packet to finish the transfer,
which is never generated and causes the timeout.

Set the transfer flag to send a zero-length packet in this situation.
Signed-off-by: default avatarAlexandre Bailon <abailon@baylibre.com>
Reviewed-by: default avatarPatrick Titiano <ptitiano@baylibre.com>
Reviewed-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
parent 98676ca8
......@@ -216,6 +216,7 @@ static int message_send(struct greybus_host_device *hd, u16 cport_id,
usb_sndbulkpipe(udev, es1->cport_out_endpoint),
message->buffer, buffer_size,
cport_out_callback, message);
urb->transfer_flags |= URB_ZERO_PACKET;
gb_connection_push_timestamp(message->operation->connection);
retval = usb_submit_urb(urb, gfp_mask);
if (retval) {
......
......@@ -312,6 +312,7 @@ static int message_send(struct greybus_host_device *hd, u16 cport_id,
es1->cport_out[bulk_ep_set].endpoint),
message->buffer, buffer_size,
cport_out_callback, message);
urb->transfer_flags |= URB_ZERO_PACKET;
gb_connection_push_timestamp(message->operation->connection);
retval = usb_submit_urb(urb, gfp_mask);
if (retval) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment