[PATCH] drm/amdgpu: correct discovery_tmr_size init val

Deucher, Alexander Alexander.Deucher at amd.com
Mon Jun 29 14:37:04 UTC 2020

[AMD Public Use]

You might want to add a comment to the code here.  It looks wrong to use the OFFSET.


From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> on behalf of Wenhui.Sheng <Wenhui.Sheng at amd.com>
Sent: Monday, June 29, 2020 2:07 AM
To: amd-gfx at lists.freedesktop.org <amd-gfx at lists.freedesktop.org>
Cc: Sheng, Wenhui <Wenhui.Sheng at amd.com>; Zhang, Hawking <Hawking.Zhang at amd.com>
Subject: [PATCH] drm/amdgpu: correct discovery_tmr_size init val

From: Wenhui Sheng <Wenhui.Sheng at amd.com>

The legacy way to initialize discovery_tmr_size
is using DISCOVERY_TMR_SIZE, while after we reduce
DISCOVERY_TMR_SIZE from 64KB to 4KB, variable
discovery_tmr_size is also reduced to 4KB, this is not
correct, it still should be 64KB, discovery_tmr_size
will be used to calculate ip_discovery reserved mem's
start address and size.

Using DISCOVERY_TMR_OFFSET to init discovery_tmr_size instead.

Signed-off-by: Wenhui Sheng <Wenhui.Sheng 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 7d51768684dd..56beafbd3ab9 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -1872,7 +1872,7 @@ static int amdgpu_ttm_reserve_tmr(struct amdgpu_device *adev)
         adev->discovery_tmr_size =
         if (!adev->discovery_tmr_size)
-               adev->discovery_tmr_size = DISCOVERY_TMR_SIZE;
+               adev->discovery_tmr_size = DISCOVERY_TMR_OFFSET;

         if (mem_train_support) {
                 /* reserve vram for mem train according to TMR location */

amd-gfx mailing list
amd-gfx at lists.freedesktop.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20200629/570e6ab2/attachment.htm>

More information about the amd-gfx mailing list