summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormglocker <mglocker@openbsd.org>2009-03-25 09:25:42 +0000
committermglocker <mglocker@openbsd.org>2009-03-25 09:25:42 +0000
commit1a4a3e089b1cc283761e54d458c28782c1085797 (patch)
tree27a041372ea01086176eeb9b7429b2832a701f85
parentLying is bad, so stop lying about functionality that was removed ages (diff)
downloadwireguard-openbsd-1a4a3e089b1cc283761e54d458c28782c1085797.tar.xz
wireguard-openbsd-1a4a3e089b1cc283761e54d458c28782c1085797.zip
Revert 1.119 bulk crash workaround, because it breaks Logitech QuickCam
9000 devices. Add a XXX comment that we need to fix the bulk issue properly instead.
-rw-r--r--sys/dev/usb/uvideo.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c
index d6190d0317e..fba22d7a02d 100644
--- a/sys/dev/usb/uvideo.c
+++ b/sys/dev/usb/uvideo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvideo.c,v 1.121 2009/02/27 06:00:31 mglocker Exp $ */
+/* $OpenBSD: uvideo.c,v 1.122 2009/03/25 09:25:42 mglocker Exp $ */
/*
* Copyright (c) 2008 Robert Nagy <robert@openbsd.org>
@@ -1672,14 +1672,15 @@ uvideo_vs_open(struct uvideo_softc *sc)
void
uvideo_vs_close(struct uvideo_softc *sc)
{
- sc->sc_vs_cur->bulk_running = 0;
-
/*
- * Some devices need time to shutdown before we switch back to
- * the default interface (0). Not doing so can leave the device
- * back in a undefined condition.
+ * XXX
+ * A bulk device will crash the kernel here, because in almost all
+ * cases we close the pipe before sc->sc_vs_cur->bulk_running = 0
+ * gets noticed in the thread loop of uvideo_vs_start_bulk_thread(),
+ * which make it access a closed pipe. We need to fix this
+ * properly.
*/
- usbd_delay_ms(sc->sc_udev, 100);
+ sc->sc_vs_cur->bulk_running = 0;
if (sc->sc_vs_cur->pipeh) {
usbd_abort_pipe(sc->sc_vs_cur->pipeh);
@@ -1687,6 +1688,13 @@ uvideo_vs_close(struct uvideo_softc *sc)
sc->sc_vs_cur->pipeh = NULL;
}
+ /*
+ * Some devices need time to shutdown before we switch back to
+ * the default interface (0). Not doing so can leave the device
+ * back in a undefined condition.
+ */
+ usbd_delay_ms(sc->sc_udev, 100);
+
/* switch back to default interface (turns off cam LED) */
(void)usbd_set_interface(sc->sc_vs_cur->ifaceh, 0);
}