All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gavin Shan <gwshan@linux.vnet.ibm.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: Gavin Shan <gwshan@linux.vnet.ibm.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: Re: [PATCH] PCI: Fix device node for virtual bus
Date: Wed, 12 Nov 2014 14:11:18 +1100	[thread overview]
Message-ID: <20141112031118.GA15257@shangw> (raw)
In-Reply-To: <CAErSpo7mEo61GP4oxcodKWFFXaaESae96qLiR1RE0CFsahr29g@mail.gmail.com>

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@linux.vnet.ibm.com> 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.

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@linux.vnet.ibm.com>
>> ---
>>  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
>>
>


  reply	other threads:[~2014-11-12  3:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-12  2:42 [PATCH] PCI: Fix device node for virtual bus Gavin Shan
2014-11-12  2:55 ` Bjorn Helgaas
2014-11-12  3:11   ` Gavin Shan [this message]
2014-11-12  4:08     ` Bjorn Helgaas
2014-11-12  5:24       ` Gavin Shan
2014-11-12 19:02         ` Bjorn Helgaas
2014-11-13  0:45           ` Gavin Shan
2014-11-20 23:11 ` Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141112031118.GA15257@shangw \
    --to=gwshan@linux.vnet.ibm.com \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.