Module Name: src Committed By: martin Date: Wed Dec 23 12:34:38 UTC 2020
Modified Files: src/sys/dev/usb [netbsd-9]: ehci.c ohci.c uhci.c xhci.c src/sys/external/bsd/dwc2 [netbsd-9]: dwc2.c Log Message: Pull up following revision(s) (requested by riastradh in ticket #1159): sys/dev/usb/ohci.c: revision 1.314 sys/external/bsd/dwc2/dwc2.c: revision 1.75 sys/dev/usb/ehci.c: revision 1.284 sys/dev/usb/uhci.c: revision 1.305 sys/dev/usb/xhci.c: revision 1.136 usb: Omit bogus assertions about struct usbd_pipe::up_intrxfer. These assertions were only valid for pipes at UE_IN_DIR, UE_INTERRUPT endpoints created with usbd_open_pipe_intr, which uses up_intrxfer to pass the struct usbd_xfer object to usbd_close_pipe to free later. In contrast, for pipes at UE_OUT_DIR, UE_INTERRUPT endpoints, up_intrxfer is never initialized, so the assertion cannot be right. In principle we might even have more than one outstanding interrupt transfer at a time, rendering the point of the assertion moot anyway. Found by interrupting a uhidev write to a u2f device. ok nick To generate a diff of this commit: cvs rdiff -u -r1.267.2.3 -r1.267.2.4 src/sys/dev/usb/ehci.c cvs rdiff -u -r1.289.4.6 -r1.289.4.7 src/sys/dev/usb/ohci.c cvs rdiff -u -r1.288.4.2 -r1.288.4.3 src/sys/dev/usb/uhci.c cvs rdiff -u -r1.107.2.6 -r1.107.2.7 src/sys/dev/usb/xhci.c cvs rdiff -u -r1.59.4.3 -r1.59.4.4 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/ehci.c diff -u src/sys/dev/usb/ehci.c:1.267.2.3 src/sys/dev/usb/ehci.c:1.267.2.4 --- src/sys/dev/usb/ehci.c:1.267.2.3 Sun Mar 1 12:35:16 2020 +++ src/sys/dev/usb/ehci.c Wed Dec 23 12:34:38 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ehci.c,v 1.267.2.3 2020/03/01 12:35:16 martin Exp $ */ +/* $NetBSD: ehci.c,v 1.267.2.4 2020/12/23 12:34:38 martin 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.267.2.3 2020/03/01 12:35:16 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.267.2.4 2020/12/23 12:34:38 martin Exp $"); #include "ohci.h" #include "uhci.h" @@ -4132,7 +4132,6 @@ ehci_device_intr_abort(struct usbd_xfer EHCIHIST_FUNC(); EHCIHIST_CALLED(); DPRINTF("xfer=%#jx", (uintptr_t)xfer, 0, 0, 0); - KASSERT(xfer->ux_pipe->up_intrxfer == xfer); /* * XXX - abort_xfer uses ehci_sync_hc, which syncs via the advance Index: src/sys/dev/usb/ohci.c diff -u src/sys/dev/usb/ohci.c:1.289.4.6 src/sys/dev/usb/ohci.c:1.289.4.7 --- src/sys/dev/usb/ohci.c:1.289.4.6 Sat Dec 12 20:29:11 2020 +++ src/sys/dev/usb/ohci.c Wed Dec 23 12:34:38 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ohci.c,v 1.289.4.6 2020/12/12 20:29:11 martin Exp $ */ +/* $NetBSD: ohci.c,v 1.289.4.7 2020/12/23 12:34:38 martin 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.289.4.6 2020/12/12 20:29:11 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.289.4.7 2020/12/23 12:34:38 martin Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -3356,7 +3356,6 @@ ohci_device_intr_abort(struct usbd_xfer ohci_softc_t *sc __diagused = OHCI_XFER2SC(xfer); KASSERT(mutex_owned(&sc->sc_lock)); - KASSERT(xfer->ux_pipe->up_intrxfer == xfer); usbd_xfer_abort(xfer); } Index: src/sys/dev/usb/uhci.c diff -u src/sys/dev/usb/uhci.c:1.288.4.2 src/sys/dev/usb/uhci.c:1.288.4.3 --- src/sys/dev/usb/uhci.c:1.288.4.2 Sun Mar 1 12:35:16 2020 +++ src/sys/dev/usb/uhci.c Wed Dec 23 12:34:38 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: uhci.c,v 1.288.4.2 2020/03/01 12:35:16 martin Exp $ */ +/* $NetBSD: uhci.c,v 1.288.4.3 2020/12/23 12:34:38 martin Exp $ */ /* * Copyright (c) 1998, 2004, 2011, 2012 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.288.4.2 2020/03/01 12:35:16 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.288.4.3 2020/12/23 12:34:38 martin Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -2817,7 +2817,6 @@ uhci_device_intr_abort(struct usbd_xfer uhci_softc_t *sc __diagused = UHCI_XFER2SC(xfer); KASSERT(mutex_owned(&sc->sc_lock)); - KASSERT(xfer->ux_pipe->up_intrxfer == xfer); UHCIHIST_FUNC(); UHCIHIST_CALLED(); DPRINTF("xfer=%#jx", (uintptr_t)xfer, 0, 0, 0); Index: src/sys/dev/usb/xhci.c diff -u src/sys/dev/usb/xhci.c:1.107.2.6 src/sys/dev/usb/xhci.c:1.107.2.7 --- src/sys/dev/usb/xhci.c:1.107.2.6 Mon May 25 15:31:45 2020 +++ src/sys/dev/usb/xhci.c Wed Dec 23 12:34:38 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: xhci.c,v 1.107.2.6 2020/05/25 15:31:45 martin Exp $ */ +/* $NetBSD: xhci.c,v 1.107.2.7 2020/12/23 12:34:38 martin Exp $ */ /* * Copyright (c) 2013 Jonathan A. Kollasch @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.107.2.6 2020/05/25 15:31:45 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.107.2.7 2020/12/23 12:34:38 martin Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -4151,7 +4151,6 @@ xhci_device_intr_abort(struct usbd_xfer XHCIHIST_CALLARGS("%#jx", (uintptr_t)xfer, 0, 0, 0); KASSERT(mutex_owned(&sc->sc_lock)); - KASSERT(xfer->ux_pipe->up_intrxfer == xfer); usbd_xfer_abort(xfer); } Index: src/sys/external/bsd/dwc2/dwc2.c diff -u src/sys/external/bsd/dwc2/dwc2.c:1.59.4.3 src/sys/external/bsd/dwc2/dwc2.c:1.59.4.4 --- src/sys/external/bsd/dwc2/dwc2.c:1.59.4.3 Sun Mar 1 12:35:16 2020 +++ src/sys/external/bsd/dwc2/dwc2.c Wed Dec 23 12:34:38 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: dwc2.c,v 1.59.4.3 2020/03/01 12:35:16 martin Exp $ */ +/* $NetBSD: dwc2.c,v 1.59.4.4 2020/12/23 12:34:38 martin Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.59.4.3 2020/03/01 12:35:16 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.59.4.4 2020/12/23 12:34:38 martin Exp $"); #include "opt_usb.h" @@ -880,7 +880,6 @@ dwc2_device_intr_abort(struct usbd_xfer struct dwc2_softc *sc __diagused = DWC2_XFER2SC(xfer); KASSERT(mutex_owned(&sc->sc_lock)); - KASSERT(xfer->ux_pipe->up_intrxfer == xfer); DPRINTF("xfer=%p\n", xfer); usbd_xfer_abort(xfer);