diff options
author | Hans Petter Selasky <hselasky@FreeBSD.org> | 2019-01-04 21:09:38 +0000 |
---|---|---|
committer | Hans Petter Selasky <hselasky@FreeBSD.org> | 2019-01-04 21:09:38 +0000 |
commit | 4604b6a18dfcc5774577f173ee8c254acb5949e5 (patch) | |
tree | edc236886c3556c00f1ff4af0753a1371611e19f /sys/dev/usb/usb_request.c | |
parent | 0fadd6731f1d072f9c6891f7b4f3fed0ba3436b0 (diff) | |
download | src-4604b6a18dfcc5774577f173ee8c254acb5949e5.tar.gz src-4604b6a18dfcc5774577f173ee8c254acb5949e5.zip |
Reduce timeout for reading the USB HUB port status to 1000ms and try to filter
out dead USB HUB devices by implementing an error counter, so that the USB
enumeration thread does not spend all its time reading from non-responding
devices, blocking user-space access in the end.
Tested by: Matthias Apitz <guru@unixarea.de>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Notes
Notes:
svn path=/head/; revision=342778
Diffstat (limited to 'sys/dev/usb/usb_request.c')
-rw-r--r-- | sys/dev/usb/usb_request.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/usb/usb_request.c b/sys/dev/usb/usb_request.c index fa5c469406cb..73e9874cb466 100644 --- a/sys/dev/usb/usb_request.c +++ b/sys/dev/usb/usb_request.c @@ -1601,8 +1601,9 @@ usbd_req_get_port_status(struct usb_device *udev, struct mtx *mtx, USETW(req.wValue, 0); req.wIndex[0] = port; req.wIndex[1] = 0; - USETW(req.wLength, sizeof *ps); - return (usbd_do_request(udev, mtx, &req, ps)); + USETW(req.wLength, sizeof(*ps)); + + return (usbd_do_request_flags(udev, mtx, &req, ps, 0, NULL, 1000)); } /*------------------------------------------------------------------------* |