On Thu, Aug 12, 2021 at 10:57:07AM -0500, Bjorn Helgaas wrote: > On Thu, Aug 12, 2021 at 10:27:28AM -0300, Jason Gunthorpe wrote: > > On Wed, Aug 11, 2021 at 02:07:37PM -0500, Bjorn Helgaas wrote: > > > On Thu, Aug 05, 2021 at 09:23:57PM -0300, Jason Gunthorpe wrote: > > > > Do the other bus types have a flag analogous to > > > PCI_ID_F_VFIO_DRIVER_OVERRIDE? If we're doing something similar to > > > other bus types, it'd be nice if the approach were similar. > > > > They could, this series doesn't attempt it. I expect the approach to > > be similar as driver_override was copied from PCI to other > > busses. When this is completed I hope to take a look at it. > > I think this would make more sense as two patches: > > - Add a "PCI_ID_DRIVER_OVERRIDE" flag. This is not VFIO-specific, > since nothing in PCI depends on the VFIO-ness of drivers that use > the flag. The only point here is that driver id_table entries > with this flag only match when driver_override matches the driver. This would require using two flags, one to indicate the above to the PCI code and another to indicate the vfio_pci string to file2alias. This doesn't seem justified at this point, IMHO. > - Update file2alias.c to export the flags and the "vfio_pci:" alias. > This seems to be the only place where VFIO comes into play, and > putting it in a separate patch will make it much smaller and it > will be clear how it could be extended for other buses. Well, I don't want to see a flag called PCI_ID_DRIVER_OVERRIDE mapped to the string "vfio_pci", that is just really confusing. Other busses need to copy pretty much the entire patch, there isn't really any sharing here. I don't see splitting as good here.. What this logically wants is the match entry to have a const char *file2alias_prefix Which would be set to "vfio_", but I'm not keen to bloat the match entry further to do that.. > > The full sequence is more like: > > > > echo mlx5_vfio_pci > /sys/bus/pci/devices/0000:01:00.0/driver_override > > echo 0000:01:00.0 > /sys/bus/pci/devices/0000:01:00.0/driver/unbind > > echo 0000:01:00.0 > /sys/bus/pci/drivers_probe > > Thanks a lot for this! I didn't know about drivers_probe (see > drivers_probe_store()), and it doesn't seem to be documented anywhere > except sysfs-bus-usb, where it's only incidental to USB. Okay, lets make the changes in the commit message, it does help Jason