From: Bjorn Helgaas <bhelgaas@google.com>
To: Wei Yang <weiyang@linux.vnet.ibm.com>
Cc: linux-pci@vger.kernel.org,
Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>,
Alex Chiang <achiang@canonical.com>
Subject: Re: [PATCH 1/3] PCI: use pci_is_root_bus() to check whether it is a root bus
Date: Fri, 6 Sep 2013 17:09:41 -0600 [thread overview]
Message-ID: <20130906230941.GC12956@google.com> (raw)
In-Reply-To: <1378431958-7874-1-git-send-email-weiyang@linux.vnet.ibm.com>
[+cc Kenji, Alex]
On Fri, Sep 06, 2013 at 09:45:56AM +0800, Wei Yang wrote:
> In __pci_bus_size_bridges() we check whether a pci bus is a root
> bus by testing bus->self. As indicated by commit 79af72d7
> ("PCI: pci_is_root_bus helper"), bus->self == NULL is not a proper
> way to check the pci root bus.
>
> This patch changes it to pci_is_root_bus() to check whether it is
> a root bus.
I think this is a good change, even if only on the grounds of
consistency.
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'm sure that situation exists, or Kenji and Alex would not have
made the change in 79af72d7, but I don't know the details.
I'd like to know the details so I can recognize similar problems
elsewhere.
> Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
> ---
> drivers/pci/setup-bus.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
> index 520210f..989de3c 100644
> --- a/drivers/pci/setup-bus.c
> +++ b/drivers/pci/setup-bus.c
> @@ -1134,7 +1134,7 @@ void __ref __pci_bus_size_bridges(struct pci_bus *bus,
> }
>
> /* The root bus? */
> - if (!bus->self)
> + if (pci_is_root_bus(bus))
> return;
>
> switch (bus->self->class >> 8) {
> --
> 1.7.1
>
next prev parent reply other threads:[~2013-09-06 23:09 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-06 1:45 [PATCH 1/3] PCI: use pci_is_root_bus() to check whether it is a root bus Wei Yang
2013-09-06 1:45 ` [PATCH 2/3] PCI: Use spec name for the comment of PCIe capability field Wei Yang
2013-09-06 23:12 ` Bjorn Helgaas
2013-09-09 2:10 ` Wei Yang
2013-09-06 1:45 ` [PATCH 3/3] PCI: Pass full info for window alignment Wei Yang
2013-09-06 23:19 ` Bjorn Helgaas
2013-09-06 23:09 ` Bjorn Helgaas [this message]
2013-09-09 2:14 ` [PATCH 1/3] PCI: use pci_is_root_bus() to check whether it is a root bus Wei Yang
2013-09-09 7:00 ` Wei Yang
2013-09-09 16:15 ` Bjorn Helgaas
2013-09-10 7:46 ` Wei Yang
2013-09-10 10:24 ` Benjamin Herrenschmidt
2013-09-11 0:45 ` Wei Yang
[not found] ` <CA+C+4OYxqgExkepUix5wU4VPRRUcnAFPQJcbUYcLHRcAmNgqgw@mail.gmail.com>
2013-09-09 16:10 ` Alex Chiang
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=20130906230941.GC12956@google.com \
--to=bhelgaas@google.com \
--cc=achiang@canonical.com \
--cc=kaneshige.kenji@jp.fujitsu.com \
--cc=linux-pci@vger.kernel.org \
--cc=weiyang@linux.vnet.ibm.com \
/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.