[PATCH v2 3/3] drm/radeon: Match VFCT using initial PCI bus number

From: Mario Limonciello

Date: Tue Oct 20 2026 - 10:08:07 EST


VFCT records the PCI bus number from BIOS POST. The current bus number
can change after PCI core renumbers the bus, while accepting a mismatch
based only on device identity can select the wrong VFCT image when
matching devices are present. Compare against the bus number captured
from the firmware bus assignment before bridge renumbering.

Fixes: 4059e2f02c8a ("drm/radeon: Fix VFCT bus number matching with soft filter")
Signed-off-by: Mario Limonciello <mario.limonciello@xxxxxxx>
---
drivers/gpu/drm/radeon/radeon_bios.c | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_bios.c b/drivers/gpu/drm/radeon/radeon_bios.c
index 1da6bf1c17ff3..88989c93757b1 100644
--- a/drivers/gpu/drm/radeon/radeon_bios.c
+++ b/drivers/gpu/drm/radeon/radeon_bios.c
@@ -609,10 +609,8 @@ static bool radeon_read_disabled_bios(struct radeon_device *rdev)
* VFCT entries contain the PCI bus number as recorded during BIOS POST.
* On systems where the kernel renumbers PCI buses (e.g. pci=realloc or
* resource conflicts), the runtime bus number may differ from the POST
- * value. Match by device identity (vendor + device + function) and use
- * the bus number as a preference: exact bus match is preferred, but when
- * the bus numbers disagree we accept the entry if the device identity
- * matches.
+ * value. Match using the bus number captured when the device was
+ * discovered, before any bus renumbering.
*
* Returns: 0 on match, -ENODEV on no match
*/
@@ -628,16 +626,7 @@ static int radeon_acpi_vfct_match(struct radeon_device *rdev,
vhdr->PCIFunction != PCI_FUNC(rdev->pdev->devfn))
return -ENODEV;

- /* Exact bus number match - preferred */
- if (vhdr->PCIBus == rdev->pdev->bus->number)
- return 0;
-
- /* Bus mismatch but device identity matches (PCI renumbering case) */
- dev_notice(&rdev->pdev->dev,
- "VFCT bus number mismatch: table %u != runtime %u, matching by device identity (vendor 0x%04x device 0x%04x)\n",
- vhdr->PCIBus, rdev->pdev->bus->number,
- rdev->pdev->vendor, rdev->pdev->device);
- return 0;
+ return vhdr->PCIBus == rdev->pdev->initial_bus_number ? 0 : -ENODEV;
}

static bool radeon_acpi_vfct_bios(struct radeon_device *rdev)

--
2.43.0