Message ID | 201204162235.49901.rjw@sisk.pl |
---|---|
State | Superseded, archived |
Headers | show |
On Mon, Apr 16, 2012 at 1:35 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote: > From: Rafael J. Wysocki <rjw@sisk.pl> > > Some shortcomings introduced into pci_restore_state() by commit > 26f41062f28d ("PCI: check for pci bar restore completion and > retry") have been fixed by recent commit ebfc5b802fa76 ("PCI: Fix > regression in pci_restore_state(), v3"), but that commit treats > all PCI devices as those with Type 0 configuration headers. Make me happier and just make all of this a helper function again. Call that helper function pci_restore_config_space(), and make the existing "pci_restore_config_space()" be called "pci_restore_config_space_range()" or something. Ok? Linus -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Index: linux/drivers/pci/pci.c =================================================================== --- linux.orig/drivers/pci/pci.c +++ linux/drivers/pci/pci.c @@ -1015,13 +1015,17 @@ void pci_restore_state(struct pci_dev *d pci_restore_pcie_state(dev); pci_restore_ats_state(dev); - pci_restore_config_space(dev, 10, 15, 0); - /* - * The Base Address register should be programmed before the command - * register(s) - */ - pci_restore_config_space(dev, 4, 9, 10); - pci_restore_config_space(dev, 0, 3, 0); + if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) { + pci_restore_config_space(dev, 10, 15, 0); + /* + * The Base Address register should be programmed before the + * command register(s) + */ + pci_restore_config_space(dev, 4, 9, 10); + pci_restore_config_space(dev, 0, 3, 0); + } else { + pci_restore_config_space(dev, 0, 15, 0); + } pci_restore_pcix_state(dev); pci_restore_msi_state(dev);