Module Name: src Committed By: skrll Date: Sun Jan 3 08:30:37 UTC 2016
Modified Files: src/sys/dev/usb [nick-nhusb]: ehci.c Log Message: In ehci_idone check for timed out or aborted transfer earlier and before twiddling ex_isdone to avoid KASSERT firing. To generate a diff of this commit: cvs rdiff -u -r1.234.2.74 -r1.234.2.75 src/sys/dev/usb/ehci.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.234.2.74 src/sys/dev/usb/ehci.c:1.234.2.75 --- src/sys/dev/usb/ehci.c:1.234.2.74 Mon Dec 28 22:25:43 2015 +++ src/sys/dev/usb/ehci.c Sun Jan 3 08:30:37 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: ehci.c,v 1.234.2.74 2015/12/28 22:25:43 skrll Exp $ */ +/* $NetBSD: ehci.c,v 1.234.2.75 2016/01/03 08:30:37 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.234.2.74 2015/12/28 22:25:43 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.234.2.75 2016/01/03 08:30:37 skrll Exp $"); #include "ohci.h" #include "uhci.h" @@ -1027,6 +1027,12 @@ ehci_idone(struct ehci_xfer *ex) USBHIST_LOG(ehcidebug, "ex=%p", ex, 0, 0, 0); + if (xfer->ux_status == USBD_CANCELLED || + xfer->ux_status == USBD_TIMEOUT) { + USBHIST_LOG(ehcidebug, "aborted xfer=%p", xfer, 0, 0, 0); + return; + } + #ifdef DIAGNOSTIC #ifdef EHCI_DEBUG if (ex->ex_isdone) { @@ -1039,12 +1045,6 @@ ehci_idone(struct ehci_xfer *ex) ex->ex_isdone = true; #endif - if (xfer->ux_status == USBD_CANCELLED || - xfer->ux_status == USBD_TIMEOUT) { - USBHIST_LOG(ehcidebug, "aborted xfer=%p", xfer, 0, 0, 0); - return; - } - USBHIST_LOG(ehcidebug, "xfer=%p, pipe=%p ready", xfer, epipe, 0, 0); /* The transfer is done, compute actual length and status. */