From akpm@osdl.org Tue Aug 22 07:30:57 2006 Message-Id: <200608221429.k7MET8xF016493@shell0.pdx.osdl.net> Subject: PCI: use PCBIOS as last fallback To: greg@kroah.com Cc: akpm@osdl.org, daniel.ritz-ml@swissonline.ch, daniel.ritz@gmx.ch, haveblue@us.ibm.com From: akpm@osdl.org Date: Tue, 22 Aug 2006 07:29:08 -0700 From: Daniel Ritz there was a change in 2.6.17 which affected the order in which the PCI access methods are probed. this gives regressions on some machines with broken BIOS. the problem is that PCBIOS sometimes reports last bus wrong, leaving cardbus non-funcational. previously those system worked fine with direct access. The patch changes the PCI init code to have PCBIOS as last fallback, yet the PCBIOS code still has to run first to set pcibios_last_bus to the value reported by the BIOS. this is needed in case legacy PCI probing (arch/i386/pci/legacy.c) is used to detect peer busses. using direct access if available fixes the cardbus problems. Signed-off-by: Daniel Ritz Cc: Dave Hansen Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- arch/i386/pci/init.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- gregkh-2.6.orig/arch/i386/pci/init.c +++ gregkh-2.6/arch/i386/pci/init.c @@ -14,8 +14,12 @@ static __init int pci_access_init(void) #ifdef CONFIG_PCI_BIOS pci_pcbios_init(); #endif - if (raw_pci_ops) - return 0; + /* + * don't check for raw_pci_ops here because we want pcbios as last + * fallback, yet it's needed to run first to set pcibios_last_bus + * in case legacy PCI probing is used. otherwise detecting peer busses + * fails. + */ #ifdef CONFIG_PCI_DIRECT pci_direct_init(); #endif