From: tcamuso@redhat.com <tcamuso@redhat.com> Date: Mon, 7 Jan 2008 22:15:31 -0500 Subject: [x86] mmconfig: add legacy pci conf functions Message-id: 20080108031531.15008.67905.sendpatchset@dhcp83-188.boston.redhat.com O-Subject: [PATCH 3/6][Version-2]PCI: x86 MMCONFIG: add legacy pci conf functions Bugzilla: 408551 diff --git a/arch/i386/pci/init.c b/arch/i386/pci/init.c index 51087a9..de166c0 100644 --- a/arch/i386/pci/init.c +++ b/arch/i386/pci/init.c @@ -6,11 +6,18 @@ in the right sequence from here. */ static __init int pci_access_init(void) { + struct pci_raw_ops *mmcfg_ops = NULL; + #ifdef CONFIG_PCI_MMCONFIG pci_mmcfg_init(); + /* + * We still need legacy PCI config access routines for devices that + * don't respond to MMCONFIG accesses. Save raw_pci_ops in a local + * variable to restore it if MMCONFIG was successfully initialized. + */ + mmcfg_ops = raw_pci_ops; #endif - if (raw_pci_ops) - return 0; + #ifdef CONFIG_PCI_BIOS pci_pcbios_init(); #endif @@ -23,6 +30,12 @@ static __init int pci_access_init(void) #ifdef CONFIG_PCI_DIRECT pci_direct_init(); #endif + if (mmcfg_ops) + raw_pci_ops = mmcfg_ops; + + if (!raw_pci_ops) + printk(KERN_ERR "PCI: Fatal: No PCI config space access " + "function found\n"); return 0; } arch_initcall(pci_access_init);