On Tue, 4 Sep 2018 20:41:20 -0700 Sinan Kaya <okaya@xxxxxxxxxx> wrote: > On 9/4/2018 8:09 PM, Sinan Kaya wrote: > > On 9/4/2018 7:46 PM, Alex Williamson wrote: > >> #define PCI_RESET_DEV_SPECIFIC (1 << 0) > >> #define PCI_RESET_FLR (1 << 1) > >> #define PCI_RESET_PM (1 << 2) > >> #define PCI_RESET_SLOT (1 << 3) > >> #define PCI_RESET_BUS (1 << 4) > >> > >> #define PCI_RESET_ANY (~0) > >> #define PCI_RESET_FUNC (PCI_RESET_DEV_SPECIFIC | \ > >> PCI_RESET_FLR | PCI_RESET_PM) > >> #define PCI_RESET_LINK (PCI_RESET_SLOT | PCI_RESET_BUS) > > > > I should be able to put something together using __pci_reset_function_locked() > > shortly. > > > > This is not that difficult to implement. > > > > I posted these > > https://bugzilla.kernel.org/attachment.cgi?id=278297 > https://bugzilla.kernel.org/attachment.cgi?id=278299 > > Let me know if I misunderstood you. I'll again wait for test feedback first. Yep, that's essentially it. I assume we'd want to trickle this through other interfaces and the hfi1 folks can look at whether they want to drop their custom config save/restore in favor of using pci_reset_function_locked(), which would do that for them. pci_reset_bus() should also allow the caller to set a mask so vfio doesn't worry about defaults changing in the core. Thanks, Alex