Re: [PATCH 1/3] PCI: use pci_is_root_bus() to check whether it is a root bus

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

 



On Mon, Sep 09, 2013 at 10:15:07AM -0600, Bjorn Helgaas wrote:
>On Mon, Sep 9, 2013 at 1:00 AM, Wei Yang <weiyang@xxxxxxxxxxxxxxxxxx> wrote:
>> On Fri, Sep 06, 2013 at 05:09:41PM -0600, Bjorn Helgaas wrote:
>>>[+cc Kenji, Alex]
>>>
>>>Did you trip over a case where a root bus has bus->self != NULL?
>>>I'd like to know more details about the case where:
>>>
>>>  (bus->parent == NULL) && (bus->self != NULL)
>>
>> I found one case that (bus->self == NULL) and this bus is not root bus.
>>
>> Not sure, this case will meet your requirement?
>
>I'm definitely interested in that case as well.  Can you include a
>complete "lspci -vv" output for the case where this happens?

I don't *see* it. I notice this during the code reading.

So yes, this happens when a virtual bus is created for SR-IOV.

Sounds this is the *only* case for (bus->self == NULl)?

>I suspect this happens with SR-IOV when we create "virtual" buses,
>i.e., in virtfn_add_bus().  I think maybe I'll update the comment at
>pci_is_root_bus() with a note about why we want to use it instead of
>testing for "bus->self == NULL".
>
>I think we still have other tree traversal issues related to those
>virtual buses, e.g., the ones I mentioned here [1].  But those are a
>separate problem.
>
>Bjorn
>
>[1] http://lkml.kernel.org/r/CAErSpo5sFfr=O-Pp=PyaxGauaEajaTr2aK-EQ_rTVUk1zyz8cA@xxxxxxxxxxxxxx

Here comes another problem I met recently.

On some platforms, like powernv, each pci-dev has a dev-tree node to represent
it. The dev-tree node is set by pci_set_of_node() during pci_scan_device().

In pci_set_of_node(), it searchs for the node with the same devfn in its
parent. Here comes the question, who should be the VF's parent. Would be a
conflict for the devfn between PF and VF?

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




[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