linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: jgunthorpe@obsidianresearch.com (Jason Gunthorpe)
To: linux-arm-kernel@lists.infradead.org
Subject: Armada XP (mvebu) PCIe memory (BAR/window) re-allocation
Date: Wed, 26 Mar 2014 11:18:28 -0600	[thread overview]
Message-ID: <20140326171828.GA31887@obsidianresearch.com> (raw)
In-Reply-To: <20140326180634.4ac266b2@skate>

On Wed, Mar 26, 2014 at 06:06:34PM +0100, Thomas Petazzoni wrote:

> Thanks for your report. I'm adding Jason Gunthorpe in Cc, as his
> insights are always very helpful when investigating PCIe issues on
> Marvell platforms.

To me, this looks like standard problems with hot plug - unrelated to
Marvell.

Actually supporting the full generality of hot plug requires someone
pre-allocate and reserve bridge window address space. On x86 the BIOS
knows which slots are hot plug capable and ensures that address space
is set aside for that slot when doing window assignment. Linux will
just keep the BIOS assignment and when the hot plug happens the extra
space is used.

What you seem to be seeing is that Linux does an optimal allocation at
boot, and the PCI-E switch port that connects to your hot plug slot is
not allocated any spare address space for a future device.

During rescan there is no free address space to assign to the new
device so everything blows up.

I know there are some provisions in the PCI core to solve this issue,
I know on x86 the BIOS plays a role, but I'm not familiar enough with
the details to give you an exact path to solve your problem, other
than to say, at first boot you need to arrange for there to be extra
address space available.

A really simple dumb hack that might work is to change the order of
the PCI-E ports on the Armada (I think you can do this through the
DT). What you want is to place the port connected to the PLX last.
The goal here is to have it do address assignment last, so it will get
the last chunk of address space, and will have room to grow into
unused space, instead of being blocked by another port.

Regards,
Jason

  reply	other threads:[~2014-03-26 17:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAFJTrDt7OrtE4B52419F2KGbmXeLR9NEcgF6yMTMUBe5vdKwfg@mail.gmail.com>
2014-03-26 17:06 ` Armada XP (mvebu) PCIe memory (BAR/window) re-allocation Thomas Petazzoni
2014-03-26 17:18   ` Jason Gunthorpe [this message]
2014-03-31 14:17     ` Matthew Minter
2014-04-01 16:41       ` Jason Gunthorpe
2014-04-03  9:31         ` Matthew Minter
     [not found]         ` <CAFJTrDu1=Hoa6NS3DaFphMUXgJYunybbdCoGiBVe1qKNQ4s3MA@mail.gmail.com>
2014-04-03 18:23           ` Jason Gunthorpe
2014-04-03 18:24             ` Thomas Petazzoni
2014-04-07 13:03               ` Matthew Minter
2014-04-07 16:45                 ` Jason Gunthorpe
2014-04-08 10:57                   ` Matthew Minter
2014-04-08 16:34                     ` Jason Gunthorpe
2014-04-03  8:57 Matthew Minter
  -- strict thread matches above, loose matches on Subject: below --
2014-03-26 16:54 Matthew Minter

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=20140326171828.GA31887@obsidianresearch.com \
    --to=jgunthorpe@obsidianresearch.com \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).