[PATCH] xhci: set correct dequeue status in endpoint soft reset

From: Mathias Nyman
Date: Tue Mar 10 2015 - 12:50:45 EST

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 <mathias.nyman@xxxxxxxxxxxxxxx>
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);

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/