On Sat, Nov 09, 2019 at 12:18:09PM +0100, Jiri Pirko wrote: > Sat, Nov 09, 2019 at 09:46:59AM CET, gregkh@xxxxxxxxxxxxxxxxxxx wrote: > >On Fri, Nov 08, 2019 at 08:44:26PM -0400, Jason Gunthorpe wrote: > >> There has been some lack of clarity on what the ?? should be. People > >> have proposed platform and MFD, and those seem to be no-goes. So, it > >> looks like ?? will be a mlx5_driver on a mlx5_bus, and Intel will use > >> an ice_driver on a ice_bus, ditto for cxgb4, if I understand Greg's > >> guidance. > > > >Yes, that is the only way it can work because you really are just > >sharing a single PCI device in a vendor-specific way, and they all need > >to get along with each one properly for that vendor-specific way. So > >each vendor needs its own "bus" to be able to work out things properly, > >I doubt you can make this more generic than that easily. > > > >> Though I'm wondering if we should have a 'multi_subsystem_device' that > >> was really just about passing a 'void *core_handle' from the 'core' > >> (ie the bus) to the driver (ie RDMA, netdev, etc). > > > >Ick, no. > > > >> It seems weakly defined, but also exactly what every driver doing this > >> needs.. It is basically what this series is abusing mdev to accomplish. > > > >What is so hard about writing a bus? Last I tried it was just a few > >hundred lines of code, if that. I know it's not the easiest in places, > >but we have loads of examples to crib from. If you have > >problems/questions, just ask! > > > >Or, worst case, you just do what I asked in this thread somewhere, and > >write a "virtual bus" where you just create devices and bind them to the > >driver before registering and away you go. No auto-loading needed (or > >possible), but then you have a generic layer that everyone can use if > >they want to (but you loose some functionality at the expense of > >generic code.) > > Pardon my ignorance, just to be clear: You suggest to have > one-virtual-bus-per-driver or rather some common "xbus" to serve this > purpose for all of them, right? Yes. > If so, isn't that a bit ugly to have a bus in every driver? No, not if that's what you want to have for that specific type of device. I.e. you want to have multiple drivers all attached to a single PCI device and somehow "share" the physical resources properly in a sane way. > I wonder if there can be some abstraction found. The abstraction is just that, the bus one. It's not all that complex, is it? thanks, greg k-h