summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2010-09-24 00:12:37 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2010-09-24 00:12:37 +0000
commit3545bec9909d5f024840286f25df17a969ea5524 (patch)
tree0d649be38ce230da651f5683794fce02a3715afe
parent28f7bbe1f362f59dd11ca8fe28737c20b11d1a82 (diff)
tsleep on a static and private handle, since our goal is to not be
woken up by a wakeup, but only by the actual timeout expiry. On architectures which share a kva upage area between processes, we would not want an accidental wakeup (too short). discussed with various
-rw-r--r--sys/dev/usb/usb_subr.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c
index e7db9d9ac54..543f1d13ba5 100644
--- a/sys/dev/usb/usb_subr.c
+++ b/sys/dev/usb/usb_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usb_subr.c,v 1.73 2009/01/14 21:02:57 fgsch Exp $ */
+/* $OpenBSD: usb_subr.c,v 1.74 2010/09/24 00:12:36 deraadt Exp $ */
/* $NetBSD: usb_subr.c,v 1.103 2003/01/10 11:19:13 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */
@@ -337,11 +337,14 @@ usbd_devinfo_free(char *devinfop)
void
usb_delay_ms(usbd_bus_handle bus, u_int ms)
{
+ static int usb_delay_wchan;
+
/* Wait at least two clock ticks so we know the time has passed. */
if (bus->use_polling || cold)
delay((ms+1) * 1000);
else
- tsleep(&ms, PRIBIO, "usbdly", (ms*hz+999)/1000 + 1);
+ tsleep(&usb_delay_wchan, PRIBIO, "usbdly",
+ (ms*hz+999)/1000 + 1);
}
/* Delay given a device handle. */