Module Name: src
Committed By: msaitoh
Date: Thu Feb 1 09:55:37 UTC 2018
Modified Files:
src/sys/dev/usb: ohci.c xhci.c
src/sys/external/bsd/dwc2: dwc2.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.277 -r1.278 src/sys/dev/usb/ohci.c
cvs rdiff -u -r1.84 -r1.85 src/sys/dev/usb/xhci.c
cvs rdiff -u -r1.47 -r1.48 src/sys/external/bsd/dwc2/dwc2.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/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.277 src/sys/dev/usb/ohci.c:1.278
--- src/sys/dev/usb/ohci.c:1.277 Thu Feb 1 09:47:47 2018
+++ src/sys/dev/usb/ohci.c Thu Feb 1 09:55:37 2018
@@ -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 @@ ohci_root_intr_abort(struct usbd_xfer *x
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);
}
Index: src/sys/dev/usb/xhci.c
diff -u src/sys/dev/usb/xhci.c:1.84 src/sys/dev/usb/xhci.c:1.85
--- src/sys/dev/usb/xhci.c:1.84 Tue Jan 30 08:53:39 2018
+++ src/sys/dev/usb/xhci.c Thu Feb 1 09:55:37 2018
@@ -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 @@ static void
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);
}
Index: src/sys/external/bsd/dwc2/dwc2.c
diff -u src/sys/external/bsd/dwc2/dwc2.c:1.47 src/sys/external/bsd/dwc2/dwc2.c:1.48
--- src/sys/external/bsd/dwc2/dwc2.c:1.47 Fri Nov 17 08:22:02 2017
+++ src/sys/external/bsd/dwc2/dwc2.c Thu Feb 1 09:55:37 2018
@@ -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 @@ dwc2_root_intr_abort(struct usbd_xfer *x
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);
}