diff options
author | 2020-07-31 19:27:57 +0000 | |
---|---|---|
committer | 2020-07-31 19:27:57 +0000 | |
commit | 18f4917e2c82ef48444597cfa922ea6a709caff4 (patch) | |
tree | 153cefbc372a43a527e35a4f02b805abc86d35d2 | |
parent | Document that video(4) also supports kqueue(2) now. (diff) | |
download | wireguard-openbsd-18f4917e2c82ef48444597cfa922ea6a709caff4.tar.xz wireguard-openbsd-18f4917e2c82ef48444597cfa922ea6a709caff4.zip |
In xhci_device_isoc_start() do first check if the transfer is
in-progress before we do check for the pipe being halted.
This fixes some kind of race condition for isoc devices during device
close when xp->halted gets set while usbd_start_next() still tries to
dequeue in-progress transfers which will report 'usbd_start_next:
error=13' (USBD_IOERROR).
ok mpi@
-rw-r--r-- | sys/dev/usb/xhci.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/dev/usb/xhci.c b/sys/dev/usb/xhci.c index db1b6450efe..9ddf1015dca 100644 --- a/sys/dev/usb/xhci.c +++ b/sys/dev/usb/xhci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xhci.c,v 1.118 2020/07/29 16:37:12 deraadt Exp $ */ +/* $OpenBSD: xhci.c,v 1.119 2020/07/31 19:27:57 mglocker Exp $ */ /* * Copyright (c) 2014-2015 Martin Pieuchot @@ -3111,13 +3111,6 @@ xhci_device_isoc_start(struct usbd_xfer *xfer) KASSERT(!(xfer->rqflags & URQ_REQUEST)); - if (sc->sc_bus.dying || xp->halted) - return (USBD_IOERROR); - - /* Why would you do that anyway? */ - if (sc->sc_bus.use_polling) - return (USBD_INVAL); - /* * To allow continuous transfers, above we start all transfers * immediately. However, we're still going to get usbd_start_next call @@ -3127,6 +3120,13 @@ xhci_device_isoc_start(struct usbd_xfer *xfer) if (xx->ntrb > 0) return (USBD_IN_PROGRESS); + if (sc->sc_bus.dying || xp->halted) + return (USBD_IOERROR); + + /* Why would you do that anyway? */ + if (sc->sc_bus.use_polling) + return (USBD_INVAL); + paddr = DMAADDR(&xfer->dmabuf, 0); /* How many TRBs do for all Transfers? */ |