Skip to content

linux: Fix udev ID_PATH parsing for udl devices

Reza Arbab requested to merge rarbab/xserver:udl into master

The ID_PATH for a udl device looks like this:

$ udevadm info /dev/dri/card2 | grep -w ID_PATH
E: ID_PATH=pci-0000:00:14.0-usb-0:9.1:1.0

The parsing added in 0816e8fc ("linux: Make platform device probe less fragile"), sets OdevAttributes::busid to "pci:0000:00:14.0", where drmGetBusid() would have returned "3-9.1:1.0".

Identifying this as a "pci:*" device eventually causes the vendor/device id check in probeSingleDevice() to fail, because a USB controller isn't a supported device:

$ udevadm info --path=/devices/pci0000:00/0000:00:14.0 | grep -e VENDOR -e ID_PCI_CLASS
E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
E: ID_VENDOR_FROM_DATABASE=Intel Corporation

Instead of parsing out "pci:0000:00:14.0" in this case, use "usb:0:9.1:1.0" so the device probe will succeed.

Edited by Reza Arbab

Merge request reports

Loading