summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorskrll <skrll@NetBSD.org>2016-08-14 14:42:22 +0000
committerskrll <skrll@NetBSD.org>2016-08-14 14:42:22 +0000
commit5576422f4defecab5a2bde50fb882b436de8cfe1 (patch)
tree8a505bc06fd4f6d4f8b9a58825e1884b69c4ec21 /sys/dev
parentc3945f5113184ad5a5cf793ee855c2ee20b143fb (diff)
Change the SOFTINT level from NET to SERIAL for the USB softint handler.
This gives the callback a chance of running when another softint handler at SOFTINT_NET has blocked holding a lock, e.g. softnet_lock and most of the network stack. Should fix/help kern/49065 - ifconfig tun0 ... sequence locks up system / lockup: softnet_lock held across usb xfr kern/50491 - unkillable wait in usbd_transfer while using usmsc0 on raspberry pi 2 kern/51395 - USB Ethernet makes xhci hang and probably others
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/ehci.c8
-rw-r--r--sys/dev/usb/ohci.c6
-rw-r--r--sys/dev/usb/usb.c6
-rw-r--r--sys/dev/usb/usbdi.h11
4 files changed, 16 insertions, 15 deletions
diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c
index baff02c25e3..2b89cb6972f 100644
--- a/sys/dev/usb/ehci.c
+++ b/sys/dev/usb/ehci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ehci.c,v 1.252 2016/05/14 07:14:31 skrll Exp $ */
+/* $NetBSD: ehci.c,v 1.253 2016/08/14 14:42:22 skrll Exp $ */
/*
* Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.252 2016/05/14 07:14:31 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.253 2016/08/14 14:42:22 skrll Exp $");
#include "ohci.h"
#include "uhci.h"
@@ -418,10 +418,10 @@ ehci_init(ehci_softc_t *sc)
sc->sc_xferpool = pool_cache_init(sizeof(struct ehci_xfer), 0, 0, 0,
"ehcixfer", NULL, IPL_USB, NULL, NULL, NULL);
- sc->sc_doorbell_si = softint_establish(SOFTINT_NET | SOFTINT_MPSAFE,
+ sc->sc_doorbell_si = softint_establish(SOFTINT_USB | SOFTINT_MPSAFE,
ehci_doorbell, sc);
KASSERT(sc->sc_doorbell_si != NULL);
- sc->sc_pcd_si = softint_establish(SOFTINT_NET | SOFTINT_MPSAFE,
+ sc->sc_pcd_si = softint_establish(SOFTINT_USB | SOFTINT_MPSAFE,
ehci_pcd, sc);
KASSERT(sc->sc_pcd_si != NULL);
diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c
index 807dd2d0e56..b607509ee86 100644
--- a/sys/dev/usb/ohci.c
+++ b/sys/dev/usb/ohci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ohci.c,v 1.263 2016/05/10 15:14:03 pooka Exp $ */
+/* $NetBSD: ohci.c,v 1.264 2016/08/14 14:42:22 skrll Exp $ */
/*
* Copyright (c) 1998, 2004, 2005, 2012 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.263 2016/05/10 15:14:03 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.264 2016/08/14 14:42:22 skrll Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -786,7 +786,7 @@ ohci_init(ohci_softc_t *sc)
mutex_init(&sc->sc_intr_lock, MUTEX_DEFAULT, IPL_USB);
cv_init(&sc->sc_softwake_cv, "ohciab");
- sc->sc_rhsc_si = softint_establish(SOFTINT_NET | SOFTINT_MPSAFE,
+ sc->sc_rhsc_si = softint_establish(SOFTINT_USB | SOFTINT_MPSAFE,
ohci_rhsc_softint, sc);
for (i = 0; i < OHCI_HASH_SIZE; i++)
diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c
index 18f4c869b8a..b5059e84231 100644
--- a/sys/dev/usb/usb.c
+++ b/sys/dev/usb/usb.c
@@ -1,4 +1,4 @@
-/* $NetBSD: usb.c,v 1.163 2016/04/26 12:58:48 skrll Exp $ */
+/* $NetBSD: usb.c,v 1.164 2016/08/14 14:42:22 skrll 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.163 2016/04/26 12:58:48 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb.c,v 1.164 2016/08/14 14:42:22 skrll Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -254,7 +254,7 @@ usb_attach(device_t parent, device_t self, void *aux)
aprint_normal("\n");
/* XXX we should have our own level */
- sc->sc_bus->ub_soft = softint_establish(SOFTINT_NET | SOFTINT_MPSAFE,
+ sc->sc_bus->ub_soft = softint_establish(SOFTINT_USB | SOFTINT_MPSAFE,
usb_soft_intr, sc->sc_bus);
if (sc->sc_bus->ub_soft == NULL) {
aprint_error("%s: can't register softintr\n",
diff --git a/sys/dev/usb/usbdi.h b/sys/dev/usb/usbdi.h
index 612f7197284..911d3f96a2c 100644
--- a/sys/dev/usb/usbdi.h
+++ b/sys/dev/usb/usbdi.h
@@ -1,4 +1,4 @@
-/* $NetBSD: usbdi.h,v 1.91 2016/04/23 10:15:32 skrll Exp $ */
+/* $NetBSD: usbdi.h,v 1.92 2016/08/14 14:42:22 skrll Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbdi.h,v 1.18 1999/11/17 22:33:49 n_hibma Exp $ */
/*
@@ -295,10 +295,11 @@ struct usbif_attach_arg {
*
* Eventually, IPL_USB can/should be changed
*/
-#define splusb splsoftnet
-#define splhardusb splvm
-#define IPL_SOFTUSB IPL_SOFTNET
#define IPL_USB IPL_VM
-#define SOFTINT_USB SOFTINT_NET
+#define splhardusb splvm
+
+#define SOFTINT_USB SOFTINT_SERIAL
+#define IPL_SOFTUSB IPL_SOFTSERIAL
+#define splusb splsoftserial
#endif /* _USBDI_H_ */