From a6b6515195af6f7e5bdcb89521f88eda1e516a17 Mon Sep 17 00:00:00 2001 From: hselasky Date: Thu, 25 Sep 2014 07:37:41 +0000 Subject: [PATCH] MFC r271953: Some XHCI hardware requires dropping the endpoint context before adding it again. Approved by: re, glebius git-svn-id: svn://svn.freebsd.org/base/stable/10@272097 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/dev/usb/controller/xhci.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c index 2b0ad00ae..6a4d894ab 100644 --- a/sys/dev/usb/controller/xhci.c +++ b/sys/dev/usb/controller/xhci.c @@ -2252,7 +2252,14 @@ xhci_configure_mask(struct usb_device *udev, uint32_t mask, uint8_t drop) xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx0, mask); xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx1, 0); } else { - xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx0, 0); + /* + * Some hardware requires that we drop the endpoint + * context before adding it again: + */ + xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx0, + mask & XHCI_INCTX_NON_CTRL_MASK); + + /* Add new endpoint context */ xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx1, mask); /* find most significant set bit */ -- 2.45.0