Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 919f853c authored by Hemant Kumar's avatar Hemant Kumar Committed by Jack Pham
Browse files

usb: XHCI: Handle ZLP data properly in control transfers



USB control transfers can contain an optional IN data stage, in which
case the xHCI driver would queue an additional TRB. The interrupt on
short packet (ISP) bit is set so that the host controller driver can
update the URB's actual_length field if packet is received has length
less than the queued buffer.

A zero-length packet (ZLP) received during the data stage is a special
case of a short packet but is currently not handled properly since during
the subsequent status stage the driver ends up overwriting the
actual_length field with transfer_buffer_length, which was the original
buffer length. A function driver will then incorrectly interpret the
completed URB as being of full length.

Fix this by setting a flag when a ZLP is received in the data stage so
that the urb->actual_length remains 0 and does not get overwritten in
the status stage.

Change-Id: Ie2e5c55c2296d89c496f2c803b0050ff5c5831a1
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent 4a149ed1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment