Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Change the SOFTINT level from NET to SERIAL for the USB ...
details: https://anonhg.NetBSD.org/src/rev/408fc44d6d43
branches: trunk
changeset: 347108:408fc44d6d43
user: skrll <skrll%NetBSD.org@localhost>
date: Sun Aug 14 14:42:22 2016 +0000
description:
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:
sys/dev/usb/ehci.c | 8 ++++----
sys/dev/usb/ohci.c | 6 +++---
sys/dev/usb/usb.c | 6 +++---
sys/dev/usb/usbdi.h | 11 ++++++-----
sys/external/bsd/dwc2/dwc2.c | 6 +++---
5 files changed, 19 insertions(+), 18 deletions(-)
diffs (137 lines):
diff -r 8f3a3dc28e3c -r 408fc44d6d43 sys/dev/usb/ehci.c
--- a/sys/dev/usb/ehci.c Sun Aug 14 11:46:05 2016 +0000
+++ b/sys/dev/usb/ehci.c Sun Aug 14 14:42:22 2016 +0000
@@ -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 @@
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 -r 8f3a3dc28e3c -r 408fc44d6d43 sys/dev/usb/ohci.c
--- a/sys/dev/usb/ohci.c Sun Aug 14 11:46:05 2016 +0000
+++ b/sys/dev/usb/ohci.c Sun Aug 14 14:42:22 2016 +0000
@@ -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 @@
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 -r 8f3a3dc28e3c -r 408fc44d6d43 sys/dev/usb/usb.c
--- a/sys/dev/usb/usb.c Sun Aug 14 11:46:05 2016 +0000
+++ b/sys/dev/usb/usb.c Sun Aug 14 14:42:22 2016 +0000
@@ -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 @@
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 -r 8f3a3dc28e3c -r 408fc44d6d43 sys/dev/usb/usbdi.h
--- a/sys/dev/usb/usbdi.h Sun Aug 14 11:46:05 2016 +0000
+++ b/sys/dev/usb/usbdi.h Sun Aug 14 14:42:22 2016 +0000
@@ -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 @@
*
* Eventually, IPL_USB can/should be changed
*/
-#define splusb splsoftnet
+#define IPL_USB IPL_VM
#define splhardusb splvm
-#define IPL_SOFTUSB IPL_SOFTNET
-#define IPL_USB IPL_VM
-#define SOFTINT_USB SOFTINT_NET
+
+#define SOFTINT_USB SOFTINT_SERIAL
+#define IPL_SOFTUSB IPL_SOFTSERIAL
+#define splusb splsoftserial
#endif /* _USBDI_H_ */
diff -r 8f3a3dc28e3c -r 408fc44d6d43 sys/external/bsd/dwc2/dwc2.c
--- a/sys/external/bsd/dwc2/dwc2.c Sun Aug 14 11:46:05 2016 +0000
+++ b/sys/external/bsd/dwc2/dwc2.c Sun Aug 14 14:42:22 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc2.c,v 1.43 2016/05/06 13:03:06 skrll Exp $ */
+/* $NetBSD: dwc2.c,v 1.44 2016/08/14 14:42:22 skrll Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.43 2016/05/06 13:03:06 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.44 2016/08/14 14:42:22 skrll Exp $");
#include "opt_usb.h"
@@ -1264,7 +1264,7 @@
TAILQ_INIT(&sc->sc_complete);
- sc->sc_rhc_si = softint_establish(SOFTINT_NET | SOFTINT_MPSAFE,
+ sc->sc_rhc_si = softint_establish(SOFTINT_USB | SOFTINT_MPSAFE,
dwc2_rhc, sc);
sc->sc_xferpool = pool_cache_init(sizeof(struct dwc2_xfer), 0, 0, 0,
Home |
Main Index |
Thread Index |
Old Index