API for hotplug (was Re: ETAs for libusbx operability and first release?)

Hans de Goede hdegoede at redhat.com
Wed Feb 1 09:17:33 EST 2012


Hi,

On 02/01/2012 03:13 PM, Xiaofan Chen wrote:

<snip>

>> The idea is indeed that behavior will not change at all for
>> existing apps. Note that having an unplug callback will always be racy,
>> so an app with hotplug support may very well see a couple of IO-s
>> fail with ENODEV before getting the unplug callback. One may even
>> get various other errors, the same happens to in kernel USB driver,
>> simply because often the HUB port does not see the disconnect at the
>> hardware level quickly enough, so the HCI may try to send a couple
>> of USB packets to the disconnected device, and utterly fail with
>> a variance of error codes.
>>
>
> This is why I think it will get a bit of delay compared to the
> no-hotplug libusb implementation, Am I right?

Currently an app using libusb won't notice an unplug *at all* until it
tries to submit some new IO to the device. So for some apps the delay
may be quite large.

Regards,

Hans





More information about the libusbx mailing list