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

Lazar, Lijo Lijo.Lazar at amd.com
Mon Jul 31 10:06:43 UTC 2023


[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 <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Amber Lin
Sent: Monday, July 31, 2023 9:02 AM
To: amd-gfx at lists.freedesktop.org
Cc: Lin, Amber <Amber.Lin at amd.com>
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.

Signed-off-by: Amber Lin <amber.lin at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 7c6dd3de1867..fa5721b3139c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -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



More information about the amd-gfx mailing list