diff options
author | Stefan Sperling <stsp@cvs.openbsd.org> | 2015-10-24 14:01:41 +0000 |
---|---|---|
committer | Stefan Sperling <stsp@cvs.openbsd.org> | 2015-10-24 14:01:41 +0000 |
commit | 732283ff3987f5342efe2d1cc3536ae5ff380fbb (patch) | |
tree | 2cf0ba545df3e92451eae742b62a785088381bd0 /sys/dev/usb | |
parent | 50eaa3abfff466698a4647bb56576e5ad0351994 (diff) |
Wait a short while between setting a USB device's address and reloading
its descriptor. Fixes flaky attach of USB devices (most importantly the
detachable keyboard) on the Thinkpad Helix 2, and perhaps elsewhere.
Problem diagnosed by mpi; ok mpi@
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/usb_subr.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c index dfdeaf99cd0..cd3dc2916f1 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.117 2015/03/23 22:26:01 jsg Exp $ */ +/* $OpenBSD: usb_subr.c,v 1.118 2015/10/24 14:01:40 stsp 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 $ */ @@ -1151,6 +1151,9 @@ usbd_new_device(struct device *parent, struct usbd_bus *bus, int depth, return (USBD_SET_ADDR_FAILED); } + /* Wait for device to settle before reloading the descriptor. */ + usbd_delay_ms(dev, 10); + /* * If this device is attached to an xHCI controller, this * address does not correspond to the hardware one. |