From: Jayachandran C <jnair@caviumnetworks.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: linux-pci@vger.kernel.org, iommu@lists.linux-foundation.org,
Robin Murphy <robin.murphy@arm.com>, Jon Masters <jcm@redhat.com>,
linux-arm-kernel@lists.infradead.org,
Joerg Roedel <joro@8bytes.org>
Subject: Re: [PATCH v5 2/2] PCI: quirks: Fix ThunderX2 dma alias handling
Date: Fri, 14 Apr 2017 21:06:46 +0000 [thread overview]
Message-ID: <20170414210646.GA5346@localhost> (raw)
In-Reply-To: <20170414001911.GA13163@bhelgaas-glaptop.roam.corp.google.com>
On Thu, Apr 13, 2017 at 07:19:11PM -0500, Bjorn Helgaas wrote:
> I tentatively applied both patches to pci/host-thunder for v4.12.
>
> However, I am concerned about the topology here:
>
> On Thu, Apr 13, 2017 at 08:30:45PM +0000, Jayachandran C wrote:
> > On Cavium ThunderX2 arm64 SoCs (called Broadcom Vulcan earlier), the
> > PCI topology is slightly unusual. For a multi-node system, it looks
> > like:
> >
> > 00:00.0 [PCI] bridge to [bus 01-1e]
> > 01:0a.0 [PCI-PCIe bridge, type 8] bridge to [bus 02-04]
> > 02:00.0 [PCIe root port, type 4] bridge to [bus 03-04] (XLATE_ROOT)
> > 03:00.0 PCIe Endpoint
>
> A root port normally has a single PCIe link leading downstream.
> According to this, 02:00.0 is a root port that has the usual
> downstream link leading to 03:00.0, but it also has an upstream link
> to 01:0a.0.
The PCI topology is a bit broken due to the way that the PCIe IP block
was integrated into SoC PCI bridges and devices. The current mechanism
of adding a PCI-PCIe bridge to glue these together is not ideal.
> Maybe this example is omitting details that are not relevant to DMA
> aliases? The PCIe capability only contains one set of link-related
> registers, so I don't know how we could manage a single device that
> has two links.
The root port is standard and has just one link to the EP (or whatever
is on the external PCIe slot). The fallout of the current hw design is
that the PCI-PCIe bridge has a link that does not follow standard and
does not have a counterpart (as you noted).
> A device with two links would break things like ASPM. In
> set_pcie_port_type(), for example, we have this comment:
>
> * A Root Port or a PCI-to-PCIe bridge is always the upstream end
> * of a Link. No PCIe component has two Links. Two Links are
> * connected by a Switch that has a Port on each Link and internal
> * logic to connect the two Ports.
>
> The topology above breaks these assumptions, which will make
> pdev->has_secondary_link incorrect, which means ASPM won't work
> correctly.
Given the current hardware, the pcieport driver seems to work reasonably
for the root port at 02:00.0, with AER support. I will take a look at the
ASPM part.
Thanks,
JC.
next prev parent reply other threads:[~2017-04-14 21:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-13 20:30 [PATCH v5 0/2] Handle Cavium ThunderX2 PCI topology quirk Jayachandran C
2017-04-13 20:30 ` [PATCH v5 1/2] PCI: Add device flag PCI_DEV_FLAGS_BRIDGE_XLATE_ROOT Jayachandran C
2017-04-13 20:30 ` [PATCH v5 2/2] PCI: quirks: Fix ThunderX2 dma alias handling Jayachandran C
2017-04-14 0:19 ` Bjorn Helgaas
2017-04-14 21:06 ` Jayachandran C [this message]
2017-04-15 2:00 ` Bjorn Helgaas
2017-04-17 17:47 ` Jayachandran C
2017-04-17 19:51 ` Bjorn Helgaas
2017-04-21 15:48 ` Bjorn Helgaas
2017-04-21 17:05 ` Jayachandran C
2017-04-21 17:57 ` Bjorn Helgaas
2017-04-25 13:03 ` Jayachandran C
2017-04-25 13:37 ` Bjorn Helgaas
2017-04-19 23:38 ` Jon Masters
2017-04-20 0:25 ` Jon Masters
2017-04-20 13:20 ` Bjorn Helgaas
2017-04-20 15:12 ` Jon Masters
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=20170414210646.GA5346@localhost \
--to=jnair@caviumnetworks.com \
--cc=helgaas@kernel.org \
--cc=iommu@lists.linux-foundation.org \
--cc=jcm@redhat.com \
--cc=joro@8bytes.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pci@vger.kernel.org \
--cc=robin.murphy@arm.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).