From: Thierry Reding <thierry.reding@gmail.com>
To: vidya sagar <sagar.tv@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
Jonathan Hunter <jonathanh@nvidia.com>,
linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org
Subject: Re: [PATCH] PCI: tegra: Use different MSI target address for Tegra20
Date: Thu, 28 Sep 2017 16:19:12 +0200 [thread overview]
Message-ID: <20170928141912.GB28022@ulmo> (raw)
In-Reply-To: <CAN7O0+JyG3XT5SsWGsiZs0vrk0ha1vQ5N7rjYxs3tM_NvdONdw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2811 bytes --]
On Mon, Sep 25, 2017 at 10:44:29AM +0530, vidya sagar wrote:
> Inline...
>
> On Sat, Sep 23, 2017 at 11:47 AM, Thierry Reding
> <thierry.reding@gmail.com> wrote:
> >
> > The Tegra20 PCIe controller has a different address range for MSI, so
> > select a different target address.
> >
> > Fixes: d7bd554f27c9 ("PCI: tegra: Do not allocate MSI target memory")
> > Signed-off-by: Thierry Reding <treding@nvidia.com>
> > ---
> > drivers/pci/host/pci-tegra.c | 12 +++++++++++-
> > 1 file changed, 11 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
> > index e8e1ddbaabc9..5b02ea59524b 100644
> > --- a/drivers/pci/host/pci-tegra.c
> > +++ b/drivers/pci/host/pci-tegra.c
> > @@ -1563,8 +1563,18 @@ static int tegra_pcie_enable_msi(struct tegra_pcie *pcie)
> > * none of the Tegra SoCs that contain this PCI host bridge can
> > * address more than 16 GiB of system memory, the last 4 KiB of
> > * these 1012 GiB is a good candidate.
> > + *
> > + * Unfortunately, Tegra20 is slightly different in that the physical
> > + * address for this MSI region is limited to the lower 32 bits of the
> > + * address map, so the address that we pick is going to have to be
> > + * located somewhere within the region addressable by the CPU and
> > + * on-SoC controllers. To be on the safe side, we select an address
> > + * from a region that is marked unused (0xf0010000 - 0xfffeffff).
> > */
> > - msi->phys = 0xfcfffff000;
> > + if (soc->msi_base_shift > 0)
> > + msi->phys = 0xfcfffff000;
> > + else
> > + msi->phys = 0x00f0010000;
>
> Can we use this for later Tegra chip versions as well?
> Reason being, if an end point's config space says that it cannot
> support >32-bit MSI addresses (Marvel SATA controller being one
> example), with the current code, we still allocate an address of
> >32-bits, resulting in end point not being able to generate MSI
> interrupt (as it discards >32-bits where generating upstream memory
> write transaction for MSI)
Looks like the universal fix for this may not be trivial, so perhaps in
the meantime this one could go in in order to restore MSI for TrimSlice
(and other Tegra20 boards)?
Bjorn: do you have any objections to taking this into v4.13 via a stable
backport? 32-bit only MSI were never guaranteed to work because prior to
this patch the address was taken from an allocated page, which may or
may not have been > 4 GiB.
We could then go and fix 32-bit MSI hopefully in time for 4.14, but it'd
be a shame if v4.13 keeps being broken just because we're trying to
settle on the right solution for 32-bit MSI.
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2017-09-28 14:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-23 6:17 [PATCH] PCI: tegra: Use different MSI target address for Tegra20 Thierry Reding
2017-09-25 5:14 ` vidya sagar
2017-09-25 8:51 ` Thierry Reding
2017-09-28 14:19 ` Thierry Reding [this message]
2017-09-29 2:57 ` Bjorn Helgaas
2017-09-29 7:22 ` Thierry Reding
2017-10-02 20:19 ` Bjorn Helgaas
2017-10-09 10:29 ` [PATCH] Revert "PCI: tegra: Do not allocate MSI target memory" Thierry Reding
2017-10-11 0:09 ` Bjorn Helgaas
2017-10-09 17:43 ` [PATCH] PCI: tegra: Use different MSI target address for Tegra20 vidya sagar
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=20170928141912.GB28022@ulmo \
--to=thierry.reding@gmail.com \
--cc=bhelgaas@google.com \
--cc=jonathanh@nvidia.com \
--cc=linux-pci@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=sagar.tv@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: 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).