From: "Sean O. Stalley" <sean.stalley@intel.com> To: Yinghai Lu <yinghai@kernel.org> Cc: "Bjorn Helgaas" <bhelgaas@google.com>, "Rajat Jain" <rajatxjain@gmail.com>, "Michael S. Tsirkin" <mst@redhat.com>, "Rafał Miłecki" <zajec5@gmail.com>, "gong.chen@linux.intel.com" <gong.chen@linux.intel.com>, "linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>, "Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>, linux-api@vger.kernel.org Subject: Re: [PATCH 2/2] PCI: Add support for Enhanced Allocation devices Date: Wed, 2 Sep 2015 10:46:12 -0700 [thread overview] Message-ID: <20150902174612.GA2700@sean.stalley.intel.com> (raw) In-Reply-To: <CAE9FiQUQacSJXPqv9GQJ4AF0TN7uxcBiAYHVbHwvFhEfWgWKHg@mail.gmail.com> Thanks for taking a look Yinghai. On Tue, Sep 01, 2015 at 04:14:08PM -0700, Yinghai Lu wrote: > On Thu, Aug 20, 2015 at 9:59 AM, Sean O. Stalley <sean.stalley@intel.com> wrote: > > Add support for devices using Enhanced Allocation entries instead of BARs. > > This patch allows the kernel to parse the EA Extended Capability structure > > in PCI configspace and claim the BAR-equivalent resources. > > > > Signed-off-by: Sean O. Stalley <sean.stalley@intel.com> > > --- > > drivers/pci/pci.c | 219 ++++++++++++++++++++++++++++++++++++++++++++++++++++ > > drivers/pci/pci.h | 1 + > > drivers/pci/probe.c | 3 + > > 3 files changed, 223 insertions(+) > > > > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c > > index 0008c95..c8217a8 100644 > > --- a/drivers/pci/pci.c > > +++ b/drivers/pci/pci.c > ... > > + > > +/* Read an Enhanced Allocation (EA) entry */ > > +static int pci_ea_read(struct pci_dev *dev, int offset) > > +{ > ... > > + res->name = pci_name(dev); > > + res->start = start; > > + res->end = end; > > + res->flags = flags; > > + > > + pci_ea_claim_resource(dev, res); > > + > > +out: > > + return offset + ent_size; > > +} > > + > > +/* Enhanced Allocation Initalization */ > > +void pci_ea_init(struct pci_dev *dev) > > +{ > ... > > + > > + for (i = 0; i < num_ent; ++i) { > > + /* parse each EA entry */ > > + dev_dbg(&dev->dev, "%s: parsing entry %i...\n", __func__, i); > > + offset = pci_ea_read(dev, offset); > > + } > > +} > > + > > static void pci_add_saved_cap(struct pci_dev *pci_dev, > > struct pci_cap_saved_state *new_cap) > > { > > > diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c > > index cefd636..4cadf35 100644 > > --- a/drivers/pci/probe.c > > +++ b/drivers/pci/probe.c > > @@ -1522,6 +1522,9 @@ static struct pci_dev *pci_scan_device(struct pci_bus *bus, int devfn) > > > > static void pci_init_capabilities(struct pci_dev *dev) > > { > > + /* Enhanced Allocation */ > > + pci_ea_init(dev); > > + > > /* MSI/MSI-X list */ > > pci_msi_init_pci_dev(dev); > > > > Should not call pci_ea_claim_resource() that early. Out of curiosity, why shouldn't resources be claimed that early? EA resources are fixed by hardware. They are always there & will never move. > > For x86 and other arches, we call > pcibios_resource_survey/pcibios_allocate_bus_resouce/pcibios_allocate_resources > quite late. Would it be better to modify pci_claim_resource() to support EA instead of adding pci_ea_claim_resource()? That way, EA entries would be claimed at the same time as traditional BARs. -Sean
WARNING: multiple messages have this Message-ID (diff)
From: "Sean O. Stalley" <sean.stalley-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> To: Yinghai Lu <yinghai-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> Cc: "Bjorn Helgaas" <bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>, "Rajat Jain" <rajatxjain-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, "Michael S. Tsirkin" <mst-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>, "Rafał Miłecki" <zajec5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>, "gong.chen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org" <gong.chen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>, "linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" <linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>, "Linux Kernel Mailing List" <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>, linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Subject: Re: [PATCH 2/2] PCI: Add support for Enhanced Allocation devices Date: Wed, 2 Sep 2015 10:46:12 -0700 [thread overview] Message-ID: <20150902174612.GA2700@sean.stalley.intel.com> (raw) In-Reply-To: <CAE9FiQUQacSJXPqv9GQJ4AF0TN7uxcBiAYHVbHwvFhEfWgWKHg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> Thanks for taking a look Yinghai. On Tue, Sep 01, 2015 at 04:14:08PM -0700, Yinghai Lu wrote: > On Thu, Aug 20, 2015 at 9:59 AM, Sean O. Stalley <sean.stalley-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> wrote: > > Add support for devices using Enhanced Allocation entries instead of BARs. > > This patch allows the kernel to parse the EA Extended Capability structure > > in PCI configspace and claim the BAR-equivalent resources. > > > > Signed-off-by: Sean O. Stalley <sean.stalley-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> > > --- > > drivers/pci/pci.c | 219 ++++++++++++++++++++++++++++++++++++++++++++++++++++ > > drivers/pci/pci.h | 1 + > > drivers/pci/probe.c | 3 + > > 3 files changed, 223 insertions(+) > > > > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c > > index 0008c95..c8217a8 100644 > > --- a/drivers/pci/pci.c > > +++ b/drivers/pci/pci.c > ... > > + > > +/* Read an Enhanced Allocation (EA) entry */ > > +static int pci_ea_read(struct pci_dev *dev, int offset) > > +{ > ... > > + res->name = pci_name(dev); > > + res->start = start; > > + res->end = end; > > + res->flags = flags; > > + > > + pci_ea_claim_resource(dev, res); > > + > > +out: > > + return offset + ent_size; > > +} > > + > > +/* Enhanced Allocation Initalization */ > > +void pci_ea_init(struct pci_dev *dev) > > +{ > ... > > + > > + for (i = 0; i < num_ent; ++i) { > > + /* parse each EA entry */ > > + dev_dbg(&dev->dev, "%s: parsing entry %i...\n", __func__, i); > > + offset = pci_ea_read(dev, offset); > > + } > > +} > > + > > static void pci_add_saved_cap(struct pci_dev *pci_dev, > > struct pci_cap_saved_state *new_cap) > > { > > > diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c > > index cefd636..4cadf35 100644 > > --- a/drivers/pci/probe.c > > +++ b/drivers/pci/probe.c > > @@ -1522,6 +1522,9 @@ static struct pci_dev *pci_scan_device(struct pci_bus *bus, int devfn) > > > > static void pci_init_capabilities(struct pci_dev *dev) > > { > > + /* Enhanced Allocation */ > > + pci_ea_init(dev); > > + > > /* MSI/MSI-X list */ > > pci_msi_init_pci_dev(dev); > > > > Should not call pci_ea_claim_resource() that early. Out of curiosity, why shouldn't resources be claimed that early? EA resources are fixed by hardware. They are always there & will never move. > > For x86 and other arches, we call > pcibios_resource_survey/pcibios_allocate_bus_resouce/pcibios_allocate_resources > quite late. Would it be better to modify pci_claim_resource() to support EA instead of adding pci_ea_claim_resource()? That way, EA entries would be claimed at the same time as traditional BARs. -Sean
next prev parent reply other threads:[~2015-09-02 17:50 UTC|newest] Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-08-20 16:59 [PATCH 0/2] PCI: Add support for PCI Enhanced Allocation "BARs" Sean O. Stalley 2015-08-20 16:59 ` Sean O. Stalley 2015-08-20 16:59 ` [PATCH 1/2] PCI: Add Enhanced Allocation register entries Sean O. Stalley 2015-08-20 16:59 ` [PATCH 2/2] PCI: Add support for Enhanced Allocation devices Sean O. Stalley 2015-08-20 16:59 ` Sean O. Stalley 2015-09-01 23:14 ` Yinghai Lu 2015-09-02 17:46 ` Sean O. Stalley [this message] 2015-09-02 17:46 ` Sean O. Stalley 2015-09-02 19:25 ` Bjorn Helgaas 2015-09-02 19:25 ` Bjorn Helgaas 2015-09-02 20:01 ` Sean O. Stalley 2015-09-02 21:21 ` Bjorn Helgaas 2015-09-02 21:21 ` Bjorn Helgaas 2015-09-03 0:29 ` Sean O. Stalley 2015-09-03 0:29 ` Sean O. Stalley 2015-09-03 14:46 ` Bjorn Helgaas 2015-09-03 18:23 ` Sean O. Stalley 2015-09-03 18:23 ` Sean O. Stalley
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=20150902174612.GA2700@sean.stalley.intel.com \ --to=sean.stalley@intel.com \ --cc=bhelgaas@google.com \ --cc=gong.chen@linux.intel.com \ --cc=linux-api@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-pci@vger.kernel.org \ --cc=mst@redhat.com \ --cc=rajatxjain@gmail.com \ --cc=yinghai@kernel.org \ --cc=zajec5@gmail.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: linkBe 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.