ACPI: Optimize acpi_get_pci_rootbridge_handle() to boot faster

Move acpi_get_pci_rootbridge_handle() from glue.c to pci_root.c and get the
root bridge ACPI handles by searching the &acpi_pci_roots list instead of
walking through the ACPI name space.  This significantly reduces boot time
on large I/O systems.

Signed-off-by: Justin Chen <justin.chen@hp.com>
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
Justin Chen
2006-12-06 10:17:10 -07:00
committed by Len Brown
parent a8b3485287
commit d91a007847
2 changed files with 13 additions and 123 deletions

View File

@@ -117,6 +117,19 @@ void acpi_pci_unregister_driver(struct acpi_pci_driver *driver)
EXPORT_SYMBOL(acpi_pci_unregister_driver);
acpi_handle acpi_get_pci_rootbridge_handle(unsigned int seg, unsigned int bus)
{
struct acpi_pci_root *tmp;
list_for_each_entry(tmp, &acpi_pci_roots, node) {
if ((tmp->id.segment == (u16) seg) && (tmp->id.bus == (u16) bus))
return tmp->device->handle;
}
return NULL;
}
EXPORT_SYMBOL_GPL(acpi_get_pci_rootbridge_handle);
static acpi_status
get_root_bridge_busnr_callback(struct acpi_resource *resource, void *data)
{