public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
From: "Marek Behún" <kabel@kernel.org>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	linux-pci@vger.kernel.org, pali@kernel.org
Subject: Re: [PATCH pci-fixes 2/2] Revert "PCI: aardvark: Fix support for PCI_ROM_ADDRESS1 on emulated bridge"
Date: Wed, 1 Dec 2021 10:50:45 +0100	[thread overview]
Message-ID: <20211201105045.41228d82@thinkpad> (raw)
In-Reply-To: <20211201015308.GA2791148@bhelgaas>

On Tue, 30 Nov 2021 19:53:08 -0600
Bjorn Helgaas <helgaas@kernel.org> wrote:

> On Tue, Nov 30, 2021 at 11:29:37AM +0000, Lorenzo Pieralisi wrote:
> > On Thu, Nov 25, 2021 at 05:01:48PM +0100, Marek Behún wrote:  
> > > This reverts commit 239edf686c14a9ff926dec2f350289ed7adfefe2.
> > > 
> > > PCI Bridge which represents aardvark's PCIe Root Port has Expansion ROM
> > > Base Address register at offset 0x30, but its meaning is different than
> > > PCI's Expansion ROM BAR register, although the layout is the same.
> > > (This is why we thought it does the same thing.)
> > > 
> > > First: there is no ROM (or part of BootROM) in the A3720 SOC dedicated
> > > for PCIe Root Port (or controller in RC mode) containing executable code
> > > that would initialize the Root Port, suitable for execution in
> > > bootloader (this is how Expansion ROM BAR is used on x86).
> > > 
> > > Second: in A3720 spec the register (address D0070030) is not documented
> > > at all for Root Complex mode, but similar to other BAR registers, it has
> > > an "entangled partner" in register D0075920, which does address
> > > translation for the BAR in D0070030:
> > > - the BAR register sets the address from the view of PCIe bus
> > > - the translation register sets the address from the view of the CPU
> > > 
> > > The other BAR registers also have this entangled partner, and they
> > > can be used to:
> > > - in RC mode: address-checking on the receive side of the RC (they
> > >   can define address ranges for memory accesses from remote Endpoints
> > >   to the RC)
> > > - in Endpoint mode: allow the remote CPU to access memory on A3720
> > > 
> > > The Expansion ROM BAR has only the Endpoint part documented, but from
> > > the similarities we think that it can also be used in RC mode in that
> > > way.
> > > 
> > > So either Expansion ROM BAR has different meaning (if the hypothesis
> > > above is true), or we don't know it's meaning (since it is not
> > > documented for RC mode).
> > > 
> > > Remove the register from the emulated bridge accessing functions.
> > > 
> > > Fixes: 239edf686c14 ("PCI: aardvark: Fix support for PCI_ROM_ADDRESS1 on emulated bridge")
> > > Signed-off-by: Marek Behún <kabel@kernel.org>
> > > ---
> > >  drivers/pci/controller/pci-aardvark.c | 9 ---------
> > >  1 file changed, 9 deletions(-)  
> > 
> > Bjorn,
> > 
> > this reverts a commit we merged the last merge window so it is
> > a candidate for one of the upcoming -rcX.  
> 
> Sure, happy to apply the revert.
> 
> What problem does the revert fix?  I assume 239edf686c14 ("PCI:
> aardvark: Fix support for PCI_ROM_ADDRESS1 on emulated bridge") broke
> something, but the commit log for the revert doesn't say *what*.  How
> would one notice that something broke?

Hello Bjorn,

It doesn't break any real functionality that I know of, although it
might, since the register is read pci/probe.c pci_setup_device()
(pci_read_bases()).

But allowing the access to the register when it has different meaning
is wrong in a similar sense that a memory leak is wrong (a memory leak
also does not necessarily cause real problems, if it is small, but
still we should fix it).

Marek

  reply	other threads:[~2021-12-01  9:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-25 16:01 [PATCH pci-fixes 0/2] PCI Aardvark controller fixes Marek Behún
2021-11-25 16:01 ` [PATCH pci-fixes 1/2] PCI: aardvark: Fix checking for MEM resource type Marek Behún
2021-11-25 16:01 ` [PATCH pci-fixes 2/2] Revert "PCI: aardvark: Fix support for PCI_ROM_ADDRESS1 on emulated bridge" Marek Behún
2021-11-30 11:29   ` Lorenzo Pieralisi
2021-12-01  1:53     ` Bjorn Helgaas
2021-12-01  9:50       ` Marek Behún [this message]
2021-12-01 12:35         ` Bjorn Helgaas
2021-12-01 17:23           ` Marek Behún
2021-12-01 18:01             ` Bjorn Helgaas
2021-11-30 11:43   ` Pali Rohár
2021-12-02 16:09   ` Bjorn Helgaas
2021-12-06 10:18 ` (subset) [PATCH pci-fixes 0/2] PCI Aardvark controller fixes Lorenzo Pieralisi

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=20211201105045.41228d82@thinkpad \
    --to=kabel@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=helgaas@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=pali@kernel.org \
    /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