Hola Alejandro, Alejandro Exojo wrote: > But it seems to be failing quite a lot for me, at least on some kernel > versions. I was expecting that `udevadm info --query=path` or `lsusb > -t` would report exactly the same across reboots if the devices are > the same ones, plugged to the same physical ports. Does that make > sense?
I understand the expectation, but I don't think Linux meets it. The difference in your logs is the usbX bus number, which really can not persist beyond the lifetime of that bus. Think of a laptop with a CardBus slot. CardBus is just PCI. If you plug a USB host card into that laptop, which number will the new usbX bus have? What if that same card is plugged in during boot? What if the card is unplugged? The usbX goes away. And then the card is plugged back in. A new usbX comes in. X is only valid for the lifetime of that bus. For soldered-on buses like in the chipset this means until reboot. I think your best chance is to filter out the usbX bus name yourself. E.g. match on the DEVPATH prefix /devices/pci0000:00/0000:00:1d.7/ and on the suffix -4.1:1.0/usbmisc/pcanusb* That will always match the same pcanusb device plugged into the same physical port, as long as chipset or firmware (BIOS upgrade) does not remap PCI devices and/or device functions. While hardware might support such remapping, in particular if the hardware is virtualized, as is increasingly the case, devfns changing is rare. But you do need to coordinate this with whoever is your BIOS engineer if you want actual reliability. //Peter -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html