Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Jul 2010 06:53:11 GMT
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 180519 for review
Message-ID:  <201007060653.o666rBPv051855@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@180519?ac=10

Change 180519 by hselasky@hselasky_laptop001 on 2010/07/06 06:52:24

	USB controller:
		- add missing root mount release in some error corner cases.
		- add missing USB 3.0 definition.
		- patch by: HPS @

Affected files ...

.. //depot/projects/usb/src/sys/dev/usb/controller/usb_controller.c#43 edit

Differences ...

==== //depot/projects/usb/src/sys/dev/usb/controller/usb_controller.c#43 (text+ko) ====

@@ -121,6 +121,16 @@
 	return (0);
 }
 
+static void
+usb_root_mount_rel(struct usb_bus *bus)
+{
+	if (bus->bus_roothold != NULL) {
+		DPRINTF("Releasing root mount hold %p\n", bus->bus_roothold);
+		root_mount_rel(bus->bus_roothold);
+		bus->bus_roothold = NULL;
+	}
+}
+
 /*------------------------------------------------------------------------*
  *	usb_attach
  *------------------------------------------------------------------------*/
@@ -164,10 +174,7 @@
 	usb_callout_drain(&bus->power_wdog);
 
 	/* Let the USB explore process detach all devices. */
-	if (bus->bus_roothold != NULL) {
-		root_mount_rel(bus->bus_roothold);
-		bus->bus_roothold = NULL;
-	}
+	usb_root_mount_rel(bus);
 
 	USB_BUS_LOCK(bus);
 	if (usb_proc_msignal(&bus->explore_proc,
@@ -244,10 +251,7 @@
 		(udev->hub->explore) (udev);
 		USB_BUS_LOCK(bus);
 	}
-	if (bus->bus_roothold != NULL) {
-		root_mount_rel(bus->bus_roothold);
-		bus->bus_roothold = NULL;
-	}
+	usb_root_mount_rel(bus);
 }
 
 /*------------------------------------------------------------------------*
@@ -351,8 +355,14 @@
 		device_printf(bus->bdev, "480Mbps Wireless USB v2.5\n");
 		break;
 
+	case USB_REV_3_0:
+		speed = USB_SPEED_SUPER;
+		device_printf(bus->bdev, "4.8Gbps Super Speed USB v3.0\n");
+		break;
+
 	default:
 		device_printf(bus->bdev, "Unsupported USB revision\n");
+		usb_root_mount_rel(bus);
 		return;
 	}
 
@@ -394,6 +404,7 @@
 	if (err) {
 		device_printf(bus->bdev, "Root HUB problem, error=%s\n",
 		    usbd_errstr(err));
+		usb_root_mount_rel(bus);
 	}
 
 	/* set softc - we are ready */



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