From: Niklas Cassel <cassel@kernel.org>
To: Manivannan Sadhasivam <mani@kernel.org>
Cc: "Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Thierry Reding" <thierry.reding@gmail.com>,
"Jonathan Hunter" <jonathanh@nvidia.com>,
"Vidya Sagar" <vidyas@nvidia.com>,
"Shin'ichiro Kawasaki" <shinichiro.kawasaki@wdc.com>,
linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org
Subject: Re: [PATCH] PCI: tegra194: Reset BARs when running in PCIe endpoint mode
Date: Mon, 22 Sep 2025 15:06:57 +0200 [thread overview]
Message-ID: <aNFJ8awYYwxb2o6B@ryzen> (raw)
In-Reply-To: <lrox3l5cafqsom3eier6n7wpbfatlic42rxs5q5utrhg4fekls@kj3b5ue7ggt7>
On Sat, Sep 20, 2025 at 09:04:01PM +0530, Manivannan Sadhasivam wrote:
> On Fri, Sep 19, 2025 at 03:16:47PM +0200, Niklas Cassel wrote:
> > Tegra already defines all BARs expect for BAR0 as BAR_RESERVED.
> > This is sufficient for pci-epf-test to not allocate backing memory and to
> > not call set_bar() for those BARs.
> >
> > However, the host side driver, pci_endpoint_test, simply does an ioremap
> > for all enabled BARs, and will run tests against all enabled BARs.
> >
> > After running the BARs tests (which will write to all enabled BARs), the
> > inbound address translation is broken.
> > This is because the tegra controller exposes the ATU Port Logic Structure
> > in BAR4. So when BAR4 is written, the inbound address translation settings
> > get overwritten.
> >
>
> BAR4 or BAR0?
BAR4.
Just because a BAR is marked as BAR_RESERVED does not mean that the BAR is
disabled. Hence this patch.
I can make this clearer in V2.
I think a better solution would be for pci-epf-test to actually do something
like call a .disable_bar() for BARs that are marked as BAR_RESERVED.
But, implementing this callback is non-trivial, especially for non-DWC based
drivers where we dont have an equivalent to dw_pcie_ep_reset_bar().
Thus, I chose to keep with the existing convention of calling
dw_pcie_ep_reset_bar() in the .init callback, like it is done for all other
DWC-based EPC drivers.
Kind regards,
Niklas
next prev parent reply other threads:[~2025-09-22 13:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-19 13:16 [PATCH] PCI: tegra194: Reset BARs when running in PCIe endpoint mode Niklas Cassel
2025-09-20 15:34 ` Manivannan Sadhasivam
2025-09-22 13:06 ` Niklas Cassel [this message]
2025-09-24 15:57 ` Manivannan Sadhasivam
2025-09-24 16:15 ` Manivannan Sadhasivam
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=aNFJ8awYYwxb2o6B@ryzen \
--to=cassel@kernel.org \
--cc=bhelgaas@google.com \
--cc=jonathanh@nvidia.com \
--cc=kwilczynski@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=robh@kernel.org \
--cc=shinichiro.kawasaki@wdc.com \
--cc=thierry.reding@gmail.com \
--cc=vidyas@nvidia.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