Page MenuHomeFreeBSD

libusb: don't treat EINVAL from USB_FS_COMPLETE as device detach
AcceptedPublic

Authored by aokblast on Thu, Jun 11, 3:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jun 18, 11:45 PM
Unknown Object (File)
Wed, Jun 17, 5:57 PM
Unknown Object (File)
Wed, Jun 17, 10:54 AM
Subscribers

Details

Reviewers
bapt
Summary

ugen20_process() treats any non-EBUSY errno returned by USB_FS_COMPLETE
as device detach and returns LIBUSB20_ERROR_OTHER. This causes libusb10
to set device_is_gone and fail all subsequent transfer with
LIBUSB_ERROR_NO_DEVICE.

However, USB_FS_COMPLETE can also return EINVAL when a completion
references an endpoint that no longer exists, for example after
SET_INTERFACE or SET_CONFIG removes and recreates endpoints. This is a
transient condition and does not indicate device detach.

Treat EINVAL the same as EBUSY and stop draining completions. This
prevents a guest selecting an isochronous streaming altsetting from
permanently breaking the passed-through device.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 73822
Build 70705: arc lint + arc unit