]> git.hungrycats.org Git - linux/commitdiff
[PATCH] PCI access method fallback.
authorDave Jones <davej@suse.de>
Sun, 28 Apr 2002 11:55:46 +0000 (04:55 -0700)
committerJaroslav Kysela <perex@suse.cz>
Sun, 28 Apr 2002 11:55:46 +0000 (04:55 -0700)
Some SiS boards won't boot without pci=bios forcing their method.
The reason for this is in the probe method, we try the BIOS method, and it
succeeds and we store the pci_ops. We then try the direct access, it fails
and we trash the old pci_ops.
The patch stores the pci_ops when BIOS method succeeds and restores it
if the direct hardware access method fails.

arch/i386/kernel/pci-pc.c

index 4de70acbbbe330a3145d74508c79e1147f87a5b9..51ff7400f58c516ef91332d9416f1dab46dac934 100644 (file)
@@ -1261,6 +1261,8 @@ struct pci_bus * __devinit pcibios_scan_root(int busnum)
 
 void __devinit pcibios_config_init(void)
 {
+       struct pci_ops *tmp=NULL;
+
        /*
         * Try all known PCI access methods. Note that we support using 
         * both PCI BIOS and direct access, with a preference for direct.
@@ -1275,6 +1277,7 @@ void __devinit pcibios_config_init(void)
                pci_config_write = pci_bios_write;
        }
 #endif
+       tmp = pci_root_ops;
 
 #ifdef CONFIG_PCI_DIRECT
        if ((pci_probe & (PCI_PROBE_CONF1 | PCI_PROBE_CONF2)) 
@@ -1290,6 +1293,10 @@ void __devinit pcibios_config_init(void)
        }
 #endif
 
+       /* if direct access failed, fall back to BIOS access. */
+       if (pci_root_ops == NULL)
+               pci_root_ops = tmp;
+
        return;
 }