Re: [PATCH 00/29] PCI: use pci host bridge to loop pci root bus

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

-Yinghai
--
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


[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux