Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Apr 2010 19:22:06 +0000 (UTC)
From:      Nick Hibma <n_hibma@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r207201 - stable/7/sys/dev/usb
Message-ID:  <201004251922.o3PJM6dq047284@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: n_hibma
Date: Sun Apr 25 19:22:06 2010
New Revision: 207201
URL: http://svn.freebsd.org/changeset/base/207201

Log:
  Remove the call to usbd_reset_device() as this panics the kernel on
  devices with many serial ports (the device is reset for each port that
  reports IOERROR).
  Remove statements that should have been removed when rewriting the if
  statement.

Modified:
  stable/7/sys/dev/usb/ucom.c

Modified: stable/7/sys/dev/usb/ucom.c
==============================================================================
--- stable/7/sys/dev/usb/ucom.c	Sun Apr 25 19:21:19 2010	(r207200)
+++ stable/7/sys/dev/usb/ucom.c	Sun Apr 25 19:22:06 2010	(r207201)
@@ -689,11 +689,7 @@ ucomwritecb(usbd_xfer_handle xfer, usbd_
 			printf("%s: ucomwritecb: STALLED; clearing.\n",
 			       device_get_nameunit(sc->sc_dev));
 			usbd_clear_endpoint_stall_async(sc->sc_bulkout_pipe);
-		} else if (status == USBD_IOERROR) {
-			printf("%s: ucomwritecb: IOERROR; resetting device.\n",
-			       device_get_nameunit(sc->sc_dev));
-			usbd_reset_device(sc->sc_udev);
-		} else if (status != USBD_CANCELLED) {
+		} else {
 			printf("%s: ucomwritecb: %s\n",
 			       device_get_nameunit(sc->sc_dev),
 			       usbd_errstr(status));
@@ -775,19 +771,13 @@ ucomreadcb(usbd_xfer_handle xfer, usbd_p
 			printf("%s: ucomreadcb: %s\n",
 			       device_get_nameunit(sc->sc_dev), usbd_errstr(status));
 		sc->sc_state |= UCS_RXSTOP;
-		if (status == USBD_STALLED)
-			usbd_clear_endpoint_stall_async(sc->sc_bulkin_pipe);
-		else if (status == USBD_IOERROR)
-			usbd_reset_device(sc->sc_udev);
 		if (status == USBD_STALLED) {
 			printf("%s: ucomreadcb: STALLED; clearing.\n",
 			       device_get_nameunit(sc->sc_dev));
 			usbd_clear_endpoint_stall_async(sc->sc_bulkin_pipe);
-		} else if (status == USBD_IOERROR) {
-			printf("%s: ucomreadcb: IOERROR; resetting device.\n",
-			       device_get_nameunit(sc->sc_dev));
-			usbd_reset_device(sc->sc_udev);
-		} else if (status != USBD_CANCELLED) {
+		} else if (status == USBD_CANCELLED) {
+			/* noop */
+		} else {
 			printf("%s: ucomreadcb: %s\n",
 			       device_get_nameunit(sc->sc_dev),
 			       usbd_errstr(status));



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