xHCI 1.0: Endpoint Not Enabled Error To handle the Endpoint Not Enabled Error described in section 4.7 of the xHCI spec v1.0. Add the limit condition to avoid ringing the doorbell of the dis- abled slot and do the WARN for the Endpoint Not Enabled Error. Signed-off-by: Alex He <alex.he@xxxxxxx> --- drivers/usb/host/xhci-ring.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 800f417..49c8bfe 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -314,6 +314,16 @@ void xhci_ring_ep_doorbell(struct xhci_hcd *xhci, __le32 __iomem *db_addr = &xhci->dba->doorbell[slot_id]; struct xhci_virt_ep *ep = &xhci->devs[slot_id]->eps[ep_index]; unsigned int ep_state = ep->ep_state; + struct xhci_virt_device *dev = xhci->devs[slot_id]; + struct xhci_slot_ctx *slot_ctx; + unsigned int slot_state; + + slot_ctx = xhci_get_slot_ctx(xhci, dev->out_ctx); + slot_state = GET_SLOT_STATE(slot_ctx->dev_state); + + /* Don't ring the doorbell of the disabled slot */ + if (slot_state == SLOT_STATE_DISABLED) + return; /* Don't ring the doorbell for this endpoint if there are pending * cancellations because we don't want to interrupt processing. @@ -1995,6 +2005,10 @@ static int handle_tx_event(struct xhci_hcd *xhci, case COMP_BUFF_OVER: xhci_warn(xhci, "WARN: buffer overrun event on endpoint\n"); break; + case COMP_EBADEP: + xhci_warn(xhci, "WARN: Doorbell rung for disabled slot " + "or endpoint\n"); + goto cleanup; case COMP_UNDERRUN: /* * When the Isoch ring is empty, the xHC will generate -- 1.7.0.4 -- 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