diff options
| author | Mario Limonciello <mario.limonciello@amd.com> | 2026-07-08 14:35:16 -0500 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2026-07-15 09:15:41 -0400 |
| commit | 24071402a41a56dba3e215ca89c6b5d855c678ea (patch) | |
| tree | 31c1a09718cee92dd6991f41fefaf437fb8fcc22 | |
| parent | c87e6635d2db02c88ae8d09529362da672d34770 (diff) | |
| download | linux-24071402a41a56dba3e215ca89c6b5d855c678ea.tar.gz linux-24071402a41a56dba3e215ca89c6b5d855c678ea.zip | |
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>
| -rw-r--r-- | drivers/gpu/drm/radeon/radeon_bios.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_bios.c b/drivers/gpu/drm/radeon/radeon_bios.c index 3a8c5199a0fe..c6df799c3cf4 100644 --- a/drivers/gpu/drm/radeon/radeon_bios.c +++ b/drivers/gpu/drm/radeon/radeon_bios.c @@ -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); |
