Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 May 2021 15:24:47 +0000
From:      bugzilla-noreply@freebsd.org
To:        usb@FreeBSD.org
Subject:   [Bug 256296] "No Device" error after using asynchronous API of libusb once
Message-ID:  <bug-256296-19105@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D256296

            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@FreeBSD.org
          Reporter: sergii.dmytruk@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 processe=
d.
This means that when libusb10_handle_events_sub() eventually processes rela=
ted
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 th=
at
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 wa=
it
before closing or just reset the flag on opening the device.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-256296-19105>