drm/radeon: Modernize VFCT error handling

Clean up radeon_acpi_vfct_bios() logging:

- Replace DRM_ERROR with dev_warn tied to the PCI device
- Use unsigned int rather than bare unsigned for the offset

A malformed or missing VFCT table is not fatal: radeon falls back
to the other BIOS fetch methods, so warn rather than error on these
paths.

The goto out label is retained: acpi_get_table() takes a reference on
the table (incrementing its validation_count and mapping it), which
must be released with a paired acpi_put_table() on every exit path.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patch.msgid.link/20260708193518.702584-4-mario.limonciello@amd.com
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Mario Limonciello
2026-07-08 14:35:16 -05:00
committed by Alex Deucher
parent c87e6635d2
commit 24071402a4

View File

@@ -602,14 +602,14 @@ static bool radeon_acpi_vfct_bios(struct radeon_device *rdev)
struct acpi_table_header *hdr;
acpi_size tbl_size;
UEFI_ACPI_VFCT *vfct;
unsigned offset;
unsigned int offset;
bool r = false;
if (!ACPI_SUCCESS(acpi_get_table("VFCT", 1, &hdr)))
return false;
tbl_size = hdr->length;
if (tbl_size < sizeof(UEFI_ACPI_VFCT)) {
DRM_ERROR("ACPI VFCT table present but broken (too short #1)\n");
dev_warn(&rdev->pdev->dev, "ACPI VFCT table present but broken (too short #1),skipping\n");
goto out;
}
@@ -622,13 +622,13 @@ static bool radeon_acpi_vfct_bios(struct radeon_device *rdev)
offset += sizeof(VFCT_IMAGE_HEADER);
if (offset > tbl_size) {
DRM_ERROR("ACPI VFCT image header truncated\n");
dev_warn(&rdev->pdev->dev, "ACPI VFCT image header truncated,skipping\n");
goto out;
}
offset += vhdr->ImageLength;
if (offset > tbl_size) {
DRM_ERROR("ACPI VFCT image truncated\n");
dev_warn(&rdev->pdev->dev, "ACPI VFCT image truncated,skipping\n");
goto out;
}
@@ -648,7 +648,7 @@ static bool radeon_acpi_vfct_bios(struct radeon_device *rdev)
}
}
DRM_ERROR("ACPI VFCT table present but broken (too short #2)\n");
dev_warn(&rdev->pdev->dev, "ACPI VFCT table present but broken (too short #2),skipping\n");
out:
acpi_put_table(hdr);