Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1231772 > unrolled thread

[PATCH v2 0/2] PCI: Add support for PCI Enhanced Allocation "BARs"

Started by"Sean O. Stalley" <sean.stalley@intel.com>
First post2015-09-24 00:40 +0200
Last post2015-09-24 18:50 +0200
Articles 6 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v2 0/2] PCI: Add support for PCI Enhanced Allocation "BARs" "Sean O. Stalley" <sean.stalley@intel.com> - 2015-09-24 00:40 +0200
    Re: [PATCH v2 0/2] PCI: Add support for PCI Enhanced Allocation "BARs" Yinghai Lu <yinghai@kernel.org> - 2015-09-24 01:30 +0200
      Re: [PATCH v2 0/2] PCI: Add support for PCI Enhanced Allocation  "BARs" "Sean O. Stalley" <sean.stalley@intel.com> - 2015-09-24 02:00 +0200
        Re: [PATCH v2 0/2] PCI: Add support for PCI Enhanced Allocation "BARs" Yinghai Lu <yinghai@kernel.org> - 2015-09-24 02:30 +0200
    Re: [PATCH v2 0/2] PCI: Add support for PCI Enhanced Allocation "BARs" David Daney <ddaney.cavm@gmail.com> - 2015-09-24 02:40 +0200
      Re: [PATCH v2 0/2] PCI: Add support for PCI Enhanced Allocation  "BARs" "Sean O. Stalley" <sean.stalley@intel.com> - 2015-09-24 18:50 +0200

#1231772 — [PATCH v2 0/2] PCI: Add support for PCI Enhanced Allocation "BARs"

From"Sean O. Stalley" <sean.stalley@intel.com>
Date2015-09-24 00:40 +0200
Subject[PATCH v2 0/2] PCI: Add support for PCI Enhanced Allocation "BARs"
Message-ID<qc0RH-14h-3@gated-at.bofh.it>
PCI Enhanced Allocation is a new method of allocating MMIO & IO
resources for PCI devices & bridges. It can be used instead
of the traditional PCI method of using BARs.

EA entries are hardware-initialized to a fixed address.
Unlike BARs, regions described by EA are cannot be moved.
Because of this, only devices which are permanently connected to
the PCI bus can use EA. A removable PCI card must not use EA.

This patchset adds support for using EA entries instead of BARs
on Root Complex Integrated Endpoints.

The Enhanced Allocation ECN is publicly available here:
https://www.pcisig.com/specifications/conventional/ECN_Enhanced_Allocation_23_Oct_2014_Final.pdf


Changes from V1:
	- Use generic PCI resource claim functions (instead of EA-specific functions)
	- Only add support for RCiEPs (instead of all devices).
	- Removed some debugging messages leftover from early testing.


Sean O. Stalley (2):
  PCI: Add Enhanced Allocation register entries
  PCI: Add support for Enhanced Allocation devices

 drivers/pci/pci.c             | 174 ++++++++++++++++++++++++++++++++++++++++++
 drivers/pci/pci.h             |   1 +
 drivers/pci/probe.c           |   3 +
 include/uapi/linux/pci_regs.h |  40 +++++++++-
 4 files changed, 217 insertions(+), 1 deletion(-)

-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1231783

FromYinghai Lu <yinghai@kernel.org>
Date2015-09-24 01:30 +0200
Message-ID<qc1E6-2fq-9@gated-at.bofh.it>
In reply to#1231772
On Wed, Sep 23, 2015 at 3:27 PM, Sean O. Stalley <sean.stalley@intel.com> wrote:
> PCI Enhanced Allocation is a new method of allocating MMIO & IO
> resources for PCI devices & bridges. It can be used instead
> of the traditional PCI method of using BARs.
>
> EA entries are hardware-initialized to a fixed address.
> Unlike BARs, regions described by EA are cannot be moved.
> Because of this, only devices which are permanently connected to
> the PCI bus can use EA. A removable PCI card must not use EA.

As it is fixed, can you put IORESOURCE_PCI_FIXED in the res->flags?

Thanks

Yinghai
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1231789 — Re: [PATCH v2 0/2] PCI: Add support for PCI Enhanced Allocation "BARs"

From"Sean O. Stalley" <sean.stalley@intel.com>
Date2015-09-24 02:00 +0200
SubjectRe: [PATCH v2 0/2] PCI: Add support for PCI Enhanced Allocation "BARs"
Message-ID<qc278-2Nv-5@gated-at.bofh.it>
In reply to#1231783
On Wed, Sep 23, 2015 at 04:26:56PM -0700, Yinghai Lu wrote:
> On Wed, Sep 23, 2015 at 3:27 PM, Sean O. Stalley <sean.stalley@intel.com> wrote:
> > PCI Enhanced Allocation is a new method of allocating MMIO & IO
> > resources for PCI devices & bridges. It can be used instead
> > of the traditional PCI method of using BARs.
> >
> > EA entries are hardware-initialized to a fixed address.
> > Unlike BARs, regions described by EA are cannot be moved.
> > Because of this, only devices which are permanently connected to
> > the PCI bus can use EA. A removable PCI card must not use EA.
> 
> As it is fixed, can you put IORESOURCE_PCI_FIXED in the res->flags?
> 
> Thanks
> 
> Yinghai

IORESOURCE_PCI_FIXED is set in pci_ea_set_flags():
 
	+static unsigned long pci_ea_set_flags(struct pci_dev *dev, u8 prop)
	+{
	+	unsigned long flags = IORESOURCE_PCI_FIXED;
	+
	+

Which is called in pci_ea_read(), and passed to res->flags (if there aren't any errors):

	+
	+	/* Try to use primary properties, otherwise fall back to secondary */
	+	flags = pci_ea_set_flags(dev, PCI_EA_PP(dw0));
	+	if (!flags)
	+		flags = pci_ea_set_flags(dev, PCI_EA_SP(dw0));
	+

	...

	+	res->flags = flags;


-Sean
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1231794

FromYinghai Lu <yinghai@kernel.org>
Date2015-09-24 02:30 +0200
Message-ID<qc2Aa-3AM-5@gated-at.bofh.it>
In reply to#1231789
On Wed, Sep 23, 2015 at 4:51 PM, Sean O. Stalley <sean.stalley@intel.com> wrote:
> IORESOURCE_PCI_FIXED is set in pci_ea_set_flags():
>
>         +static unsigned long pci_ea_set_flags(struct pci_dev *dev, u8 prop)
>         +{
>         +       unsigned long flags = IORESOURCE_PCI_FIXED;
>         +
>         +
>
> Which is called in pci_ea_read(), and passed to res->flags (if there aren't any errors):

ok.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1231796

FromDavid Daney <ddaney.cavm@gmail.com>
Date2015-09-24 02:40 +0200
Message-ID<qc2JQ-3Mq-3@gated-at.bofh.it>
In reply to#1231772
Hi Sean,

Thanks for doing this, I think we will use it for Cavium ThunderX.  A 
couple of questions...


On 09/23/2015 03:27 PM, Sean O. Stalley wrote:
> PCI Enhanced Allocation is a new method of allocating MMIO & IO
> resources for PCI devices & bridges. It can be used instead
> of the traditional PCI method of using BARs.
>
> EA entries are hardware-initialized to a fixed address.
> Unlike BARs, regions described by EA are cannot be moved.
> Because of this, only devices which are permanently connected to
> the PCI bus can use EA. A removable PCI card must not use EA.
>
> This patchset adds support for using EA entries instead of BARs
> on Root Complex Integrated Endpoints.
>
> The Enhanced Allocation ECN is publicly available here:
> https://www.pcisig.com/specifications/conventional/ECN_Enhanced_Allocation_23_Oct_2014_Final.pdf
>
>
> Changes from V1:
> 	- Use generic PCI resource claim functions (instead of EA-specific functions)
> 	- Only add support for RCiEPs (instead of all devices).

Why not all devices?  The spec. allows for EA on devices behind bridges.


> 	- Removed some debugging messages leftover from early testing.
>
>
> Sean O. Stalley (2):
>    PCI: Add Enhanced Allocation register entries
>    PCI: Add support for Enhanced Allocation devices
>
>   drivers/pci/pci.c             | 174 ++++++++++++++++++++++++++++++++++++++++++
>   drivers/pci/pci.h             |   1 +
>   drivers/pci/probe.c           |   3 +
>   include/uapi/linux/pci_regs.h |  40 +++++++++-
>   4 files changed, 217 insertions(+), 1 deletion(-)
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1232250 — Re: [PATCH v2 0/2] PCI: Add support for PCI Enhanced Allocation "BARs"

From"Sean O. Stalley" <sean.stalley@intel.com>
Date2015-09-24 18:50 +0200
SubjectRe: [PATCH v2 0/2] PCI: Add support for PCI Enhanced Allocation "BARs"
Message-ID<qchSz-gB-33@gated-at.bofh.it>
In reply to#1231796
Hi David,

My response is inline. Let me know if you have any questions.

Thanks for taking a look,
Sean

On Wed, Sep 23, 2015 at 05:34:13PM -0700, David Daney wrote:
> Hi Sean,
> 
> Thanks for doing this, I think we will use it for Cavium ThunderX.
> A couple of questions...
> 
> 
> On 09/23/2015 03:27 PM, Sean O. Stalley wrote:
> >PCI Enhanced Allocation is a new method of allocating MMIO & IO
> >resources for PCI devices & bridges. It can be used instead
> >of the traditional PCI method of using BARs.
> >
> >EA entries are hardware-initialized to a fixed address.
> >Unlike BARs, regions described by EA are cannot be moved.
> >Because of this, only devices which are permanently connected to
> >the PCI bus can use EA. A removable PCI card must not use EA.
> >
> >This patchset adds support for using EA entries instead of BARs
> >on Root Complex Integrated Endpoints.
> >
> >The Enhanced Allocation ECN is publicly available here:
> >https://www.pcisig.com/specifications/conventional/ECN_Enhanced_Allocation_23_Oct_2014_Final.pdf
> >
> >
> >Changes from V1:
> >	- Use generic PCI resource claim functions (instead of EA-specific functions)
> >	- Only add support for RCiEPs (instead of all devices).
> 
> Why not all devices?  The spec. allows for EA on devices behind bridges.

The short answer is that adding support for EA bridges would be a much larger change.
EA bridges can do some weird stuff, like fixing bus numbers & using resources not in the base+limit window.

See the conversation I had with Bjorn on the original patchset for the details.
[ https://lkml.org/lkml/2015/9/3/497 ]

> >	- Removed some debugging messages leftover from early testing.
> >
> >
> >Sean O. Stalley (2):
> >   PCI: Add Enhanced Allocation register entries
> >   PCI: Add support for Enhanced Allocation devices
> >
> >  drivers/pci/pci.c             | 174 ++++++++++++++++++++++++++++++++++++++++++
> >  drivers/pci/pci.h             |   1 +
> >  drivers/pci/probe.c           |   3 +
> >  include/uapi/linux/pci_regs.h |  40 +++++++++-
> >  4 files changed, 217 insertions(+), 1 deletion(-)
> >
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web