Re: What is the difference between number and secondary in pci_bus?

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

 



On Sun, Apr 1, 2012 at 2:38 AM, Richard Yang <weiyang@xxxxxxxxxxxxxxxxxx> wrote:
> All
>
> In the structure of pci_bus.
> There is number, primary, secondary and subordinate.
>
> primary and subordinate are easy to understand, while the number and
> secondary confused me.
>
> I think secondary means the current bus number.
> Then what number stands for?
>
> In pci_alloc_child_bus(),
> child->number = child->secondary = busnr;
> So they are the same?
> Then we need two different field?

Good questions.

Primary, secondary, and subordinate are really properties of the
upstream bridge, not the bus itself.  If we had a struct pci_bridge,
they would logically live there.  Primary is the bus number of the
upstream side of the bridge.  Secondary is the bus number of the
bridge's downstream side.  The bridge forwards config transactions
with bus numbers between secondary and subordinate to its downstream
side.

The "number of primary/secondary bridge" comments in struct pci_bus
are wrong -- they are bus numbers, not bridge numbers.  And the "max
number of subordinate buses" comment is not really right either.
Subordinate is just the largest bus number forwarded by the bridge.
As a consequence, that limits the number of buses in the downstream
hierarchy.

I have no idea why we have both number and secondary in struct
pci_bus.  It seems like they should always be the same.  It would be
an interesting exercise to figure out if they're ever different.

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