hrev52888 adds 2 changesets to branch 'master'
old head: b5ded9cc1a6d720ffe535cd0264fc15ed1949a73
new head: 0ca15910c4ff066fc8882ba3e48593fcb39fb091
overview:
https://git.haiku-os.org/haiku/log/?qt=range&q=0ca15910c4ff+%5Eb5ded9cc1a6d
----------------------------------------------------------------------------
db360a206482: XHCI: Make sure we have at least one TRB in CreateDescriptorChain.
Linux seems to do the same thing. Confirmed as correct by korli
in #12929.
0ca15910c4ff: XHCI: Check return value of _LinkDescriptorForPipe.
[ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]
----------------------------------------------------------------------------
1 file changed, 9 insertions(+), 2 deletions(-)
src/add-ons/kernel/busses/usb/xhci.cpp | 11 +++++++++--
############################################################################
Commit: db360a206482811f67aaf677d49c675125c9079f
URL: https://git.haiku-os.org/haiku/commit/?id=db360a206482
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Mon Feb 18 16:40:45 2019 UTC
Ticket: https://dev.haiku-os.org/ticket/12929
XHCI: Make sure we have at least one TRB in CreateDescriptorChain.
Linux seems to do the same thing. Confirmed as correct by korli
in #12929.
----------------------------------------------------------------------------
diff --git a/src/add-ons/kernel/busses/usb/xhci.cpp
b/src/add-ons/kernel/busses/usb/xhci.cpp
index d816446318..7acc3914ff 100644
--- a/src/add-ons/kernel/busses/usb/xhci.cpp
+++ b/src/add-ons/kernel/busses/usb/xhci.cpp
@@ -883,6 +883,9 @@ XHCI::CreateDescriptorChain(size_t bufferSize, int32
&trbCount)
{
size_t packetSize = B_PAGE_SIZE * 16;
trbCount = (bufferSize + packetSize - 1) / packetSize;
+ if (trbCount == 0)
+ trbCount = 1;
+
// keep one trb for linking
int32 tdCount = (trbCount + XHCI_MAX_TRBS_PER_TD - 2)
/ (XHCI_MAX_TRBS_PER_TD - 1);
############################################################################
Revision: hrev52888
Commit: 0ca15910c4ff066fc8882ba3e48593fcb39fb091
URL: https://git.haiku-os.org/haiku/commit/?id=0ca15910c4ff
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Mon Feb 18 16:42:14 2019 UTC
XHCI: Check return value of _LinkDescriptorForPipe.
----------------------------------------------------------------------------
diff --git a/src/add-ons/kernel/busses/usb/xhci.cpp
b/src/add-ons/kernel/busses/usb/xhci.cpp
index 7acc3914ff..606eec84c8 100644
--- a/src/add-ons/kernel/busses/usb/xhci.cpp
+++ b/src/add-ons/kernel/busses/usb/xhci.cpp
@@ -672,7 +672,9 @@ XHCI::SubmitControlRequest(Transfer *transfer)
return status;
setupDescriptor->transfer = transfer;
- _LinkDescriptorForPipe(setupDescriptor, endpoint);
+ status = _LinkDescriptorForPipe(setupDescriptor, endpoint);
+ if (status != B_OK)
+ return status;
TRACE("SubmitControlRequest() request linked\n");
TRACE("Endpoint status 0x%08" B_PRIx32 " 0x%08" B_PRIx32 " 0x%016"
B_PRIx64 "\n",
@@ -754,7 +756,9 @@ XHCI::SubmitNormalRequest(Transfer *transfer)
xhci_endpoint *endpoint = (xhci_endpoint *)pipe->ControllerCookie();
descriptor->transfer = transfer;
- _LinkDescriptorForPipe(descriptor, endpoint);
+ status = _LinkDescriptorForPipe(descriptor, endpoint);
+ if (status != B_OK)
+ return status;
TRACE("SubmitNormalRequest() request linked\n");
TRACE("Endpoint status 0x%08" B_PRIx32 " 0x%08" B_PRIx32 " 0x%016"
B_PRIx64 "\n",