On Tue, Sep 25, 2012 at 12:06 PM, Yinghai Lu <yinghai@xxxxxxxxxx> wrote: > On Tue, Sep 25, 2012 at 10:37 AM, Bjorn Helgaas <bhelgaas@xxxxxxxxxx> wrote: >> On Tue, Sep 25, 2012 at 10:29 AM, Yinghai Lu <yinghai@xxxxxxxxxx> wrote: >>>> >>>> I'd prefer a design where the PCI core provides an interface that >>>> means "call this function for every host bridge we know about now >>>> *and* for every one that's added in the future." >>> >>> yes, that is the point to add pci_root_bridge_bus_type. We can register >>> bus notifier on that. >> >> I guess I missed your point. In the patch below (20/29 from your >> series), you're still iterating through all the host bridges, so there >> would have to be something else to handle hot-added host bridges. >> >> Are you saying you plan future patches to change this again to >> something using a bus notifier? >> >> --- a/arch/sparc/kernel/pci.c >> +++ b/arch/sparc/kernel/pci.c >> @@ -997,11 +997,13 @@ static void __devinit pci_bus_slot_names(struct >> device_node *node, >> >> static int __init of_pci_slot_init(void) >> { >> - struct pci_bus *pbus = NULL; >> + struct pci_host_bridge *host_bridge = NULL; >> + struct pci_bus *pbus; >> >> - while ((pbus = pci_find_next_bus(pbus)) != NULL) { >> + for_each_pci_host_bridge(host_bridge) { >> struct device_node *node; >> >> + pbus = hot_bridge->bus; >> if (pbus->self) { >> /* PCI->PCI bridge */ >> node = pbus->self->dev.of_node; > > that is for initial booting path. > > for hot add/remove notifier add need to be done case by case. Can initial boot be done the same as hot-add? If we add interfaces like for_each_pci_host_bridge(), people will just copy that for use at run-time. So it would be better to have the same interfaces for use at boot-time and at hot add-time. -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html