Skip to contentSkip to conversation

drm/amdgpu: GC_9.4.3 requires at least 280MB TMR

PATCH In review Amber Lin 2 participants 2 messages Jul 31, 2023

Subsystems (2)
lore
Share & tools
lore

Amber Lin

author
#0 lore raw

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
index 7c6dd3de1867..fa5721b3139c 100644
@@ -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
#1 lore raw

[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
index 7c6dd3de1867..fa5721b3139c 100644
@@ -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