From: Ming Lei Date: Mon, 5 Sep 2011 13:05:56 +0000 (+0800) Subject: usb: ehci: only prepare zero packet for out transfer if required X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9a971dda8208e0982094f29ef34bd190f2a081bd;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git usb: ehci: only prepare zero packet for out transfer if required Obviously, ZLP is only required for transfer of OUT direction, so just take same policy with UHCI for ZLP packet. Signed-off-by: Ming Lei Signed-off-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c index 726bd9d74ebb..ef5925830bf1 100644 --- a/drivers/usb/host/ehci-q.c +++ b/drivers/usb/host/ehci-q.c @@ -722,7 +722,8 @@ qh_urb_transaction ( /* * control requests may need a terminating data "status" ack; - * bulk ones may need a terminating short packet (zero length). + * other OUT ones may need a terminating short packet + * (zero length). */ if (likely (urb->transfer_buffer_length != 0)) { int one_more = 0; @@ -731,7 +732,7 @@ qh_urb_transaction ( one_more = 1; token ^= 0x0100; /* "in" <--> "out" */ token |= QTD_TOGGLE; /* force DATA1 */ - } else if (usb_pipebulk (urb->pipe) + } else if (usb_pipeout(urb->pipe) && (urb->transfer_flags & URB_ZERO_PACKET) && !(urb->transfer_buffer_length % maxpacket)) { one_more = 1;