>From a895eb69a63dfef1943f0593da29167bea12100c Mon Sep 17 00:00:00 2001 From: Mathias Nyman Date: Tue, 10 Mar 2015 18:50:45 +0200 Subject: [PATCH] xhci: set correct dequeue status in endpoint soft reset The endpoint might already processesed some TRBs on the endpiont ring before we soft reset the endpoint. Make sure we set the dequeue pointer to where we were befere soft reset Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index b06d1a5..64527a4 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -2972,6 +2972,8 @@ void xhci_endpoint_reset(struct usb_hcd *hcd, unsigned int ep_index, ep_state; unsigned long flags; u32 ep_flag; + struct xhci_ep_ctx *ep_ctx; + dma_addr_t addr; xhci = hcd_to_xhci(hcd); udev = (struct usb_device *) ep->hcpriv; @@ -3046,6 +3048,9 @@ void xhci_endpoint_reset(struct usb_hcd *hcd, virt_dev->out_ctx, ctrl_ctx, ep_flag, ep_flag); xhci_endpoint_copy(xhci, command->in_ctx, virt_dev->out_ctx, ep_index); + ep_ctx = xhci_get_ep_ctx(xhci, command->in_ctx, ep_index); + addr = xhci_trb_virt_to_dma(virt_ep->ring->deq_seg, virt_ep->ring->dequeue); + ep_ctx->deq = cpu_to_le64(addr | virt_ep->ring->cycle_state); xhci_queue_configure_endpoint(xhci, command, command->in_ctx->dma, udev->slot_id, false); -- 1.8.3.2