linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Duc Dang <dhdang@apm.com>
Cc: Jon Masters <jcm@redhat.com>, Mark Salter <msalter@redhat.com>,
	Rafael Wysocki <rafael@kernel.org>,
	Lorenzo Pieralisi <Lorenzo.Pieralisi@arm.com>,
	Arnd Bergmann <arnd@arndb.de>,
	linux-pci@vger.kernel.org,
	linux-arm <linux-arm-kernel@lists.infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Tomasz Nowicki <tn@semihalf.com>, patches <patches@apm.com>
Subject: Re: [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller
Date: Mon, 5 Dec 2016 15:20:12 -0600	[thread overview]
Message-ID: <20161205212012.GA22455@bhelgaas-glaptop.roam.corp.google.com> (raw)
In-Reply-To: <CADaLNDk-cMW8k+bXqH3+yYCye_kHf6RXUYQ=eCCZ4FF2ZTjgkQ@mail.gmail.com>

On Fri, Dec 02, 2016 at 11:06:30PM -0800, Duc Dang wrote:
> On Fri, Dec 2, 2016 at 3:39 PM, Bjorn Helgaas <helgaas@kernel.org> wrote:

> > diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c
> > index 8a177a1..a16fc8e 100644
> > --- a/arch/arm64/kernel/pci.c
> > +++ b/arch/arm64/kernel/pci.c
> > @@ -114,6 +114,19 @@ int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
> >         return 0;
> >  }
> >
> > +static int pci_acpi_root_prepare_resources(struct acpi_pci_root_info *ci)
> > +{
> > +       struct resource_entry *entry, *tmp;
> > +       int status;
> > +
> > +       status = acpi_pci_probe_root_resources(ci);
> > +       resource_list_for_each_entry_safe(entry, tmp, &ci->resources) {
> > +               if (!(entry->res->flags & IORESOURCE_WINDOW))
> > +                       resource_list_destroy_entry(entry);
> > +       }
> > +       return status;
> > +}
> > +
> >  /*
> >   * Lookup the bus range for the domain in MCFG, and set up config space
> >   * mapping.
> > @@ -190,6 +203,7 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
> >         }
> >
> >         root_ops->release_info = pci_acpi_generic_release_info;
> > +       root_ops->prepare_resources = pci_acpi_root_prepare_resources;
> >         root_ops->pci_ops = &ri->cfg->ops->pci_ops;
> >         bus = acpi_pci_root_create(root, root_ops, &ri->common, ri->cfg);
> >         if (!bus)
> 
> I tried your patch above with my X-Gene ECAM v4 patch on Mustang, here
> is the kernel boot log and output of 'cat /proc/iomem'. The PCIe core
> does not print the MMIO space as a window (which is expected per your
> patch above).

Thanks!

> ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
> acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI]
> acpi PNP0A08:00: _OSC: OS now controls [PCIeHotplug PME AER PCIeCapability]
> acpi PNP0A08:00: MCFG quirk: ECAM at [mem 0xe0d0000000-0xe0dfffffff] for [bus 00-ff] with xgene_v1_pcie_ecam_ops
> acpi PNP0A08:00: [Firmware Bug]: ECAM area [mem 0xe0d0000000-0xe0dfffffff] not reserved in ACPI namespace
> acpi PNP0A08:00: ECAM at [mem 0xe0d0000000-0xe0dfffffff] for [bus 00-ff]
> Remapped I/O 0x000000e010000000 to [io  0x0000-0xffff window]
> PCI host bridge to bus 0000:00
> pci_bus 0000:00: root bus resource [io  0x0000-0xffff window] (bus address [0x10000000-0x1000ffff])
> pci_bus 0000:00: root bus resource [mem 0xe040000000-0xe07fffffff window] (bus address [0x40000000-0x7fffffff])
> pci_bus 0000:00: root bus resource [mem 0xf000000000-0xffffffffff window]
> pci_bus 0000:00: root bus resource [bus 00-ff]

Yup, no bridge register space here; that's good.  I assume the bridge
registers are at [mem 0x1f2b0000-0x1f2bffff] as shown in /proc/iomem
below.

> [root@(none) ~]# cat /proc/io mem
> ...
> 19000000-19007fff : 808622B7:00
> 1900c100-190fffff : 808622B7:00
>   1900c100-190fffff : 808622B7:00
> 19800000-19807fff : 808622B7:01
> 1980c100-198fffff : 808622B7:01
>   1980c100-198fffff : 808622B7:01
> ...
> 1f280000-1f28ffff : 808622B7:00
> 1f290000-1f29ffff : 808622B7:01

I'm curious what these "808622B7" devices are.  Per ACPI 6.0, sec
6.1.5, that looks like a PCI vendor ID, which I guess is a valid ACPI
ID.  But these resources don't seem to have any connection with PCI
(they're not in any of the host bridge apertures).

> 1f2b0000-1f2bffff : PNP0A08:00

Looks like the bridge register space; good.

> e040000000-e07fffffff : PCI Bus 0000:00
>   e040000000-e0401fffff : PCI Bus 0000:01
>     e040000000-e0400fffff : 0000:01:00.0
>       e040000000-e0400fffff : mlx4_core
>     e040100000-e0401fffff : 0000:01:00.0

> e0d0000000-e0dfffffff : PCI ECAM

This region should be described in either a PNP0C02 device or (if we
decide we can allow "consumer" descriptors) the PNP0A08 device.  I
assume you'll fix that in a future firmware release.

But I think this reservation from pci_ecam_create() is good enough for
now.

> f000000000-ffffffffff : PCI Bus 0000:00
>   f000000000-f001ffffff : PCI Bus 0000:01
>     f000000000-f001ffffff : 0000:01:00.0
>       f000000000-f001ffffff : mlx4_core

  reply	other threads:[~2016-12-05 21:20 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-30 23:42 [PATCH v3] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller Duc Dang
2016-12-01 15:08 ` Mark Salter
2016-12-01 19:17   ` Jon Masters
2016-12-01 19:58     ` Duc Dang
2016-12-01 18:33 ` Bjorn Helgaas
2016-12-01 19:20   ` Mark Salter
2016-12-01 19:26     ` Jon Masters
2016-12-01 19:41     ` Bjorn Helgaas
2016-12-01 22:10       ` Duc Dang
2016-12-01 22:31         ` Jon Masters
2016-12-01 23:07         ` Bjorn Helgaas
2016-12-01 23:22           ` Duc Dang
2016-12-02  4:08             ` Jon Masters
2016-12-02  6:31               ` Jon Masters
2016-12-02  7:34                 ` Duc Dang
2016-12-02  8:08                   ` Jon Masters
2016-12-02 23:39               ` Bjorn Helgaas
2016-12-03  0:33                 ` Jon Masters
2016-12-05 21:21                   ` Bjorn Helgaas
2016-12-06 19:46                     ` Jon Masters
2016-12-06 20:18                       ` Bjorn Helgaas
2016-12-06 20:23                         ` Jon Masters
2016-12-13 21:35                         ` Jon Masters
2016-12-03  7:06                 ` Duc Dang
2016-12-05 21:20                   ` Bjorn Helgaas [this message]
2016-12-05 21:40                     ` Duc Dang
2016-12-05 23:31                     ` Jon Masters
2016-12-02  2:27   ` [PATCH v4 1/1] " Duc Dang
2016-12-02  7:12     ` Jon Masters
2016-12-02  7:36       ` Duc Dang
2016-12-02  8:11         ` Jon Masters
2016-12-02 19:39           ` Duc Dang
2016-12-02 19:59             ` Jon Masters
2016-12-03 10:06             ` [SPCR] mmio32 iotype access requirements for X-Gene 8250(_dw) UART Jon Masters
2016-12-03 17:11               ` Graeme Gregory
2016-12-03 17:15               ` Mark Salter
2016-12-03 20:33                 ` Jon Masters
2016-12-04 10:35                   ` Duc Dang
2016-12-02 11:36     ` [PATCH v4 1/1] PCI/ACPI: xgene: Add ECAM quirk for X-Gene PCIe controller Graeme Gregory
2016-12-02  2:52   ` [PATCH v3] " Duc Dang
2016-12-05 21:53     ` Bjorn Helgaas
2016-12-05 22:09       ` Duc Dang

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=20161205212012.GA22455@bhelgaas-glaptop.roam.corp.google.com \
    --to=helgaas@kernel.org \
    --cc=Lorenzo.Pieralisi@arm.com \
    --cc=arnd@arndb.de \
    --cc=dhdang@apm.com \
    --cc=jcm@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=msalter@redhat.com \
    --cc=patches@apm.com \
    --cc=rafael@kernel.org \
    --cc=tn@semihalf.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: 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).