]> git.karo-electronics.de Git - karo-tx-linux.git/commit
PCI: add pci_scan_root_bus() that accepts resource list
authorBjorn Helgaas <bhelgaas@google.com>
Fri, 28 Oct 2011 22:25:50 +0000 (16:25 -0600)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Tue, 13 Dec 2011 18:42:11 +0000 (10:42 -0800)
commite324c952049ae54b11454e83485f7bfdc3dd3701
treec8d3134b77ba0b0ba3c2f6ab05bf205a69968705
parent1553cd63aba5b02da437494a1ac48a8f51917068
PCI: add pci_scan_root_bus() that accepts resource list

"Early" and "header" quirks often use incorrect bus resources because they
see the default resources assigned by pci_create_bus(), before the
architecture fixes them up (typically in pcibios_fixup_bus()).  Regions
reserved by these quirks end up with the wrong parents.

Here's the standard path for scanning a PCI root bus:

  pci_scan_bus or pci_scan_bus_parented
    pci_create_bus                     <-- A create with default resources
    pci_scan_child_bus
      pci_scan_slot
        pci_scan_single_device
          pci_scan_device
            pci_setup_device
              pci_fixup_device(early)  <-- B
          pci_device_add
            pci_fixup_device(header)   <-- C
      pcibios_fixup_bus                <-- D fill in correct resources

Early and header quirks at B and C use the default (incorrect) root bus
resources rather than those filled in at D.

This patch adds a new pci_scan_root_bus() function that sets the bus
resources correctly from a supplied list of resources.

I intend to remove pci_scan_bus() and pci_scan_bus_parented() after
fixing all callers.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/probe.c
include/linux/pci.h