Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Fix KASSERT panic. When detaching USB host controoler, t...



details:   https://anonhg.NetBSD.org/src/rev/fcdab8a5cd28
branches:  trunk
changeset: 829452:fcdab8a5cd28
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Thu Feb 01 09:55:37 2018 +0000

description:
Fix KASSERT panic. When detaching USB host controoler, the following panic
occured:
kernel diagnostic assertion "sc->sc_intrxfer == xfer" failed: file "../../../../dev/usb/ohci.c", line 1720
Clear sc_intrxfer correctly. Adviced by Nick and tested by me.

diffstat:

 sys/dev/usb/ohci.c           |  6 ++----
 sys/dev/usb/xhci.c           |  7 ++-----
 sys/external/bsd/dwc2/dwc2.c |  6 ++----
 3 files changed, 6 insertions(+), 13 deletions(-)

diffs (88 lines):

diff -r d048943c14ba -r fcdab8a5cd28 sys/dev/usb/ohci.c
--- a/sys/dev/usb/ohci.c        Thu Feb 01 09:50:48 2018 +0000
+++ b/sys/dev/usb/ohci.c        Thu Feb 01 09:55:37 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ohci.c,v 1.277 2018/02/01 09:47:47 msaitoh Exp $       */
+/*     $NetBSD: ohci.c,v 1.278 2018/02/01 09:55:37 msaitoh 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.277 2018/02/01 09:47:47 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.278 2018/02/01 09:55:37 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -2591,8 +2591,6 @@
        KASSERT(mutex_owned(&sc->sc_lock));
        KASSERT(xfer->ux_pipe->up_intrxfer == xfer);
 
-       sc->sc_intrxfer = NULL;
-
        xfer->ux_status = USBD_CANCELLED;
        usb_transfer_complete(xfer);
 }
diff -r d048943c14ba -r fcdab8a5cd28 sys/dev/usb/xhci.c
--- a/sys/dev/usb/xhci.c        Thu Feb 01 09:50:48 2018 +0000
+++ b/sys/dev/usb/xhci.c        Thu Feb 01 09:55:37 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xhci.c,v 1.84 2018/01/30 08:53:39 msaitoh Exp $        */
+/*     $NetBSD: xhci.c,v 1.85 2018/02/01 09:55:37 msaitoh Exp $        */
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.84 2018/01/30 08:53:39 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.85 2018/02/01 09:55:37 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -3659,15 +3659,12 @@
 xhci_root_intr_abort(struct usbd_xfer *xfer)
 {
        struct xhci_softc * const sc = XHCI_XFER2SC(xfer);
-       const size_t bn = XHCI_XFER2BUS(xfer) == &sc->sc_bus ? 0 : 1;
 
        XHCIHIST_FUNC(); XHCIHIST_CALLED();
 
        KASSERT(mutex_owned(&sc->sc_lock));
        KASSERT(xfer->ux_pipe->up_intrxfer == xfer);
 
-       sc->sc_intrxfer[bn] = NULL;
-
        xfer->ux_status = USBD_CANCELLED;
        usb_transfer_complete(xfer);
 }
diff -r d048943c14ba -r fcdab8a5cd28 sys/external/bsd/dwc2/dwc2.c
--- a/sys/external/bsd/dwc2/dwc2.c      Thu Feb 01 09:50:48 2018 +0000
+++ b/sys/external/bsd/dwc2/dwc2.c      Thu Feb 01 09:55:37 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dwc2.c,v 1.47 2017/11/17 08:22:02 skrll Exp $  */
+/*     $NetBSD: dwc2.c,v 1.48 2018/02/01 09:55:37 msaitoh Exp $        */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.47 2017/11/17 08:22:02 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.48 2018/02/01 09:55:37 msaitoh Exp $");
 
 #include "opt_usb.h"
 
@@ -642,8 +642,6 @@
        KASSERT(mutex_owned(&sc->sc_lock));
        KASSERT(xfer->ux_pipe->up_intrxfer == xfer);
 
-       sc->sc_intrxfer = NULL;
-
        xfer->ux_status = USBD_CANCELLED;
        usb_transfer_complete(xfer);
 }



Home | Main Index | Thread Index | Old Index