From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Catalin Marinas <Catalin.Marinas@arm.com>,
Liviu Dudau <Liviu.Dudau@arm.com>,
Rob Herring <robh+dt@kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>
Subject: Re: [RFC PATCH] drivers: of: move PCI domain assignment to generic OF code
Date: Mon, 10 Nov 2014 13:52:32 +0000 [thread overview]
Message-ID: <20141110135232.GC15484@red-moon> (raw)
In-Reply-To: <1459907.RIyEjnM4cg@wuerfel>
On Mon, Nov 10, 2014 at 12:51:19PM +0000, Arnd Bergmann wrote:
> On Monday 10 November 2014 12:26:08 Lorenzo Pieralisi wrote:
> > ---
> > arch/arm64/kernel/pci.c | 14 +++--------
> > drivers/of/of_pci.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++--
> > include/linux/of_pci.h | 7 +++---
> > 3 files changed, 71 insertions(+), 16 deletions(-)
> >
> > diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c
> > index ce5836c..5e21c1c 100644
> > --- a/arch/arm64/kernel/pci.c
> > +++ b/arch/arm64/kernel/pci.c
> > @@ -49,20 +49,14 @@ int pcibios_add_device(struct pci_dev *dev)
> >
> >
> > #ifdef CONFIG_PCI_DOMAINS_GENERIC
> > -static bool dt_domain_found = false;
> >
> > void pci_bus_assign_domain_nr(struct pci_bus *bus, struct device *parent)
> > {
> > - int domain = of_get_pci_domain_nr(parent->of_node);
> > + int domain = of_assign_pci_domain_nr(parent->of_node);
> >
> > - if (domain >= 0) {
> > - dt_domain_found = true;
> > - } else if (dt_domain_found == true) {
> > - dev_err(parent, "Node %s is missing \"linux,pci-domain\" property in DT\n",
> > - parent->of_node->full_name);
> > - return;
> > - } else {
> > - domain = pci_get_new_domain_nr();
> > + if (domain < 0) {
> > + dev_err(parent, "PCI domain assignment failed\n");
> > + domain = -1;
> > }
> >
> > bus->domain_nr = domain;
>
> Is there a need to still keep this in architecture specific code? Why
> not move it to drivers/pci and let other firmware infrastructure
> hook in there directly.
Ok, I can move the function to drivers/pci/pci.c, I did not want to add
OF code in there but if it is ok with Bjorn I will move the generic
pci_bus_assign_domain_nr()
there and be done with this.
> > {
> > @@ -45,10 +45,9 @@ of_pci_parse_bus_range(struct device_node *node, struct resource *res)
> > return -EINVAL;
> > }
> >
> > -static inline int
> > -of_get_pci_domain_nr(struct device_node *node)
> > +static inline int of_assign_pci_domain_nr(struct device_node *node)
> > {
> > - return -1;
> > + return pci_get_new_domain_nr();
> > }
> > #endif
>
> This gets a bit tricky otherwise once we add ACPI in the mix, with all
> combinations of OF and ACPI at compile time and at runtime.
I definitely agree, that's why it is an RFC, basically wanted to
understand what we want to do with the generic implementation and where
to move it.
Thanks,
Lorenzo
prev parent reply other threads:[~2014-11-10 13:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-10 12:26 [RFC PATCH] drivers: of: move PCI domain assignment to generic OF code Lorenzo Pieralisi
2014-11-10 12:51 ` Arnd Bergmann
2014-11-10 13:52 ` Lorenzo Pieralisi [this message]
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=20141110135232.GC15484@red-moon \
--to=lorenzo.pieralisi@arm.com \
--cc=Catalin.Marinas@arm.com \
--cc=Liviu.Dudau@arm.com \
--cc=arnd@arndb.de \
--cc=bhelgaas@google.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pci@vger.kernel.org \
--cc=robh+dt@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).