usb: xhci: fix lack of short packet event trb handling 73/267873/2
authorRan Wang <ran.wang_1@nxp.com>
Wed, 18 Nov 2020 07:49:02 +0000 (15:49 +0800)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Mon, 13 Dec 2021 01:43:56 +0000 (01:43 +0000)
commit0833eec37930e90e3c194b08783275479c007bf4
tree7794f24d67dbfe0ad8e4c8f7f34f21c0e6f07d13
parent1605fff19b87c2ddb2ce7c72f992f70483b67cc7
usb: xhci: fix lack of short packet event trb handling

For bulk IN transfer, the codes will set ISP flag to request event TRB
being generated by xHC for the case of short packet. So when encountering
buffer-cross-64K-boundary (which we will divide payload and enqueuqe
more than 1 transfer TRB), and the first TRB ends up with a short packet
condition it will trigger an short packet code transfer event per that
flag and cause more than 1 event TRB generated for this transfer.

However, current codes will only handle the first transfer event TRB
then mark current transfer completed, causing next transfer
failure due to event TRB mis-match.

Such issue has been observed on some Layerscape platforms (LS1028A,
LS1088A, etc) with USB ethernet device.

This patch adds a loop to make sure the event TRB for last transfer TRB
has been handled in time.

Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[backport of mainline commit 621ed49d3a2ea3c45be1cf774bef48439bd566f3]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I96681cfacd51d94c70170f397402f5956bea0ee4
drivers/usb/host/xhci-ring.c