From c5ea0115b0c2bd8a2726f47443b71b5c5e446079 Mon Sep 17 00:00:00 2001 From: Greg Crain Date: Wed, 8 Nov 2017 15:11:40 -0600 Subject: [PATCH] xhci: Fix incorrect TRB offset; solves #13343 * The incorrect offset would result in semaphores timing out Signed-off-by: Alexander von Gluck IV --- src/add-ons/kernel/busses/usb/xhci.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/add-ons/kernel/busses/usb/xhci.cpp b/src/add-ons/kernel/busses/usb/xhci.cpp index 5babbd1430..f50993e1e3 100644 --- a/src/add-ons/kernel/busses/usb/xhci.cpp +++ b/src/add-ons/kernel/busses/usb/xhci.cpp @@ -2065,7 +2065,7 @@ XHCI::HandleTransferComplete(xhci_trb* trb) int64 offset = source - td_chain->this_phy; TRACE("HandleTransferComplete td %p offset %" B_PRId64 " %" B_PRIxADDR "\n", td_chain, offset, source); - offset = offset / sizeof(xhci_trb); + offset = offset / sizeof(xhci_trb) + 1; if (offset <= td_chain->trb_count && offset >= 0) { TRACE("HandleTransferComplete td %p trb %" B_PRId64 " found " "\n", td_chain, offset);