Module Name:    src
Committed By:   jakllsch
Date:           Fri Sep 13 23:42:12 UTC 2013

Modified Files:
        src/sys/dev/usb: usb.c

Log Message:
Establish host controller softint earlier, in usb_attach rather than
usb_doattach.


To generate a diff of this commit:
cvs rdiff -u -r1.142 -r1.143 src/sys/dev/usb/usb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/usb.c
diff -u src/sys/dev/usb/usb.c:1.142 src/sys/dev/usb/usb.c:1.143
--- src/sys/dev/usb/usb.c:1.142	Wed Aug 21 18:11:31 2013
+++ src/sys/dev/usb/usb.c	Fri Sep 13 23:42:12 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb.c,v 1.142 2013/08/21 18:11:31 jakllsch Exp $	*/
+/*	$NetBSD: usb.c,v 1.143 2013/09/13 23:42:12 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 1998, 2002, 2008, 2012 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usb.c,v 1.142 2013/08/21 18:11:31 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb.c,v 1.143 2013/09/13 23:42:12 jakllsch Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -202,6 +202,17 @@ usb_attach(device_t parent, device_t sel
 	}
 	aprint_normal("\n");
 
+	/* XXX we should have our own level */
+	sc->sc_bus->soft = softint_establish(
+	    SOFTINT_NET | (mpsafe ? SOFTINT_MPSAFE : 0),
+	    usb_soft_intr, sc->sc_bus);
+	if (sc->sc_bus->soft == NULL) {
+		aprint_error("%s: can't register softintr\n",
+			     device_xname(self));
+		sc->sc_dying = 1;
+		return;
+	}
+
 	if (mpsafe)
 		sc->sc_bus->methods->get_lock(sc->sc_bus, &sc->sc_bus->lock);
 	else
@@ -254,7 +265,6 @@ usb_doattach(device_t self)
 	usbd_status err;
 	int speed;
 	struct usb_event *ue;
-	const bool mpsafe = sc->sc_bus->methods->get_lock ? true : false;
 
 	DPRINTF(("usbd_doattach\n"));
 
@@ -279,17 +289,6 @@ usb_doattach(device_t self)
 	ue->u.ue_ctrlr.ue_bus = device_unit(self);
 	usb_add_event(USB_EVENT_CTRLR_ATTACH, ue);
 
-	/* XXX we should have our own level */
-	sc->sc_bus->soft = softint_establish(
-	    SOFTINT_NET | (mpsafe ? SOFTINT_MPSAFE : 0),
-	    usb_soft_intr, sc->sc_bus);
-	if (sc->sc_bus->soft == NULL) {
-		aprint_error("%s: can't register softintr\n",
-			     device_xname(self));
-		sc->sc_dying = 1;
-		return;
-	}
-
 	err = usbd_new_device(self, sc->sc_bus, 0, speed, 0,
 		  &sc->sc_port);
 	if (!err) {

Reply via email to