Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Aug 2011 07:38:40 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r225186 - stable/8/sys/dev/usb
Message-ID:  <201108260738.p7Q7cetT040467@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Fri Aug 26 07:38:40 2011
New Revision: 225186
URL: http://svn.freebsd.org/changeset/base/225186

Log:
  MFC r225000:
  USB clear stall fix for VM's.

Modified:
  stable/8/sys/dev/usb/usb_request.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/usb/usb_request.c
==============================================================================
--- stable/8/sys/dev/usb/usb_request.c	Fri Aug 26 04:58:33 2011	(r225185)
+++ stable/8/sys/dev/usb/usb_request.c	Fri Aug 26 07:38:40 2011	(r225186)
@@ -67,6 +67,11 @@
 #include <dev/usb/usb_bus.h>
 #include <sys/ctype.h>
 
+static int usb_no_cs_fail;
+
+SYSCTL_INT(_hw_usb, OID_AUTO, no_cs_fail, CTLFLAG_RW,
+    &usb_no_cs_fail, 0, "USB clear stall failures are ignored, if set");
+
 #ifdef USB_DEBUG
 static int usb_pr_poll_delay = USB_PORT_RESET_DELAY;
 static int usb_pr_recovery_delay = USB_PORT_RESET_RECOVERY;
@@ -238,7 +243,7 @@ usb_do_clear_stall_callback(struct usb_x
 
 	switch (USB_GET_STATE(xfer)) {
 	case USB_ST_TRANSFERRED:
-
+tr_transferred:
 		/* reset error counter */
 		udev->clear_stall_errors = 0;
 
@@ -297,6 +302,13 @@ tr_setup:
 			break;
 
 		DPRINTF("Clear stall failed.\n");
+
+		/*
+		 * Some VMs like VirtualBox always return failure on
+		 * clear-stall which we sometimes should just ignore.
+		 */
+		if (usb_no_cs_fail)
+			goto tr_transferred;
 		if (udev->clear_stall_errors == USB_CS_RESET_LIMIT)
 			goto tr_setup;
 



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