On 18/10/2015 13:02, Marcel Apfelbaum wrote: > > + pci_device_deassert_intx(dev); > + assert(dev->irq_state == 0); > + > + /* Clear all writable bits */ > + pci_word_test_and_clear_mask(dev->config + PCI_COMMAND, > + pci_get_word(dev->wmask + PCI_COMMAND) | > + pci_get_word(dev->w1cmask + > PCI_COMMAND)); > + pci_word_test_and_clear_mask(dev->config + PCI_STATUS, > + pci_get_word(dev->wmask + PCI_STATUS) | > + pci_get_word(dev->w1cmask + PCI_STATUS)); > + dev->config[PCI_CACHE_LINE_SIZE] = 0x0; > + dev->config[PCI_INTERRUPT_LINE] = 0x0; > + pci_reset_regions(dev); > + pci_update_mappings(dev); > + > + msi_reset(dev); > + msix_reset(dev);
All this should stay in pci_do_device_reset. Of course it's okay to split the PF-specific parts to pci_reset_regions. Paolo