Hi On 02.07.2015 13:45, SAUROV KANTI SHYAM wrote: > Some undefined values, mostly null are coming in event->buffer in my case for "stop,-invalid length” transfer event. That doesn't sound good, what xhci vendor and version are you using? Have you seen/tried this on other xhci hw as well? What kernel version are you using? are there any custom xhci driver modification in it? > However, in the portion of the code you suggested does not increment the dequeue pointer of transfer event ring, for trb_comp_code = COMP_STOP_INVAL. > In handle_tx_event() cleanup: does not increment the dequeue pointer of transfer event ring. > In xhci_handle_event(): > … > case TRB_TYPE(TRB_TRANSFER): > ret = handle_tx_event(xhci, &event->trans_event); > if (ret < 0) > xhci->error_bitmask |= 1 << 9; > else > update_ptrs = 0; > … > if (update_ptrs) > /* Update SW event ring dequeue pointer */ > inc_deq(xhci, xhci->event_ring); > … > As update_ptrs=0, inc_deq(xhci, xhci->event_ring) won't run. > Regards, Event ring dequeue is increased either in handle_tx_event(), cleanup: if (trb_comp_code == COMP_MISSED_INT || !ep->skip) { inc_deq(xhci, xhci->event_ring); Or then in xhci_handle_event() if handle_tx_event() returns error. For example in handle_tx_event() if event->buffer is null, then ep_ring = xhci_dma_to_transfer_ring(ep, le64_to_cpu(event->buffer)); is NULL and the check immediately after would return with -ENODEV -Mathias P.S. The potion of code was not a suggestion, it was copypasted from the upstream xhci driver, and has looked like that since 3.17 kernel -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html