diff options
author | Patrick Wildt <patrick@cvs.openbsd.org> | 2020-06-24 07:46:11 +0000 |
---|---|---|
committer | Patrick Wildt <patrick@cvs.openbsd.org> | 2020-06-24 07:46:11 +0000 |
commit | 36e79b4ec8f2c0477bb87a0c07afa43c624ca1f8 (patch) | |
tree | d7a560223e34a79c7e556219b5973529ab1c697c /sys | |
parent | 82a7cfacc2ff23c84f963b7992bd1e95b463b4b7 (diff) |
Apply sc->sc_xfer_flags to control transfers as well. These are used
so that in polled-mode the USB transfers are marked synchronous. In
case that sending commands to the USB mass storage fails, the control
transfers are used to reset the device. Without the synchronous flag,
the STOP command sent by sd(4) on powerdown would wait for completion
indefinitely, possibly hanging the machine.
ok gerhard@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/usb/umass.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c index 53d783ff396..02391ee39ef 100644 --- a/sys/dev/usb/umass.c +++ b/sys/dev/usb/umass.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umass.c,v 1.76 2020/02/22 14:01:34 jasper Exp $ */ +/* $OpenBSD: umass.c,v 1.77 2020/06/24 07:46:10 patrick Exp $ */ /* $NetBSD: umass.c,v 1.116 2004/06/30 05:53:46 mycroft Exp $ */ /* @@ -789,18 +789,18 @@ umass_setup_ctrl_transfer(struct umass_softc *sc, usb_device_request_t *req, /* Initialise a USB control transfer and then schedule it */ usbd_setup_default_xfer(xfer, sc->sc_udev, (void *) sc, - USBD_DEFAULT_TIMEOUT, req, buffer, buflen, flags, - sc->sc_methods->wire_state); + USBD_DEFAULT_TIMEOUT, req, buffer, buflen, + flags | sc->sc_xfer_flags, sc->sc_methods->wire_state); if (sc->sc_udev->bus->use_polling) { DPRINTF(UDMASS_XFER,("%s: start polled ctrl xfer buffer=%p " "buflen=%d flags=0x%x\n", sc->sc_dev.dv_xname, buffer, - buflen, flags)); + buflen, flags | sc->sc_xfer_flags)); err = umass_polled_transfer(sc, xfer); } else { DPRINTF(UDMASS_XFER,("%s: start ctrl xfer buffer=%p buflen=%d " "flags=0x%x\n", sc->sc_dev.dv_xname, buffer, buflen, - flags)); + flags | sc->sc_xfer_flags)); err = usbd_transfer(xfer); } if (err && err != USBD_IN_PROGRESS) { |