Hi Thierry and Arnd, Thanks a lot for pushing this forward. I would like to have gotten this into the v4.8 merge window, but I didn't get to it soon enough. On Thu, Jun 30, 2016 at 05:19:30PM +0200, Thierry Reding wrote: > From: Arnd Bergmann <arnd@xxxxxxxx> > > This patch makes the existing pci_host_bridge structure a proper device > that is usable by PCI host drivers in a more standard way. In addition > to the existing pci_scan_bus, pci_scan_root_bus, pci_scan_root_bus_msi, > and pci_create_root_bus interfaces, this unfortunately means having to > add yet another interface doing basically the same thing, and add some > extra code in the initial step. > > However, this time it's more likely to be extensible enough that we > won't have to do another one again in the future, and we should be > able to reduce code much more as a result. > > The main idea is to pull the allocation of 'struct pci_host_bridge' out > of the registration, and let individual host drivers and architecture > code fill the members before calling the registration function. > > There are a number of things we can do based on this: > > * Use a single memory allocation for the driver-specific structure > and the generic PCI host bridge > * consolidate the contents of driver specific structures by moving > them into pci_host_bridge > * Add a consistent interface for removing a PCI host bridge again > when unloading a host driver module > * Replace the architecture specific __weak pcibios_* functions with > callbacks in a pci_host_bridge device > * Move common boilerplate code from host drivers into the generic > function, based on contents of the structure > * Extend pci_host_bridge with additional members when needed without > having to add arguments to pci_scan_*. > * Move members of struct pci_bus into pci_host_bridge to avoid > having lots of identical copies. > > As mentioned in a previous email, one open question is whether we want > to export a function for allocating a pci_host_bridge device in > combination with the per-device structure or let the driver itself > call kzalloc. I agree with Arnd that a pci_host_bridge_alloc() would be nice. The pointer to alloc_etherdev() was very useful and probably worth including in the changelog. It helps a lot if we can copy the style of some other subsystem, but my head is buried so deep in PCI that I don't know what they do. Looking forward to the next iteration. Bjorn -- To unsubscribe from this list: send the line "unsubscribe linux-tegra" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html