diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-01-21 14:02:34 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-01-21 14:02:34 +0000 |
commit | 6ddd09b5d7b9482c9f95fdc6c812c4a28dfdb5d5 (patch) | |
tree | 55cca2d02f3cbae5b9a85bf1c8837d7687b4c273 /sys/dev | |
parent | c6bb08faac411e7f587547acd67925cd531a9c7e (diff) |
Do not try to stop and reset endpoints if USB transfers are aborted
because the HC has been shut down (during suspend/hibernate) or
removed (PCIe card).
In both cases the hardware wont complete the commands, resulting in
timeouts. Instead just do the software part of the abort process.
Unbreak suspend/resume with USB a device connected to xhci(4) as
reported by Fabian Raetz on bugs@.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/usb/xhci.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/usb/xhci.c b/sys/dev/usb/xhci.c index d0e725097fc..774bd87b759 100644 --- a/sys/dev/usb/xhci.c +++ b/sys/dev/usb/xhci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xhci.c,v 1.57 2015/01/18 20:35:11 mpi Exp $ */ +/* $OpenBSD: xhci.c,v 1.58 2015/01/21 14:02:33 mpi Exp $ */ /* * Copyright (c) 2014-2015 Martin Pieuchot @@ -1912,8 +1912,10 @@ xhci_abort_xfer(struct usbd_xfer *xfer, usbd_status status) xfer->actlen, xfer->length, ((struct xhci_xfer *)xfer)->index)); /* XXX The stack should not call abort() in this case. */ - if (xfer->status == USBD_NOT_STARTED) { + if (sc->sc_bus.dying || xfer->status == USBD_NOT_STARTED) { xfer->status = status; + timeout_del(&xfer->timeout_handle); + usb_rem_task(xfer->device, &xfer->abort_task); usb_transfer_complete(xfer); return; } |