Re: [PATCH] PCI: Fix device node for virtual bus

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

 



On Tue, Nov 11, 2014 at 8:11 PM, Gavin Shan <gwshan@xxxxxxxxxxxxxxxxxx> wrote:
> On Tue, Nov 11, 2014 at 07:55:19PM -0700, Bjorn Helgaas wrote:
>>On Tue, Nov 11, 2014 at 7:42 PM, Gavin Shan <gwshan@xxxxxxxxxxxxxxxxxx> wrote:
>>> pci_set_bus_of_node() sets virtual PCI bus's device node to PHB's
>>> device node wrongly. The patch fixes the issue.
>>
>>This needs more detail.  How is this bug visible to users?  Is there a
>>bug report?  Is this a regression?  Should it be marked for stable?
>>
>
> I don't have opened bug for it. I just found the problem (maybe not
> a problem) when reading the code: The original implementation binds
> PHB device-tree node with "virtual bus", which doesn't make sense.

Does this result in something being wrong in sysfs?  How is this bug
visible to users?

> Yes, I guess it should be marked for stable if you don't object.
>
>>We use "virtual bus" to refer to buses created for SR-IOV VFs that are
>>not on the same bus as the PF.  These virtual buses have no bridge
>>device leading to them.  But I think you're talking about something
>>totally different.  Or maybe that *is* what you're talking about,
>>since this patch resembles 2ba29e270e97 ("PCI: Use pci_is_root_bus()
>>to check for root bus").
>>
>
> "virtual bus" here is the buses created for SR-IOV VFs. Yes, the
> code changes resembles commit 2ba29e270e97.
>
> Thanks,
> Gavin
>
>>Bjorn
>>
>>> Signed-off-by: Gavin Shan <gwshan@xxxxxxxxxxxxxxxxxx>
>>> ---
>>>  drivers/pci/of.c | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/pci/of.c b/drivers/pci/of.c
>>> index f092993..7b2256b 100644
>>> --- a/drivers/pci/of.c
>>> +++ b/drivers/pci/of.c
>>> @@ -31,9 +31,9 @@ void pci_release_of_node(struct pci_dev *dev)
>>>
>>>  void pci_set_bus_of_node(struct pci_bus *bus)
>>>  {
>>> -       if (bus->self == NULL)
>>> +       if (pci_is_root_bus(bus))
>>>                 bus->dev.of_node = pcibios_get_phb_of_node(bus);
>>> -       else
>>> +       else if (bus->self)
>>>                 bus->dev.of_node = of_node_get(bus->self->dev.of_node);
>>>  }
>>>
>>> --
>>> 1.8.3.2
>>>
>>
>
--
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