Re: One chart on pci bridge and its bus and their children

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

 



Hi YingHai,

>>> That's true, but I don't think it answers the question.  If we have:
>>>
>>>    pci_bus->bridge == pci_bus->self->dev
>>>
>>> why would we need both "self" and "bridge"?  It would be interesting
>>> to try to remove "bridge" and replace uses of it with "self->dev".
>>
>> then how about root bus?
>>
>> root bus ->self should be NULL.
>>
>> root bus ->bridge is to the hostbridge->dev.

As I understood, the current implementation is to trace the PCI host bridge
through the PCI root bus. The problem would be avoided if you change it for
a little bit to trace the PCI host bridge through (PCI domain number), which
will simplify the current implementation in 3.5.RC1 as well even though not
much. For example: When looking for the PCI host bridge for the child bus,
we only need get the PCI domain number, then get the corresponding PCI host
bridge. We needn't go through the whole PCI bus tree from the bottom to the
top until the PCI root bus.

I'm not sure that will introduce performance improvement or not.

>
>also
>
>b->bridge = get_device(&bridge->dev);
>
>so there is one reference held by pci bus.
>

If we ignore the return value of get_device() here, that would be possible
to merge "bridge"/"self" for child PCI bus. However, we still need differentiate
the PCI root bus and child bus because the "bridge"/"self" of PCI root bus
would be "NULL", but "bridge"/"self" (might be merged to "bridge") would point
pci_dev of the P2P bridge.

Thanks,
Gavin

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