On Tue, Nov 19, 2019 at 05:46:50PM +0000, Ertman, David M wrote: > > With this, I forgot to mention that, virtbus doesn't need PM callbacks, > > because PM core layer works on suspend/resume devices in reverse order > > of their creation. > > Given that protocol devices (like rdma and netdev) devices shouldn't be > > anchored on virtbus, it doesn't need PM callbacks. > > Please remove them. > > > > suspend() will be called first on rdma device (because it was created last). > > This is only true in the rdma/PLCI LAN situation. virtbus can be used on two > kernel objects that have no connection to another bus or device, but only use > the virtbus for connecting up. In that case, those entities will need the PM > callbacks. PM order is something to be careful of, the callbacks for a virtbus driver have to happen before the PCI segment that driver is actually on gets shutdown. Is it possible to get PM callbacks directly from the PCI device without binding a driver to it? I think not.. So, either a driver-specific path has to relay PM callbacks from the owning PCI device to the attaching sub driver Or, we have to rely on the driver core to manage PM for us and instantiate a virtbus segment under the PCI device such that normal PM callback ordering works properly. (this would be my preference) Ie we shut down the virtbus under 01:00.0 then we shut down 01:00 , then PCI bus 01:00, then the root complex, etc. Look to I2C for an example how this looks in sysfs Jason