All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Mario Limonciello <mario.limonciello@amd.com>
Cc: "Bjorn Helgaas" <bhelgaas@google.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Lijo Lazar" <lijo.lazar@amd.com>,
	linux-pci@vger.kernel.org, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH v8 1/3] PCI: Cache bridge firmware secondary bus number
Date: Thu, 19 Nov 2026 13:55:53 -0600	[thread overview]
Message-ID: <20261119195553.GA835692@bhelgaas> (raw)
In-Reply-To: <20261119-vfct-regression-v8-v8-1-12463194e457@amd.com>

On Thu, Nov 19, 2026 at 01:21:19PM -0600, Mario Limonciello wrote:
> Drivers such as amdgpu and radeon need the bus number firmware assigned
> to a device to match it against firmware tables like VFCT. The PCI core
> may renumber buses (e.g. with pci=realloc), after which the runtime
> number no longer reflects what firmware programmed.
> 
> Record the bridge's secondary bus number in its struct pci_dev when
> pci_read_bridge_windows() reads the bus number register. This happens
> once, when the bridge is first enumerated and before any renumbering,
> so the value is what firmware left at FW/OS handoff. Devices behind the
> bridge can then retrieve their firmware bus number via their upstream
> bridge.
> 
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>

Acked-by: Bjorn Helgaas <bhelgaas@google.com>

I assume you'll merge via DRM?

> ---
>  drivers/pci/probe.c | 1 +
>  include/linux/pci.h | 2 ++
>  2 files changed, 3 insertions(+)
> 
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index 9a178e0e5f7f4..89a7c52ac3e5b 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -513,6 +513,7 @@ static void pci_read_bridge_windows(struct pci_dev *bridge)
>  	res.flags = IORESOURCE_BUS;
>  	res.start = FIELD_GET(PCI_SECONDARY_BUS_MASK, buses);
>  	res.end = FIELD_GET(PCI_SUBORDINATE_BUS_MASK, buses);
> +	bridge->fw_sec_busnr = res.start;
>  	pci_info(bridge, "PCI bridge to %pR%s\n", &res,
>  		 bridge->transparent ? " (subtractive decode)" : "");
>  
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index aa3765a20a96c..4c1b1e557a607 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -363,6 +363,8 @@ struct pci_dev {
>  	struct pci_slot	*slot;		/* Physical slot this device is in */
>  
>  	unsigned int	devfn;		/* Encoded device & function index */
> +	/* Bridge secondary bus number at FW/OS handoff */
> +	unsigned char	fw_sec_busnr;
>  	unsigned short	vendor;
>  	unsigned short	device;
>  	unsigned short	subsystem_vendor;
> 
> -- 
> 2.43.0
> 

  parent reply	other threads:[~2026-11-19 19:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 19:21 [PATCH v8 0/3] Fix VFCT matching after PCI bus renumbering Mario Limonciello
2026-11-19 19:21 ` [PATCH v8 1/3] PCI: Cache bridge firmware secondary bus number Mario Limonciello
2026-11-19 19:26   ` sashiko-bot
2026-11-19 19:55   ` Bjorn Helgaas [this message]
2026-11-19 21:06     ` Mario Limonciello
2026-11-19 21:40       ` Alex Deucher
2026-11-19 21:41         ` Mario Limonciello
2026-11-19 20:09   ` Alex Deucher
2026-11-19 19:21 ` [PATCH v8 2/3] drm/amdgpu: Match VFCT using initial PCI " Mario Limonciello
2026-11-19 19:28   ` sashiko-bot
2026-11-19 19:21 ` [PATCH v8 3/3] drm/radeon: " Mario Limonciello
2026-11-19 19:26   ` sashiko-bot

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=20261119195553.GA835692@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=bhelgaas@google.com \
    --cc=christian.koenig@amd.com \
    --cc=lijo.lazar@amd.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=mario.limonciello@amd.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 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.