[PATCH 00/17] Initial implementation of a USB kernel driver

Zebediah Figura z.figura12 at gmail.com
Sun Apr 26 12:31:40 CDT 2020


On 4/15/20 1:23 AM, Brendan Shanks wrote:
> 
>> On Apr 14, 2020, at 8:28 PM, Zebediah Figura <z.figura12 at gmail.com> wrote:
>>
>> Linux does not make USB devices writable by default, so users will need to set
>> udev rules, or perform some other configuration, for devices which they wish to
>> use through Wine.
>>
>> The code supports hotplugging in theory, but I ran into a problem where udev
>> rules race with libusb discovery, such that libusb will pick up a device before
>> udev has granted us write permissions.  I'm not sure how to resolve this;
>> possibly it's something that can be fixed on the host side.
> 
> I had this problem a few years ago when using hidapi (which uses libudev for discovery). The fix was to check udev_device_get_is_initialized(), and ignore the device until it returns true. Seems like this would have to be added to libusb though, or maybe even udev (should udev really send events for devices it hasn’t initialized?)
> 
> https://github.com/signal11/hidapi/issues/217
> https://github.com/signal11/hidapi/pull/220
> 
> Brendan
> 

Turns out that libusb actually does this (or something equivalent). It 
was actually a setup issue on my end—I unwittingly had my rules and 
those shipped by the distribution configured so that the default 
permissions (664) overrode my custom permissions at "add" time, but not 
at "bind" time.



More information about the wine-devel mailing list