diff options
author | Marcus Glocker <mglocker@cvs.openbsd.org> | 2008-10-26 21:11:03 +0000 |
---|---|---|
committer | Marcus Glocker <mglocker@cvs.openbsd.org> | 2008-10-26 21:11:03 +0000 |
commit | bcad6c11e7f764160e58ad2fb1cfdc5e3b5e88e4 (patch) | |
tree | 015a3eb024b212583db95a8749fdee9c2b397989 /sys/dev/usb | |
parent | 13355e9fb1b63d4e0aa0e980bdf5b5efd27db900 (diff) |
Fix IOERRORs seen on some devices after a few open / close cycles.
Tested and OK brad@
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/uvideo.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c index 55179385b99..7735b19c5b9 100644 --- a/sys/dev/usb/uvideo.c +++ b/sys/dev/usb/uvideo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvideo.c,v 1.86 2008/10/04 11:54:43 mglocker Exp $ */ +/* $OpenBSD: uvideo.c,v 1.87 2008/10/26 21:11:02 mglocker Exp $ */ /* * Copyright (c) 2008 Robert Nagy <robert@openbsd.org> @@ -1472,6 +1472,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); } |