]> git.hungrycats.org Git - linux/commitdiff
drm/radeon: Modernize VFCT error handling
authorMario Limonciello <mario.limonciello@amd.com>
Wed, 8 Jul 2026 19:35:16 +0000 (14:35 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 15 Jul 2026 13:15:41 +0000 (09:15 -0400)
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>
drivers/gpu/drm/radeon/radeon_bios.c

index 3a8c5199a0fe7a032b8aba85853cec7454c1c4f7..c6df799c3cf4a290a2601aee1054047eff3e6614 100644 (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);