From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: Sunil Kovvuri
<sunil.kovvuri-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
linux-pci <linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Bjorn Helgaas <bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
Catalin Marinas <Catalin.Marinas-5wv7dgnIgG8@public.gmane.org>,
Will Deacon <Will.Deacon-5wv7dgnIgG8@public.gmane.org>,
Benjamin Herrenschmidt
<benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>,
linaro-kernel
<linaro-kernel-cunTk1MwBs8s++Sfvej+rw@public.gmane.org>,
Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
LAKML
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
Tanmay Inamdar <tinamdar-qTEPVZfXA3Y@public.gmane.org>,
Grant Likely
<grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>,
"kdb-JdWt/H98ok1AfugRpC6u6w@public.gmane.org"
<kdb-JdWt/H98ok1AfugRpC6u6w@public.gmane.org>,
"yu.zhao-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org"
<yu.zhao-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH v7 0/3] Add support for PCI in AArch64
Date: Wed, 21 May 2014 11:06:44 -0600 [thread overview]
Message-ID: <20140521170644.GJ8775@obsidianresearch.com> (raw)
In-Reply-To: <20140521113421.GB13511-hOhETlTuV5niMG9XS5x8Mg@public.gmane.org>
On Wed, May 21, 2014 at 12:34:21PM +0100, Liviu Dudau wrote:
> On Wed, May 21, 2014 at 04:45:29PM +0530, Sunil Kovvuri wrote:
> > Hi Liviu,
> >
> > Sorry for the trouble.
> > I got why 'res->parent' is not set in my case.
> > Basically my SR-IOV device has fixed resources, so resources will not
> > be allocated/assigned and hence parent resource is not set.
> > I will move the resource claiming to host controller driver as a fixup
> > so that parent resource hierarchy is set.
> >
> > Thanks for the support.
>
> Glad you worked out the cause for the problem. I will still at to my list of
> ToDo things to investigate resource parenting with my patchset.
We recently fixed some things in this area on mvebu. It is important
to ensure that the aperature in the host driver has a proper resource
associated with it, or the PCI core won't create sub resources.
commit 2613ba480fb7b40c67eea36d03c9946977828623
Author: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Date: Wed Feb 12 15:57:08 2014 -0700
PCI: mvebu: Call request_resource() on the apertures
It is typical for host drivers to request a resource for the aperture; once
this is done the PCI core will properly populate resources for all BARs in
the system.
With this patch cat /proc/iomem will now show:
e0000000-efffffff : PCI MEM 0000
e0000000-e00fffff : PCI Bus 0000:01
e0000000-e001ffff : 0000:01:00.0
Tested on Kirkwood.
Signed-off-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Signed-off-by: Bjorn Helgaas <bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Acked-by: Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>
diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c
index 05e352889868..d3d1cfd51e09 100644
--- a/drivers/pci/host/pci-mvebu.c
+++ b/drivers/pci/host/pci-mvebu.c
@@ -101,7 +101,9 @@ struct mvebu_pcie {
struct mvebu_pcie_port *ports;
struct msi_chip *msi;
struct resource io;
+ char io_name[30];
struct resource realio;
+ char mem_name[30];
struct resource mem;
struct resource busn;
int nports;
@@ -672,10 +674,30 @@ static int mvebu_pcie_setup(int nr, struct pci_sys_data *sys)
{
struct mvebu_pcie *pcie = sys_to_pcie(sys);
int i;
+ int domain = 0;
- if (resource_size(&pcie->realio) != 0)
+#ifdef CONFIG_PCI_DOMAINS
+ domain = sys->domain;
+#endif
+
+ snprintf(pcie->mem_name, sizeof(pcie->mem_name), "PCI MEM %04x",
+ domain);
+ pcie->mem.name = pcie->mem_name;
+
+ snprintf(pcie->io_name, sizeof(pcie->io_name), "PCI I/O %04x", domain);
+ pcie->realio.name = pcie->io_name;
+
+ if (request_resource(&iomem_resource, &pcie->mem))
+ return 0;
+
+ if (resource_size(&pcie->realio) != 0) {
+ if (request_resource(&ioport_resource, &pcie->realio)) {
+ release_resource(&pcie->mem);
+ return 0;
+ }
pci_add_resource_offset(&sys->resources, &pcie->realio,
sys->io_offset);
+ }
pci_add_resource_offset(&sys->resources, &pcie->mem, sys->mem_offset);
pci_add_resource(&sys->resources, &pcie->busn);
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-05-21 17:06 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-14 15:34 [PATCH v7 0/3] Add support for PCI in AArch64 Liviu Dudau
2014-03-14 15:34 ` [PATCH v7 1/3] Fix ioport_map() for !CONFIG_GENERIC_IOMAP cases Liviu Dudau
2014-03-14 15:34 ` [PATCH v7 2/3] arm64: Extend the PCI I/O space to 16MB Liviu Dudau
2014-03-14 15:34 ` [PATCH v7 3/3] arm64: Add architecture support for PCI Liviu Dudau
2014-03-14 17:14 ` Catalin Marinas
2014-03-14 17:38 ` Arnd Bergmann
2014-03-14 18:05 ` Liviu Dudau
2014-03-14 19:10 ` Arnd Bergmann
2014-03-16 6:22 ` Benjamin Herrenschmidt
2014-03-17 17:38 ` Catalin Marinas
2014-03-17 18:05 ` Liviu Dudau
2014-03-19 13:56 ` Catalin Marinas
2014-03-19 17:21 ` Liviu Dudau
[not found] ` <20140319172140.GA16328-2JSQmVVBSi7ZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
2014-03-19 17:53 ` Rob Herring
2014-03-19 18:36 ` Arnd Bergmann
2014-03-19 18:37 ` Arnd Bergmann
2014-03-20 9:46 ` Liviu Dudau
2014-03-20 11:17 ` Arnd Bergmann
2014-03-20 11:38 ` Liviu Dudau
2014-03-20 12:26 ` Arnd Bergmann
2014-03-20 12:50 ` Liviu Dudau
[not found] ` <1394811258-1500-4-git-send-email-Liviu.Dudau-5wv7dgnIgG8@public.gmane.org>
2014-03-17 16:05 ` Rob Herring
2014-03-17 16:22 ` Liviu Dudau
2014-04-07 23:58 ` Bjorn Helgaas
[not found] ` <20140407235830.GA9959-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2014-04-08 9:52 ` Liviu Dudau
2014-04-22 8:58 ` [PATCH v7 0/3] Add support for PCI in AArch64 Sandeepa Prabhu
[not found] ` <CA+b37P3HqMFU6kGA+GH3YpGM_Z=TwNXL6jKu+ConR3kCk-Tp4g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-22 10:11 ` Liviu Dudau
2014-04-22 11:50 ` Sandeepa Prabhu
2014-04-22 12:34 ` Liviu Dudau
2014-04-23 20:32 ` Tanmay Inamdar
2014-04-24 3:08 ` Sandeepa Prabhu
2014-05-16 10:33 ` Sunil Kovvuri
[not found] ` <CA+sq2Ccok5wtKjCZUkBhhj3WsiqFAoMgHK7LY210aBtMku+8SA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-16 13:24 ` Liviu Dudau
2014-05-16 17:42 ` Sunil Kovvuri
2014-05-21 11:15 ` Sunil Kovvuri
[not found] ` <CA+sq2Ccp0_4hgbbWa27bkYcqiXY6Ckr8eckWnHwANvhWNo97fg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-21 11:34 ` Liviu Dudau
[not found] ` <20140521113421.GB13511-hOhETlTuV5niMG9XS5x8Mg@public.gmane.org>
2014-05-21 17:06 ` Jason Gunthorpe [this message]
2014-05-19 13:01 ` Arnd Bergmann
2014-05-20 4:22 ` Sunil Kovvuri
[not found] ` <CA+sq2Ce+8YB+02B7zhxTXwropZXv9spy-w=AJ8YXCP69kr-_1A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-20 8:44 ` Arnd Bergmann
2014-05-20 8:55 ` Sunil Kovvuri
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=20140521170644.GJ8775@obsidianresearch.com \
--to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
--cc=Catalin.Marinas-5wv7dgnIgG8@public.gmane.org \
--cc=Will.Deacon-5wv7dgnIgG8@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org \
--cc=bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
--cc=kdb-JdWt/H98ok1AfugRpC6u6w@public.gmane.org \
--cc=linaro-kernel-cunTk1MwBs8s++Sfvej+rw@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=sunil.kovvuri-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=tinamdar-qTEPVZfXA3Y@public.gmane.org \
--cc=yu.zhao-ral2JQCrhuEAvxtiuMwx3w@public.gmane.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).