mirror of
https://github.com/apache/nuttx.git
synced 2026-08-18 11:41:51 +08:00
drivers/usbhost: Take an xHCI command result from its completion event.
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:
committed by
Alan C. Assis
parent
440d5f7f87
commit
3b7e453012
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user