On Wed, Jun 06, 2012 at 01:28:35PM +0800, Richard Yang wrote: >On Tue, Jun 05, 2012 at 12:38:52PM -0700, Yinghai Lu wrote: >>> >>> Yinghai, >>> >>> is there a reason why this can't be fixed in >>> pci_create_root_bus() by having >>> bus->self = bridge; /* 'bridge' is the pci_device of the corresponding host bridge */ >>> get_device(&bridge->dev); >> >>self is pointer to pci_dev bridge. >> >>and for root bus, it is NULL. that mean no pci bridge device related. >> >>bridge is device, and have that assigned from host bridge dev, or pci >>bridge dev. >> >>also for virtfn of iov, new bus from there will not have self assigned too. >>for it even bridge is not assigned. >> >>so bridge is just generic way to save bridge (pci, host) device ... > I did a summarize, we have three types of pci_bus. Can we identify the type by following method? +--------------------+--------------------------------------------------+ | bus type | identification | +--------------------+--------------------------------------------------+ | root_bus |parent is NULL, bridge point to host_bridge dev | +--------------------+--------------------------------------------------+ | general_bus |parent to parent bus, bridge point to the bridge | +--------------------+--------------------------------------------------+ | iov_bus |parent to parent bus, bridge point to NULL | +--------------------+--------------------------------------------------+ Hmm... if we can determine which type a pci_bus is from this criteria. Sounds we don't need the self in pci_bus? -- Richard Yang Help you, Help me -- 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