Current problems
- pci_fixup_irqs() doesn't handle hotplug
- We only run pci_fixup_irqs() once at boot-time, so the fixups aren't done for hot-added devices. This is a problem for some ARM machines that enumerate PCI devices after boot.
- PowerPC DMA/IRQ init
- Hiroo Matsumoto's patches to make hot-added devices work. These were never merged, so I think this is still broken.
- Incorrect handling of unassigned BARs
- http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=679545
Cleanups and future work
- Remove __devinit and __ref annotations
- Greg Kroah-Hartmann is removing CONFIG_HOTPLUG, which will result in __devinit being a no-op. The __ref annotation is related to __devinit. We should remove all the __devinit and __ref annotations in drivers/pci.
- Use PCI Express Capability accessors
- Jiang Liu added accessors for the PCI Express Capability to reduce errors related to v1 and v2 capability formats. There are still a few places that don't use the accessors: pciehp, drm_pcie_get_speed_cap_mask(), and probably other places that use the PCI_EXP_DEVCAP and related #defines.
- SR-IOV virtual buses
- SR-IOV devices can span several bus numbers. In this case, we create additional pci_bus structures, but only the bus for the PF devices has an upstream bridge. The others have NULL bus->self pointers. Code that checks that pointer or traverses the PCI hierarchy may not do the right thing. Auditing needed.
- pci_enable_resources() takes a misleading BAR bitmask
- pci_enable_resources() and all the pcibios_enable_device() implementations take a bitmask of BARs to be enabled. But PCI doesn't work that way -- if you turn on the MEM bit in the PCI control register, all memory BARs are enabled, regardless of whether they've been initialized.
- acpi_pci_register_driver()
- This doesn't seem like a good design. The callers are not really separate drivers, and I think things would be clearer if we just integrated them directly into drivers/acpi/pci_root.c.
- Remove "pci=routeirq". Possibly just remove the kernel-parameters.txt documentation first.
- Remove "pci=nocrs" documentation? Remove dmesg note about PCI _CRS?
- Stop blindly probing all buses in domain 0.
- Identify unprogrammed BARs (see bug 679545 above).
- Move _PXM evaluation into generic ACPI PCI host bridge code.
- Remove pci_bus_max_busnr()? Seems like a dubious interface ... hotplug can change the max bus number.
- Pull PCI domain/segment support from architectures into the core.
- Get rid of for_each_pci_dev(). Most uses are bugs because they are places where hot-added devices aren't handled the same way as devices present at boot-time.
- Get rid of pci_get_domain_bus_and_slot(), pci_get_bus_and_slot(), etc.
- Clean up drivers/edac/i7core_edac.c so it doesn't need pci_find_next_bus().
- ASPM:
- Remove pcie_aspm_enabled() (appears to be unused).
- Rework ASPM link_state initialization to be simpler. Possibly pcie_aspm_init_link_state() could allocate pcie_link_state for every device with a downstream port. Then ASPM could conceivably be enabled/disabled at run-time.
- Rework ASPM to get rid of the link_list.
- Clean up aspm_disabled handling (https://bugzilla.kernel.org/show_bug.cgi?id=55211).
- Clean up _OSC handling.