]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amdgpu: use DISCOVERY_TMR_SIZE in ACPI TMR fallback
authorJesse.Zhang <Jesse.Zhang@amd.com>
Mon, 23 Mar 2026 05:31:54 +0000 (13:31 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 24 Mar 2026 17:30:36 +0000 (13:30 -0400)
amdgpu_acpi_get_tmr_info() returns the full TMR region size, not the IP
discovery table size. Using tmr_size as discovery.size can lead to oversized
allocations and probe failure.

In the ACPI fallback path, keep discovery.size as DISCOVERY_TMR_SIZE and only
use ACPI data for offset calculation.

Fixes: 01bdc7e219c4 ("drm/amdgpu: New interface to get IP discovery binary v3")
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Suggested-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c

index a20b73eab0152e43156f58ed5edcd32dfc8f9550..8ec5465c3349df31157b7732fa657185a2d288f8 100644 (file)
@@ -324,7 +324,7 @@ static int amdgpu_discovery_get_tmr_info(struct amdgpu_device *adev,
                        ret = amdgpu_acpi_get_tmr_info(adev, &tmr_offset, &tmr_size);
                        if (ret)
                                return ret;
-                       adev->discovery.size = (u32)tmr_size;
+                       adev->discovery.size = DISCOVERY_TMR_SIZE;
                        adev->discovery.offset = tmr_offset + tmr_size - DISCOVERY_TMR_OFFSET;
                }
        }