This reverts commit 4059e2f02c8a2a51ba78860775877d721df6a055. This was added to work around systems where the user specified pci=realloc on the kernel command line. The firmware specifies the BDF to match, but those may not be the same with pci=realloc. This causes mismatches when there are multiple cards of the same type in the system and failure of the cards to initialize. pci=realloc is not the most common case so let's revert for now to fix the regression. We probably need to store the original BDF in the PCI subsystem so we can use it match later if the BDF has changed.
Signed-off-by: Alex Deucher <[email protected]> --- drivers/gpu/drm/radeon/radeon_bios.c | 45 ++++------------------------ 1 file changed, 5 insertions(+), 40 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_bios.c b/drivers/gpu/drm/radeon/radeon_bios.c index 1da6bf1c17ff3..23db87155e778 100644 --- a/drivers/gpu/drm/radeon/radeon_bios.c +++ b/drivers/gpu/drm/radeon/radeon_bios.c @@ -601,45 +601,6 @@ static bool radeon_read_disabled_bios(struct radeon_device *rdev) } #ifdef CONFIG_ACPI -/** - * radeon_acpi_vfct_match() - Check if a VFCT entry matches the device - * @rdev: Radeon device - * @vhdr: VFCT image header to check - * - * 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. - * - * Returns: 0 on match, -ENODEV on no match - */ -static int radeon_acpi_vfct_match(struct radeon_device *rdev, - VFCT_IMAGE_HEADER *vhdr) -{ - /* Vendor and device IDs must always match */ - if (vhdr->VendorID != rdev->pdev->vendor || - vhdr->DeviceID != rdev->pdev->device) - return -ENODEV; - - if (vhdr->PCIDevice != PCI_SLOT(rdev->pdev->devfn) || - 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; -} - static bool radeon_acpi_vfct_bios(struct radeon_device *rdev) { struct acpi_table_header *hdr; @@ -676,7 +637,11 @@ static bool radeon_acpi_vfct_bios(struct radeon_device *rdev) } if (vhdr->ImageLength && - !radeon_acpi_vfct_match(rdev, vhdr)) { + vhdr->PCIBus == rdev->pdev->bus->number && + vhdr->PCIDevice == PCI_SLOT(rdev->pdev->devfn) && + vhdr->PCIFunction == PCI_FUNC(rdev->pdev->devfn) && + vhdr->VendorID == rdev->pdev->vendor && + vhdr->DeviceID == rdev->pdev->device) { rdev->bios = kmemdup(&vbios->VbiosContent, vhdr->ImageLength, GFP_KERNEL); -- 2.56.0
