This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit ecbd1870d34e42c741ce5efe3cad49f338bda5dd Author: Justin Hammond <[email protected]> AuthorDate: Sun Aug 16 17:14:53 2026 +0800 drivers/usbhost: Report which xHCI command was rejected. A failed command logged only its completion code. The difference between a refused Address Device and a refused Evaluate Context is most of the diagnosis, and the completion code does not give it. Keep the command type before the result overwrites the TRB, and name it in the message. Assisted-by: Claude:claude-opus-5 Signed-off-by: Justin Hammond <[email protected]> --- drivers/usbhost/usbhost_xhci.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/usbhost/usbhost_xhci.c b/drivers/usbhost/usbhost_xhci.c index c92fec198be..b1f05a3385b 100644 --- a/drivers/usbhost/usbhost_xhci.c +++ b/drivers/usbhost/usbhost_xhci.c @@ -1915,7 +1915,8 @@ static void xhci_context_ctrl(FAR struct usbhost_xhci_s *priv, static int xhci_command(FAR struct usbhost_xhci_s *priv, FAR struct xhci_trb_s *trb, uint16_t timeout_ms) { - int ret; + uint32_t cmdtype; + int ret; /* Lock bus */ @@ -1925,6 +1926,10 @@ static int xhci_command(FAR struct usbhost_xhci_s *priv, return ret; } + /* Remember what this was before the result overwrites it */ + + cmdtype = XHCI_TRB_D2_TYPE_GET(trb->d2); + /* Add command to ring */ xhci_add_trb(priv, &priv->cmd, trb, 1); @@ -1960,7 +1965,8 @@ static int xhci_command(FAR struct usbhost_xhci_s *priv, } else { - uerr("event CC = %d\n", XHCI_TRB_D1_CC_GET(trb->d1)); + uerr("command type %d failed, CC = %d\n", cmdtype, + XHCI_TRB_D1_CC_GET(trb->d1)); ret = -EIO; }
