drivers/usbhost: Take an xHCI command result from its completion event.
Some checks are pending
Build Documentation / build-html (push) Waiting to run
MemBrowse Memory Report / changes-filter (push) Waiting to run
MemBrowse Memory Report / load-targets (push) Waiting to run
MemBrowse Memory Report / identical (push) Blocked by required conditions
MemBrowse Memory Report / analyze (push) Blocked by required conditions

xhci_command() returned -ETIMEDOUT when a completion arrived without an
interrupt, although the fallback poll had already retrieved the event,
so callers unwound work the controller had completed.

Use the event's completion code whichever path retrieved it.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Justin Hammond <justin@dynam.ac>
This commit is contained in:
Justin Hammond 2026-08-16 16:03:56 +08:00 committed by Alan C. Assis
parent 440d5f7f87
commit 3b7e453012

View file

@ -1938,7 +1938,15 @@ static int xhci_command(FAR struct usbhost_xhci_s *priv,
trb->d1 = priv->cmdres.d1;
trb->d2 = priv->cmdres.d2;
if (XHCI_TRB_D1_CC_GET(trb->d1) != XHCI_TRB_CC_SUCCESS)
if (XHCI_TRB_D1_CC_GET(trb->d1) == XHCI_TRB_CC_SUCCESS)
{
/* The completion event decides the result, whether it arrived by
* interrupt or was found by the poll above.
*/
ret = OK;
}
else
{
pcierr("event CC = %d\n", XHCI_TRB_D1_CC_GET(trb->d1));
ret = -EIO;