Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Mario Limonciello <mario.limonciello@amd.com>
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	stuck-tamer-growl@duck.com, "Sanath S" <Sanath.S@amd.com>,
	"Bjorn Helgaas" <helgaas@kernel.org>,
	"bjorn@helgaas.com" <bjorn@helgaas.com>,
	"Linux PCI" <linux-pci@vger.kernel.org>
Subject: Re: Fwd: [Bug 221457] New: PCI core drops Resizable BAR sizing after ASPM common-clock reconfiguration on Thunderbolt/USB4 hot-plug link
Date: Wed, 6 May 2026 16:44:35 +0200	[thread overview]
Message-ID: <20260506144435.GM6785@black.igk.intel.com> (raw)
In-Reply-To: <6651652a-cab6-4791-a883-2e7de8a009f5@amd.com>

Hi,

On Wed, May 06, 2026 at 08:07:26AM -0500, Mario Limonciello wrote:
> 
> 
> On 5/6/26 07:38, Mika Westerberg wrote:
> > Hi,
> > 
> > On Wed, May 06, 2026 at 03:26:43PM +0300, Ilpo Järvinen wrote:
> > > On Wed, 6 May 2026, stuck-tamer-growl@duck.com wrote:
> > > 
> > > > Bjorn and All,
> > > > 
> > > > Attached
> > > > 
> > > > pristine.dmesg.txt and pristine.lspci-vv.txt
> > > > cmdline "quiet splash", same kernel/hardware as the report.
> > > > Many thanks!
> > > > 
> > > > Peter / stuck-tamer-growl
> > > > 
> > > > 
> > > > 
> > > > On Monday, May 4th, 2026 at 2:43 PM, Bjorn Helgaas <helgaas_at_kernel.org_stuck-tamer-growl@duck.com> wrote:
> > > > 
> > > > > [+bcc reporter]
> > > > > 
> > > > > On Mon, May 04, 2026 at 01:29:28PM -0500, Bjorn Helgaas wrote:
> > > > > > ---------- Forwarded message ---------
> > > > > > https://bugzilla.kernel.org/show_bug.cgi?id=221457
> > > > > > ...
> > > > > > SUMMARY
> > > > > > 
> > > > > > Initial PCI enumeration assigns BAR 1 = 16 GB on an RTX 5060 Ti behind a
> > > > > > Thunderbolt 4 link. Shortly after, the pcieport ASPM service runs a
> > > > > > common-clock reconfigure on the host root port, the downstream bridges go
> > > > > > through [bus 00-00] reset and re-enumeration, and BAR 1 is reassigned at 256
> > > > > > MB.
> > > > > 
> > > > > stuck-tamer-growl: Thanks for the report.  Would you mind collect the
> > > > > complete dmesg log and the output of "sudo lspci -vv" and posting them
> > > > > here (or in the bugzilla if you prefer)?
> > > 
> > > Hi,
> > > 
> > > To me it looks the ASPM/CCC is a red herring (or another problem unrelated
> > > to the ReBAR size issue).
> > > 
> > > What happens here is the entire PCIe topology is reset:
> > > 
> > > [    1.121434] kernel: pcieport 0000:00:07.2: pciehp: Slot(14): Link Down
> > > [    1.121439] kernel: pcieport 0000:00:07.2: pciehp: Slot(14): Card not present
> > > [    5.804638] kernel: pcieport 0000:00:07.2: pciehp: Slot(14): Card present
> > > [    5.804643] kernel: pcieport 0000:00:07.2: pciehp: Slot(14): Link Up
> > > 
> > > I recalled Mika Westerberg mentioned some time back Thunderbolt is
> > > starting to reset things on boot so this might be related to that.
> > > 
> > > As the hotplug tears down everything on PCI side, there's nothing to hold
> > > the ReBAR size information across as far as PCI core is concerned.
> > > 
> > > Thunderbolt reset on boot was (probably) introduced by this commit:
> > > 
> > > 59a54c5f3dbd ("thunderbolt: Reset topology created by the boot firmware")
> > > 
> > > 
> > > I don't know if the nvidia out-of-tree driver does attempt BAR resize on
> > > its own (some in-kernel GPU driver do on their own outside of PCI core's
> > > resource fitting algorithm). At least there's no indication in the log
> > > that would point to even a resize attempt happening.
> > > 
> > > 
> > > My resizable BAR aware resource fitting would eventually solve this but
> > > it's not yet ready. I'm currently trying to fix pci=realloc not detecting
> > > need to resize anything if the current ReBAR size fits just fine.
> > 
> > One temporary workaround until your code is ready is passing
> > "thunderbolt.host_reset=0" in the command line. That will skip the reset.
> 
> A few background things of that host reset:
> 
> 1. BIOS won't reserve enough MMIO resources for downstream device in PCIe
> tunnel to be able to hotplug.  If Linux inherits assignments you get in a
> bad situation.
> 
> For example:
> Boot with a dock connected and no downstream storage.
> Try to hotplug downstream storage.
> Downstream storage doesn't work in Linux.
> 
> Boot with dock connected and downstream storage connected.
> Downstream storage does work in Linux.
> 
> 2. Windows does the same thing.

The other thing is that this is essentially same as plugging in a device
after the system has booted up. Linux should be able to reserve resources
for its needs.

      reply	other threads:[~2026-05-06 14:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-221457-41252@https.bugzilla.kernel.org/>
2026-05-04 18:29 ` Fwd: [Bug 221457] New: PCI core drops Resizable BAR sizing after ASPM common-clock reconfiguration on Thunderbolt/USB4 hot-plug link Bjorn Helgaas
2026-05-04 18:43   ` Bjorn Helgaas
     [not found]     ` <AB2EBCFC-663F-48A1-9C11-2DFB7C844B19.1@smtp-inbound1.duck.com>
2026-05-06  5:09       ` stuck-tamer-growl
2026-05-06 12:26         ` Ilpo Järvinen
2026-05-06 12:38           ` Mika Westerberg
2026-05-06 13:07             ` Mario Limonciello
2026-05-06 14:44               ` Mika Westerberg [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=20260506144435.GM6785@black.igk.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=Sanath.S@amd.com \
    --cc=bjorn@helgaas.com \
    --cc=helgaas@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=stuck-tamer-growl@duck.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