All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: Alex Deucher <alexdeucher@gmail.com>
Cc: "Bjorn Helgaas" <helgaas@kernel.org>,
	"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 15:41:29 -0600	[thread overview]
Message-ID: <55d93dcb-e9f2-4792-9375-72070d8aec7e@amd.com> (raw)
In-Reply-To: <CADnq5_MA9qEPSX_Bt-WToDh2x5R6VoTKxt9GAazsPcX3aBQXOw@mail.gmail.com>



On 11/19/26 15:40, Alex Deucher wrote:
> On Thu, Nov 19, 2026 at 4:31 PM Mario Limonciello
> <mario.limonciello@amd.com> wrote:
>>
>>
>>
>> On 11/19/26 13:55, Bjorn Helgaas wrote:
>>> 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?
>>
>> Thanks.
>>
>> Yeah, I'll merge this through drm-misc.
> 
> Might be better to take via the amdgpu tree since it affects radeon and amdgpu?

Sure, that would avoid future conflicts I guess too. I'll submit to 
amd-staging-drm-next then.

> 
> Alex
> 
>>
>>>
>>>> ---
>>>>    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
>>>>
>>


  reply	other threads:[~2026-11-19 21:41 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
2026-11-19 21:06     ` Mario Limonciello
2026-11-19 21:40       ` Alex Deucher
2026-11-19 21:41         ` Mario Limonciello [this message]
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=55d93dcb-e9f2-4792-9375-72070d8aec7e@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=alexdeucher@gmail.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=bhelgaas@google.com \
    --cc=christian.koenig@amd.com \
    --cc=helgaas@kernel.org \
    --cc=lijo.lazar@amd.com \
    --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.