All of lore.kernel.org
 help / color / mirror / Atom feed
From: jgunthorpe@obsidianresearch.com (Jason Gunthorpe)
To: linux-arm-kernel@lists.infradead.org
Subject: Intel I350 mini-PCIe card (igb) on Mirabox (mvebu / Armada 370)
Date: Mon, 7 Apr 2014 14:48:17 -0600	[thread overview]
Message-ID: <20140407204817.GB20736@obsidianresearch.com> (raw)
In-Reply-To: <CAAfodu0kbTspq2QQf0dh3U7LB-q+ECaX9FJ35fCc25UmgPJZSg@mail.gmail.com>

On Mon, Apr 07, 2014 at 08:41:52PM +0100, Neil Greatorex wrote:
> > To be very clear, PCI BARs, should never overlap.
> 
> I realise that overlap was probably the wrong word. I meant that the
> resources for 01:00.0 and 01:00.1 are not contiguous but are mixed
> together. If you sort by address you get:
> 
> e0000000-e007ffff : 0000:01:00.0
> e0080000-e00fffff : 0000:01:00.0
> e0100000-e017ffff : 0000:01:00.1
> e0180000-e01fffff : 0000:01:00.1
> e0200000-e0203fff : 0000:01:00.0
> e0204000-e0223fff : 0000:01:00.0
> e0224000-e0243fff : 0000:01:00.0
> e0244000-e0247fff : 0000:01:00.1
> e0248000-e0267fff : 0000:01:00.1
> e0268000-e0287fff : 0000:01:00.1

Yes, that is fine. It is just a quirk of the allocator.
They are all within the downstream bridge window. 
 
> > HOWEVER, looking now very closely:
> >
> > 00:01.0 PCI bridge: Marvell Technology Group Ltd. Device 6710 (rev 01) (prog-if 00 [Normal decode])
> >    Memory behind bridge: e0000000-e02fffff
> > 00:02.0 PCI bridge: Marvell Technology Group Ltd. Device 6710 (rev 01) (prog-if 00 [Normal decode])
> >    Memory behind bridge: e0300000-e03fffff
> >
> > This is certainly wrong, MBUS requires special alignment and sizing.
> > 0x300000 is not a size which is a power of two, and the next window
> > starts right after.

> Interesting. Does the PCI code provide a way to specify that the sizes
> much be a power of 2? I don't fully understand the implications but
> would it be possible to assign just one MBUS window for the whole of
> the PCIe memory instead?

I know this has come up before, but I don't recall where things
settled out.. mvebu_pcie_align_resource is the function to look at,
the size at that point needs to be rounded up to a power of two and
communicated back to the caller.

Alternately, I belive Thomas once discussed using multiple mbus
windows for these non-aligned requests.

> > Just to confirm, what does something like the below say for you guys?
> 
> See https://gist.github.com/ngreatorex/10025253 for the dmesg output.
> I have also included the contents of
> /sys/kernel/debug/mvebu-mbus/devices both before and after the
> modprobe / oops. As you can see I get a total of 3 WARNINGs - one at
> boot for the xHCI controller, and two when inserting igb.ko. Note that
> this time I did this with both ports enabled.

Yep, that is certainly the root problem - most likely for
everyone. This also explains why Will saw success when he reverted
that unrelated patch. That change altered the allocation pattern of
the BARs and it just so happened to make things fall out properly.

We should also fix mvebu_mbus_read_window, so debugfs reports the
actual HW function. Instead of this:
        *size = (ctrlreg | ~WIN_CTRL_SIZE_MASK) + 1;

Something with ffs is required, perhaps (untested):
        *size = 2 << ffs(~(ctrlreg | ~WIN_CTRL_SIZE_MASK));

Thomas: Do you think the WARN_ON should head into mainline?

Jason

  reply	other threads:[~2014-04-07 20:48 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-25 20:07 Intel I350 mini-PCIe card (igb) on Mirabox (mvebu / Armada 370) Neil Greatorex
2014-03-25 20:20 ` Thomas Petazzoni
2014-03-25 21:03   ` Willy Tarreau
2014-03-25 20:22 ` Jason Gunthorpe
2014-03-25 20:36   ` Thomas Petazzoni
2014-03-25 21:12     ` Jason Gunthorpe
2014-03-25 21:23       ` Thomas Petazzoni
2014-03-25 22:03     ` Neil Greatorex
2014-03-25 22:24       ` Jason Gunthorpe
2014-03-25 22:35         ` Jason Gunthorpe
2014-03-26 19:31           ` Neil Greatorex
2014-03-26 20:12             ` Jason Gunthorpe
2014-03-26 20:34               ` Neil Greatorex
2014-03-26 21:42                 ` Jason Gunthorpe
2014-03-26 21:52                   ` Thomas Petazzoni
2014-03-27  0:29                   ` Neil Greatorex
2014-03-27  4:40                     ` Jason Gunthorpe
2014-03-28  1:03                       ` Neil Greatorex
2014-03-28  2:04                         ` Jason Gunthorpe
2014-04-04 13:19                         ` Neil Greatorex
2014-04-05 17:32                           ` Willy Tarreau
2014-04-05 17:34                           ` Thomas Petazzoni
2014-04-05 18:04                             ` Willy Tarreau
2014-04-05 18:55                               ` Neil Greatorex
2014-04-05 19:03                                 ` Willy Tarreau
2014-04-05 19:00                             ` Neil Greatorex
2014-04-06 15:34                               ` Neil Greatorex
2014-04-06 17:43                                 ` Willy Tarreau
2014-04-08 15:13                                 ` Thomas Petazzoni
2014-04-08 15:40                                   ` Thomas Petazzoni
2014-04-08 15:55                                     ` Thomas Petazzoni
2014-04-08 16:02                                       ` Matthew Minter
2014-04-08 17:14                                       ` Jason Gunthorpe
2014-04-08 17:53                                         ` Willy Tarreau
2014-04-08 18:08                                           ` Jason Gunthorpe
2014-04-08 18:15                                             ` Thomas Petazzoni
2014-04-08 18:40                                               ` Jason Gunthorpe
2014-04-08 19:15                                             ` Willy Tarreau
2014-04-08 19:21                                               ` Jason Gunthorpe
2014-04-08 20:17                                                 ` Matthew Minter
2014-04-08 21:50                                                   ` Thomas Petazzoni
2014-04-08 20:19                                                 ` Neil Greatorex
2014-04-08 20:43                                                 ` Willy Tarreau
2014-04-08 18:01                                         ` Thomas Petazzoni
2014-04-08 18:22                                           ` Jason Gunthorpe
2014-04-08 18:32                                             ` Thomas Petazzoni
2014-04-08 15:53                                   ` Willy Tarreau
2014-04-08 16:00                                     ` Thomas Petazzoni
2014-04-08 16:05                                       ` Willy Tarreau
2014-04-06 18:58                           ` Willy Tarreau
2014-04-06 19:11                             ` Thomas Petazzoni
2014-04-06 21:57                             ` Neil Greatorex
2014-04-06 22:04                               ` Willy Tarreau
2014-04-06 22:16                               ` Thomas Petazzoni
2014-04-07  0:50                                 ` Neil Greatorex
2014-04-07 17:41                               ` Jason Gunthorpe
2014-04-07 19:41                                 ` Neil Greatorex
2014-04-07 20:48                                   ` Jason Gunthorpe [this message]
2014-04-07 21:58                                     ` Neil Greatorex
2014-04-08  6:28                                       ` Willy Tarreau
2014-04-08  6:40                                       ` Willy Tarreau
2014-04-08 10:53                                         ` Matthew Minter
2014-04-08 12:31                                           ` Matthew Minter
2014-04-08 12:36                                             ` Willy Tarreau
2014-04-08 14:43                                               ` Thomas Petazzoni
2014-04-08 14:52                                                 ` Matthew Minter
2014-04-08 14:53                                                 ` Willy Tarreau
2014-04-08 15:25                                                   ` Thomas Petazzoni
2014-04-08 17:56                                             ` Willy Tarreau

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=20140407204817.GB20736@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.