Module Name: src
Committed By: martin
Date: Sun Aug 26 08:05:16 UTC 2018
Modified Files:
src/sys/dev/usb [netbsd-8]: usb_subr.c
Log Message:
Pull up following revision(s) (requested by mlelstv in ticket #990):
sys/dev/usb/usb_subr.c: revision 1.224
add missing KERNEL_LOCK protection around autoconf calls.
Also replace NULL argument with curlwp for style.
To generate a diff of this commit:
cvs rdiff -u -r1.220.2.3 -r1.220.2.4 src/sys/dev/usb/usb_subr.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_subr.c
diff -u src/sys/dev/usb/usb_subr.c:1.220.2.3 src/sys/dev/usb/usb_subr.c:1.220.2.4
--- src/sys/dev/usb/usb_subr.c:1.220.2.3 Wed Aug 8 10:28:35 2018
+++ src/sys/dev/usb/usb_subr.c Sun Aug 26 08:05:16 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: usb_subr.c,v 1.220.2.3 2018/08/08 10:28:35 martin Exp $ */
+/* $NetBSD: usb_subr.c,v 1.220.2.4 2018/08/26 08:05:16 martin Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */
/*
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.220.2.3 2018/08/08 10:28:35 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.220.2.4 2018/08/26 08:05:16 martin Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -859,7 +859,9 @@ usbd_attach_roothub(device_t parent, str
uaa.uaa_subclass = dd->bDeviceSubClass;
uaa.uaa_proto = dd->bDeviceProtocol;
+ KERNEL_LOCK(1, curlwp);
dv = config_found_ia(parent, "usbroothubif", &uaa, 0);
+ KERNEL_UNLOCK_ONE(curlwp);
if (dv) {
dev->ud_subdevs = kmem_alloc(sizeof(dv), KM_SLEEP);
dev->ud_subdevs[0] = dv;
@@ -904,10 +906,10 @@ usbd_attachwholedevice(device_t parent,
dlocs[USBDEVIFCF_CONFIGURATION] = -1;
dlocs[USBDEVIFCF_INTERFACE] = -1;
- KERNEL_LOCK(1, NULL);
+ KERNEL_LOCK(1, curlwp);
dv = config_found_sm_loc(parent, "usbdevif", dlocs, &uaa, usbd_print,
config_stdsubmatch);
- KERNEL_UNLOCK_ONE(NULL);
+ KERNEL_UNLOCK_ONE(curlwp);
if (dv) {
dev->ud_subdevs = kmem_alloc(sizeof(dv), KM_SLEEP);
dev->ud_subdevs[0] = dv;
@@ -981,10 +983,10 @@ usbd_attachinterfaces(device_t parent, s
loc != uiaa.uiaa_ifaceno)
continue;
}
- KERNEL_LOCK(1, NULL);
+ KERNEL_LOCK(1, curlwp);
dv = config_found_sm_loc(parent, "usbifif", ilocs, &uiaa,
usbd_ifprint, config_stdsubmatch);
- KERNEL_UNLOCK_ONE(NULL);
+ KERNEL_UNLOCK_ONE(curlwp);
if (!dv)
continue;
@@ -1728,7 +1730,10 @@ usb_disconnect_port(struct usbd_port *up
continue;
strlcpy(subdevname, device_xname(subdev),
sizeof(subdevname));
- if ((rc = config_detach(subdev, flags)) != 0)
+ KERNEL_LOCK(1, curlwp);
+ rc = config_detach(subdev, flags);
+ KERNEL_UNLOCK_ONE(curlwp);
+ if (rc != 0)
return rc;
printf("%s: at %s", subdevname, hubname);
if (up->up_portno != 0)