drm/amdgpu: GC_9.4.3 requires at least 280MB TMR
Subsystems (2)
PATCH 1/1 drm/amdgpu: GC_9.4.3 requires at least 280MB TMR
On GC_9.4.3, if atombios reports TMR size less than 280MB, firmware area will be overwritten by driver or user application use. Remove !adev->bios condition since reserve_size is initialized as 0, it'll fail into else if (!reserve_size) condition.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1 -1
@@ -1718,7 +1718,7 @@ static int amdgpu_ttm_reserve_tmr(struct amdgpu_device *adev) reserve_size =amdgpu_atomfirmware_get_fw_reserved_fb_size (adev); -if (!adev->bios && adev->ip_versions[GC_HWIP ][0 ] ==IP_VERSION (9 ,4 ,3 )) +if (adev->ip_versions[GC_HWIP ][0 ] ==IP_VERSION (9 ,4 ,3 )) reserve_size =max (reserve_size, (uint32_t )280 <<20 );else if (!reserve_size) reserve_size =DISCOVERY_TMR_OFFSET ;
Signature · 1 line
2.25.1
[AMD Official Use Only - General]
If BIOS is present, it's supposed to fetch a non-zero reserve size and it shouldn't fall into if (!reserve_size) path.
if (adev->bios)
reserve_size =
amdgpu_atomfirmware_get_fw_reserved_fb_size(adev);If the reserve size is zero, then is a BIOS bug. The check should remain.
Thanks,
Lijo
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Amber Lin
Sent: Monday, July 31, 2023 9:02 AM
To: [email protected]
Cc: Lin, Amber <[email protected]>
Subject: [PATCH] drm/amdgpu: GC_9.4.3 requires at least 280MB TMR
On GC_9.4.3, if atombios reports TMR size less than 280MB, firmware area will be overwritten by driver or user application use. Remove !adev->bios condition since reserve_size is initialized as 0, it'll fail into else if (!reserve_size) condition.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1 -1
@@ -1718,7 +1718,7 @@ static int amdgpu_ttm_reserve_tmr(struct amdgpu_device *adev) reserve_size =amdgpu_atomfirmware_get_fw_reserved_fb_size (adev); -if (!adev->bios && adev->ip_versions[GC_HWIP ][0 ] ==IP_VERSION (9 ,4 ,3 )) +if (adev->ip_versions[GC_HWIP ][0 ] ==IP_VERSION (9 ,4 ,3 )) reserve_size =max (reserve_size, (uint32_t )280 <<20 );else if (!reserve_size) reserve_size =DISCOVERY_TMR_OFFSET ;
--
2.25.1