Skip to contentSkip to conversation

drm/amdgpu: correct discovery_tmr_size init val

PATCH In review Wenhui.Sheng 3 participants 3 messages Jun 29, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: correct discovery_tmr_size init val

From: Wenhui Sheng <[email protected]>

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.

---
 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 7d51768684dd..56beafbd3ab9 100644
@@ -1872,7 +1872,7 @@ static int amdgpu_ttm_reserve_tmr(struct amdgpu_device *adev)
 	adev->discovery_tmr_size =
 		amdgpu_atomfirmware_get_fw_reserved_fb_size(adev);
 	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 */
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by on v1 1/1
#1 lore raw

[AMD Public Use]

Regards,
Hawking
-----Original Message-----
From: Sheng, Wenhui <[email protected]>
Sent: Monday, June 29, 2020 14:08
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Sheng, Wenhui <[email protected]>
Subject: [PATCH] drm/amdgpu: correct discovery_tmr_size init val

From: Wenhui Sheng <[email protected]>

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.

---
 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 7d51768684dd..56beafbd3ab9 100644
@@ -1872,7 +1872,7 @@ static int amdgpu_ttm_reserve_tmr(struct amdgpu_device *adev)
 	adev->discovery_tmr_size =
 		amdgpu_atomfirmware_get_fw_reserved_fb_size(adev);
 	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 */

--
2.17.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#2 lore raw
In reply to Wenhui.Sheng

[AMD Public Use]

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

Alex

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

From: Wenhui Sheng <[email protected]>

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.

---
 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 7d51768684dd..56beafbd3ab9 100644
@@ -1872,7 +1872,7 @@ static int amdgpu_ttm_reserve_tmr(struct amdgpu_device *adev)
         adev->discovery_tmr_size =
                 amdgpu_atomfirmware_get_fw_reserved_fb_size(adev);
         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 */

--
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Calexander.deucher%40amd.com%7Cba68c480e1fc4e73952408d81bf2ca8a%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637290077543935012&amp;sdata=R0g%2FzsOg%2BoH5%2BccXgnGAhRd0JfMgCTuXlv6yuIQSVuY%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx