greybus: es1/es2: set transfer flag to send a zero-length packet
authorAlexandre Bailon <abailon@baylibre.com>
Mon, 31 Aug 2015 07:00:16 +0000 (09:00 +0200)
committerJohan Hovold <johan@hovoldconsulting.com>
Tue, 1 Sep 2015 12:36:52 +0000 (14:36 +0200)
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: Alexandre Bailon <abailon@baylibre.com>
Reviewed-by: Patrick Titiano <ptitiano@baylibre.com>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
drivers/staging/greybus/es1.c
drivers/staging/greybus/es2.c

index 2aa271751ac11b4252c4508347b26e62a590c2dd..ddc26dec31501fd0bad9422345e07183eb127c61 100644 (file)
@@ -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) {
index 008685b2b15bcc17cafa9c15c71adf6cc17cadbd..295cc6839551859838dd9b2b2e3778a2e8276d72 100644 (file)
@@ -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) {