Skip to content

Commit 8317dea

Browse files
xiaoguangwulijinxia
authored andcommitted
DM USB: fix guest kernel short packets warning
There are many 'short packet' warnings in the UOS kernel dmesg output, which are result from bad short packet identification algorithm. This patch is used to fix it. Change-Id: Idfa0b87fc96893b80d5c9fe8dab4db35aa5bfe84 Tracked-On: Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com> Reviewed-by: Liang Yang <liang3.yang@intel.com> Acked-by: Yu Wang <yu1.wang@intel.com>
1 parent 7431a90 commit 8317dea

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

devicemodel/hw/platform/usb_pmapper.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,13 @@ usb_dev_comp_req(struct libusb_transfer *libusb_xfer)
106106
for (i = 0; i < req->blk_count; i++) {
107107
done = 0;
108108
block = &xfer->data[idx % USB_MAX_XFER_BLOCKS];
109+
110+
/* Link TRB need to be skipped */
111+
if (!block->buf || !block->blen) {
112+
idx = (idx + 1) % USB_MAX_XFER_BLOCKS;
113+
continue;
114+
}
115+
109116
if (len > buf_idx) {
110117
done = block->blen;
111118
if (done > len - buf_idx) {
@@ -203,6 +210,7 @@ usb_dev_prepare_xfer(struct usb_data_xfer *xfer, int *count, int *size)
203210

204211
if (block->processed) {
205212
idx = (idx + 1) % USB_MAX_XFER_BLOCKS;
213+
c++;
206214
continue;
207215
}
208216
if (block->buf && block->blen > 0) {

0 commit comments

Comments
 (0)