summaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2019-11-28 21:49:42 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2019-11-28 21:49:42 +0000
commit2b5f0a37935e0f3f2833d748729effb8cbb0ec93 (patch)
tree3bb354a8b302c6742b8bafcc00807580219d3128 /sys/dev/usb
parent5a53f4773ce46091d0875634196c68c53b396a89 (diff)
On short transfers with multiple TRBs in a TD we get two events.
One on the TRB that went short, and one for the last TRB in a TD. We already set actlen only once so that the last TRB in a TD does not override it, but some controllers throw another short event instead of a success event, so we have to add the same check there as well. ok gerhard@ mglocker@
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/xhci.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/usb/xhci.c b/sys/dev/usb/xhci.c
index 064235b2841..5ee346c9f17 100644
--- a/sys/dev/usb/xhci.c
+++ b/sys/dev/usb/xhci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xhci.c,v 1.108 2019/11/18 20:25:49 mglocker Exp $ */
+/* $OpenBSD: xhci.c,v 1.109 2019/11/28 21:49:41 patrick Exp $ */
/*
* Copyright (c) 2014-2015 Martin Pieuchot
@@ -856,8 +856,9 @@ xhci_event_xfer_generic(struct xhci_softc *sc, struct usbd_xfer *xfer,
/*
* Use values from the transfer TRB instead of the status TRB.
*/
- xfer->actlen = xhci_xfer_length_generic(xx, xp, trb_idx) -
- remain;
+ if (xfer->actlen == 0)
+ xfer->actlen =
+ xhci_xfer_length_generic(xx, xp, trb_idx) - remain;
/*
* If this is not the last TRB of a transfer, we should
* theoretically clear the IOC at the end of the chain