All of lore.kernel.org
 help / color / mirror / Atom feed
From: James R Taylor <jrtaylor11@gmail.com>
To: Geramy Loveless <gloveless@jqluv.com>
Cc: "Bjorn Helgaas" <bhelgaas@google.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH v3] PCI: Reserve prefetchable window headroom for Resizable BARs
Date: Sun, 15 Nov 2026 16:02:23 +0000	[thread overview]
Message-ID: <1794758543.190740.rebar.hermes@gmail.com> (raw)
In-Reply-To: <10fb16fb-2069-4d89-b473-1006ae5abfbc@jqluv.com>

Hi Geramy,

On Sat, Aug 29, 2026, Geramy Loveless wrote:
> Firmware typically sizes prefetchable bridge windows for the boot-time
> BAR size. Behind a fixed (non-hotplug) PCIe switch fabric, there is then
> no room for a driver to grow a Resizable BAR afterwards

I've been running v3 since 27 October on a different kind of fabric from
yours, a USB4/Thunderbolt eGPU, and it gives the GPU its full BAR there
too. In case the data point is useful:

  Host:  Minisforum UM890 Pro (AMD Ryzen 9 8945HS, Hawk Point),
         BIOS 1.06
  Dock:  Minisforum DEG2 (Intel JHL9480 Barlow Ridge TB5 switch) over
         USB4, link 2 x 10 Gb/s
  GPU:   Intel Arc B580 12 GB, xe driver
  Kernel: 7.3.4 with v3 applied (it applies cleanly)

The firmware gives the USB4 root port 0000:00:03.1 a 64 GiB prefetchable
window, but the tunnel is enumerated as a hotplug event about 12 seconds
after boot, and without the patch the switch windows below it were sized
at 256 MiB, so the B580's BAR2 stayed at 256 MiB and a manual resize
failed.

With v3 the headroom is reserved down the chain:

  pci 0000:6a:01.0: bridge window [mem 0x400000000-0x40fffffff 64bit pref] to [bus 6b] add_size 3f0000000 add_align 400000000
  pci 0000:69:00.0: bridge window [mem 0x400000000-0x7ffffffff 64bit pref] to [bus 6a-6c] add_size 3f0000000 add_align 400000000

and xe then resizes the BAR when it binds:

  xe 0000:6b:00.0: [drm] Attempting to resize bar from 256MiB -> 16384MiB
  xe 0000:6b:00.0: [drm] BAR2 resized to 16384MiB

Both bridges above the GPU (69:00.0 and 6a:01.0) end up with 16 GiB
prefetchable windows, and the whole 12 GB of VRAM is CPU-visible. It has
been stable as a daily VAAPI/compute card since then. On 31 October I
also unplugged and re-plugged the dock while the system was running: it
re-enumerated, xe re-bound and BAR2 came back at 16 GiB.

One interaction that may be worth knowing about: with
pci=hpmmioprefsize=16G also on the command line, the TB5 switch's three
empty downstream (daisy-chain) ports each reserved 16 GiB as well. That
overflowed the 64 GiB root-port window, and the B580's BAR2 was briefly
assigned at 16 GiB and then rolled back with -ENOSPC. Without that
parameter it works as described above.

Tested-by: James R Taylor <jrtaylor11@gmail.com>

Thanks for the patch,
James


      parent reply	other threads:[~2026-11-15 16:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-29  0:43 [PATCH v3] PCI: Reserve prefetchable window headroom for Resizable BARs Geramy Loveless
2026-08-29  0:56 ` sashiko-bot
2026-11-15 16:02 ` James R Taylor [this message]

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=1794758543.190740.rebar.hermes@gmail.com \
    --to=jrtaylor11@gmail.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=bhelgaas@google.com \
    --cc=gloveless@jqluv.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.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 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.