Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Dec 2014 08:33:51 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r276404 - head/sys/dev/usb/controller
Message-ID:  <201412300833.sBU8Xp55078446@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Tue Dec 30 08:33:51 2014
New Revision: 276404
URL: https://svnweb.freebsd.org/changeset/base/276404

Log:
  Add missed flushing of data which can happen when "xhci_configure_mask()"
  is called from "xhci_configure_reset_endpoint()". Ensure the 3-strikes
  error feature is always enabled except for ISOCHRONOUS transfers.
  
  MFC after:	1 week
  Suggested by:	marius@

Modified:
  head/sys/dev/usb/controller/xhci.c

Modified: head/sys/dev/usb/controller/xhci.c
==============================================================================
--- head/sys/dev/usb/controller/xhci.c	Tue Dec 30 08:24:14 2014	(r276403)
+++ head/sys/dev/usb/controller/xhci.c	Tue Dec 30 08:33:51 2014	(r276404)
@@ -2283,6 +2283,7 @@ xhci_configure_mask(struct usb_device *u
 		temp |= XHCI_SCTX_0_CTX_NUM_SET(x + 1);
 		xhci_ctx_set_le32(sc, &pinp->ctx_slot.dwSctx0, temp);
 	}
+	usb_pc_cpu_flush(&sc->sc_hw.devs[index].input_pc);
 	return (0);
 }
 
@@ -2387,10 +2388,14 @@ xhci_configure_endpoint(struct usb_devic
 	    XHCI_EPCTX_1_MAXB_SET(max_packet_count) |
 	    XHCI_EPCTX_1_MAXP_SIZE_SET(max_packet_size);
 
-	if ((udev->parent_hs_hub != NULL) || (udev->address != 0)) {
-		if (type != UE_ISOCHRONOUS)
-			temp |= XHCI_EPCTX_1_CERR_SET(3);
-	}
+	/*
+	 * Always enable the "three strikes and you are gone" feature
+	 * except for ISOCHRONOUS endpoints. This is suggested by
+	 * section 4.3.3 in the XHCI specification about device slot
+	 * initialisation.
+	 */
+	if (type != UE_ISOCHRONOUS)
+		temp |= XHCI_EPCTX_1_CERR_SET(3);
 
 	switch (type) {
 	case UE_CONTROL:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201412300833.sBU8Xp55078446>