Commit 26966bb8 authored by Dave Jones's avatar Dave Jones Committed by Jaroslav Kysela

[PATCH] PCI access method fallback.

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.
parent 66d52b89
...@@ -1261,6 +1261,8 @@ struct pci_bus * __devinit pcibios_scan_root(int busnum) ...@@ -1261,6 +1261,8 @@ struct pci_bus * __devinit pcibios_scan_root(int busnum)
void __devinit pcibios_config_init(void) void __devinit pcibios_config_init(void)
{ {
struct pci_ops *tmp=NULL;
/* /*
* Try all known PCI access methods. Note that we support using * Try all known PCI access methods. Note that we support using
* both PCI BIOS and direct access, with a preference for direct. * both PCI BIOS and direct access, with a preference for direct.
...@@ -1275,6 +1277,7 @@ void __devinit pcibios_config_init(void) ...@@ -1275,6 +1277,7 @@ void __devinit pcibios_config_init(void)
pci_config_write = pci_bios_write; pci_config_write = pci_bios_write;
} }
#endif #endif
tmp = pci_root_ops;
#ifdef CONFIG_PCI_DIRECT #ifdef CONFIG_PCI_DIRECT
if ((pci_probe & (PCI_PROBE_CONF1 | PCI_PROBE_CONF2)) if ((pci_probe & (PCI_PROBE_CONF1 | PCI_PROBE_CONF2))
...@@ -1290,6 +1293,10 @@ void __devinit pcibios_config_init(void) ...@@ -1290,6 +1293,10 @@ void __devinit pcibios_config_init(void)
} }
#endif #endif
/* if direct access failed, fall back to BIOS access. */
if (pci_root_ops == NULL)
pci_root_ops = tmp;
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment