summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2014-02-25 15:49:11 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2014-02-25 15:49:11 +0000
commit581b15894c87328cfbf9e232bff9e5c54048c7fb (patch)
treee499f9ecf984b5faf588af0c37d65384d96953ea /sys/dev
parentfe846fa29875d5bc5d869530d5f7ef85c67fbc34 (diff)
Abort and close all the interrupt pipes when detaching HID devices since
drivers attaching to uhidev(4) do not always do it. Seems to fix one of the transfer aborting races triggering a lot of "ehci_idone: ..." vomit upon resume. Reported by and fix tested by Ville Valkonen, ok deraadt@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/uhidev.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/dev/usb/uhidev.c b/sys/dev/usb/uhidev.c
index a34257e4249..064dca8ea87 100644
--- a/sys/dev/usb/uhidev.c
+++ b/sys/dev/usb/uhidev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhidev.c,v 1.51 2013/11/19 14:04:07 pirofti Exp $ */
+/* $OpenBSD: uhidev.c,v 1.52 2014/02/25 15:49:10 mpi Exp $ */
/* $NetBSD: uhidev.c,v 1.14 2003/03/11 16:44:00 augustss Exp $ */
/*
@@ -362,8 +362,17 @@ uhidev_detach(struct device *self, int flags)
DPRINTF(("uhidev_detach: sc=%p flags=%d\n", sc, flags));
- if (sc->sc_ipipe != NULL)
+ if (sc->sc_opipe != NULL) {
+ usbd_abort_pipe(sc->sc_opipe);
+ usbd_close_pipe(sc->sc_opipe);
+ sc->sc_opipe = NULL;
+ }
+
+ if (sc->sc_ipipe != NULL) {
usbd_abort_pipe(sc->sc_ipipe);
+ usbd_close_pipe(sc->sc_ipipe);
+ sc->sc_ipipe = NULL;
+ }
if (sc->sc_repdesc != NULL)
free(sc->sc_repdesc, M_USBDEV);