[Bug 256296] "No Device" error after using asynchronous API of libusb once
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Mon May 31 15:24:47 UTC 2021
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256296
Bug ID: 256296
Summary: "No Device" error after using asynchronous API of
libusb once
Product: Base System
Version: Unspecified
Hardware: Any
OS: Any
Status: New
Severity: Affects Some People
Priority: ---
Component: usb
Assignee: usb at FreeBSD.org
Reporter: sergii.dmytruk at 3mdeb.com
Background information
----------------------
fwupd project is using libgusb, which is a Glib wrapper for libusb.
libgusb uses asynchronous API of libusb with events handled in a separate
thread.
fwupd works with devices by opening them, performing operations and then
closing.
How the failure occurs
----------------------
fwupd closes a device before all events of the operation have been processed.
This means that when libusb10_handle_events_sub() eventually processes related
event, the device gets marked as gone (device_is_gone field). On all future
calls libusb_submit_transfer() fails with LIBUSB_ERROR_NO_DEVICE because that
flag is set.
Effectively this means that a device can be used only once in such a way.
As I understand libgusb uses the API as intended and it is implementation of
libusb which shouldn't prevent repeated use of a device. Maybe it should wait
before closing or just reset the flag on opening the device.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-usb
mailing list