drm/amdgpu: use DISCOVERY_TMR_SIZE in ACPI TMR fallback
Subsystems (2)
PATCH 3/3 drm/amdgpu: use DISCOVERY_TMR_SIZE in ACPI TMR fallback
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 7055e5157742 ("drm/amdgpu: New interface to get IP discovery binary v3")
Suggested-by Lijo Lazar <[email protected]>
Signed-off-by Jesse Zhang <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +1 -1
@@ -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 ; } }
Signature · 1 line
2.49.0
Quoted 11 lines · Jesse.Zhang
amdgpu_acpi_get_tmr_info()returns the full TMR region size, not the IP discovery table size. Usingtmr_sizeas discovery.size can lead to oversized allocations and probe failure.In the ACPI fallback path, keep discovery.size as
DISCOVERY_TMR_SIZEand only use ACPI data for offset calculation.Fixes 7055e5157742 ("drm/amdgpu: New interface to get IP discovery binary v3")Suggested-by Lijo Lazar <[email protected]>Signed-off-by Jesse Zhang <[email protected]>
Reviewed-by Lijo Lazar <[email protected]>
Thanks,
Lijo
Quoted 17 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +1
-1@@ -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 ; } }