From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: David Miller <davem@davemloft.net>
Cc: linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org
Subject: Re: [RFC/PATCH] of: Match PCI devices to OF nodes generically
Date: Tue, 05 Apr 2011 07:03:17 +1000 [thread overview]
Message-ID: <1301950997.2549.84.camel@pasglop> (raw)
In-Reply-To: <20110404.004856.55863268.davem@davemloft.net>
On Mon, 2011-04-04 at 00:48 -0700, David Miller wrote:
> From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Date: Mon, 04 Apr 2011 13:27:10 +1000
>
> > +struct device_node * __weak pcibios_get_phb_of_node(struct pci_bus *bus)
> > +{
> > + /* This should only be called for PHBs */
> > + if (WARN_ON(bus->self || bus->parent))
> > + return NULL;
>
> This WARN_ON() will always trigger on sparc, because we use the OF
> device tree object at the "parent" of the PCI bus devices we create
> for the PCI controller domains.
>
> I'm really surprised you don't link the PCI bus roots into the rest of
> the global device hierarchy on powerpc.
But in the above test bus->parent is the "struct pci_bus *" parent, not
the "struct device *" nor "struct device_node *" parent... That
shouldn't be linked to anything on a PHB.
To answer your other point, we do link PHBs on some platforms, not
others. Historical stuff here. Most of our platforms discover PCI
bridges very early from setup_arch() before we have any struct device
around. Mostly because that's how we always did and there's some
subtle/nasty corner cases to deal with if we change that.
Cheers,
Ben.
WARNING: multiple messages have this Message-ID (diff)
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: David Miller <davem@davemloft.net>
Cc: linux-arch@vger.kernel.org, linux-pci@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC/PATCH] of: Match PCI devices to OF nodes generically
Date: Tue, 05 Apr 2011 07:03:17 +1000 [thread overview]
Message-ID: <1301950997.2549.84.camel@pasglop> (raw)
In-Reply-To: <20110404.004856.55863268.davem@davemloft.net>
On Mon, 2011-04-04 at 00:48 -0700, David Miller wrote:
> From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Date: Mon, 04 Apr 2011 13:27:10 +1000
>
> > +struct device_node * __weak pcibios_get_phb_of_node(struct pci_bus *bus)
> > +{
> > + /* This should only be called for PHBs */
> > + if (WARN_ON(bus->self || bus->parent))
> > + return NULL;
>
> This WARN_ON() will always trigger on sparc, because we use the OF
> device tree object at the "parent" of the PCI bus devices we create
> for the PCI controller domains.
>
> I'm really surprised you don't link the PCI bus roots into the rest of
> the global device hierarchy on powerpc.
But in the above test bus->parent is the "struct pci_bus *" parent, not
the "struct device *" nor "struct device_node *" parent... That
shouldn't be linked to anything on a PHB.
To answer your other point, we do link PHBs on some platforms, not
others. Historical stuff here. Most of our platforms discover PCI
bridges very early from setup_arch() before we have any struct device
around. Mostly because that's how we always did and there's some
subtle/nasty corner cases to deal with if we change that.
Cheers,
Ben.
next prev parent reply other threads:[~2011-04-04 21:03 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-04 2:04 [RFC/PATCH] of: Match PCI devices to OF nodes generically Benjamin Herrenschmidt
2011-04-04 2:04 ` Benjamin Herrenschmidt
2011-04-04 3:27 ` Benjamin Herrenschmidt
2011-04-04 3:27 ` Benjamin Herrenschmidt
2011-04-04 7:37 ` Benjamin Herrenschmidt
2011-04-04 7:37 ` Benjamin Herrenschmidt
2011-04-04 7:37 ` Benjamin Herrenschmidt
2011-04-04 15:25 ` Bjorn Helgaas
2011-04-04 15:25 ` Bjorn Helgaas
2011-04-04 21:03 ` Benjamin Herrenschmidt
2011-04-04 21:03 ` Benjamin Herrenschmidt
2011-04-04 23:58 ` Benjamin Herrenschmidt
2011-04-04 23:58 ` Benjamin Herrenschmidt
2011-04-05 2:32 ` Grant Likely
2011-04-05 2:32 ` Grant Likely
2011-04-05 6:42 ` Benjamin Herrenschmidt
2011-04-05 6:42 ` Benjamin Herrenschmidt
2011-04-04 7:48 ` David Miller
2011-04-04 7:48 ` David Miller
2011-04-04 21:03 ` Benjamin Herrenschmidt [this message]
2011-04-04 21:03 ` Benjamin Herrenschmidt
2011-04-04 21:09 ` David Miller
2011-04-04 21:09 ` David Miller
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=1301950997.2549.84.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=davem@davemloft.net \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.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.