DM USB: xHCI: fix corner case of short packet logic

The old logic identify the short packet complete status (CS) by
comparing the transfered bytes (TB) and the expected transfered
bytes (ETB), it is right only when no error happend. If error
appears, the TB may be less than the ETB, but DM should report
error CS instead of short packet CS.

Tracked-On: #3401
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
This commit is contained in:
Xiaoguang Wu
2019-07-05 22:55:13 +08:00
committed by wenlingz
parent 32d186ba68
commit 7a3ea2ad89

View File

@@ -2684,7 +2684,7 @@ pci_xhci_xfer_complete(struct pci_xhci_vdev *xdev,
} else
rem_len += xfer->data[i].blen;
if (rem_len > 0)
if (err == XHCI_TRB_ERROR_SUCCESS && rem_len > 0)
err = XHCI_TRB_ERROR_SHORT_PKT;
/* Only interrupt if IOC or short packet */