Skip to contentSkip to conversation

drm/amdgpu: get xgmi info at eary_init

PATCH In review shaoyunl 2 participants 5 messages Feb 19, 2021 – Feb 23, 2021

Subsystems (2)
lore
Share & tools
lore

shaoyunl

author
#0 lore raw

PATCH 2/4 drm/amdgpu: get xgmi info at eary_init

Driver need to get XGMI info function earlier before ip_init since driver need to check the XGMI setting to determine how to perform reset during init

Change-Id Ic37276bbb6640bb4e9360220fed99494cedd3ef5
---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +4 -6
index 3686e777c76c..3e6bfab5b855 100644
@@ -1151,6 +1151,10 @@ static int gmc_v9_0_early_init(void *handle)
 	adev->gmc.private_aperture_end =
 		adev->gmc.private_aperture_start + (4ULL << 30) - 1;
 
+	/* Need to get xgmi info earlier to decide the reset behavior*/
+	if (adev->gmc.xgmi.supported)
+		adev->gfxhub.funcs->get_xgmi_info(adev);
+
 	return 0;
 }
 
@@ -1416,12 +1420,6 @@ static int gmc_v9_0_sw_init(void *handle)
 	}
 	adev->need_swiotlb = drm_need_swiotlb(44);
 
-	if (adev->gmc.xgmi.supported) {
-		r = adev->gfxhub.funcs->get_xgmi_info(adev);
-		if (r)
-			return r;
-	}
-
 	r = gmc_v9_0_mc_init(adev);
 	if (r)
 		return r;
Signature · 6 lines
2.17.1

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

[AMD Official Use Only - Internal Distribution Only]

-----Original Message-----
From: Liu, Shaoyun <[email protected]>
Sent: Thursday, February 18, 2021 8:19 PM
To: [email protected]
Cc: Liu, Shaoyun <[email protected]>
Subject: [PATCH 2/4] drm/amdgpu: get xgmi info at eary_init

Driver need to get XGMI info function earlier before ip_init since driver need to check the XGMI setting to determine how to perform reset during init

Change-Id Ic37276bbb6640bb4e9360220fed99494cedd3ef5
---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +4 -6
index 3686e777c76c..3e6bfab5b855 100644
@@ -1151,6 +1151,10 @@ static int gmc_v9_0_early_init(void *handle)
 	adev->gmc.private_aperture_end =
 		adev->gmc.private_aperture_start + (4ULL << 30) - 1;
 
+	/* Need to get xgmi info earlier to decide the reset behavior*/
+	if (adev->gmc.xgmi.supported)
+		adev->gfxhub.funcs->get_xgmi_info(adev);
+
 	return 0;
 }
 
@@ -1416,12 +1420,6 @@ static int gmc_v9_0_sw_init(void *handle)
 	}
 	adev->need_swiotlb = drm_need_swiotlb(44);
 
-	if (adev->gmc.xgmi.supported) {
-		r = adev->gfxhub.funcs->get_xgmi_info(adev);
-		if (r)
-			return r;
-	}
-
 	r = gmc_v9_0_mc_init(adev);
 	if (r)
 		return r;

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

Acked-by on v1 2/4
#2 lore raw
In reply to shaoyunl
Quoted 6 lines · shaoyunl

Driver need to get XGMI info function earlier before ip_init since driver need to check the XGMI setting to determine how to perform reset during init

Change-Id Ic37276bbb6640bb4e9360220fed99494cedd3ef5

I think this patch needs to come first or patch 1 won't work. With that changed, this patch is:

Quoted 35 lines
---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +4 -7
index 3686e777c76c..3e6bfab5b855 100644
@@ -1151,6 +1151,10 @@ static int gmc_v9_0_early_init(void *handle)
        adev->gmc.private_aperture_end =
                adev->gmc.private_aperture_start + (4ULL << 30) - 1;
 
+       /* Need to get xgmi info earlier to decide the reset behavior*/
+       if (adev->gmc.xgmi.supported)
+               adev->gfxhub.funcs->get_xgmi_info(adev);
+
        return 0;
 }
 
@@ -1416,12 +1420,6 @@ static int gmc_v9_0_sw_init(void *handle)
        }
        adev->need_swiotlb = drm_need_swiotlb(44);
 
-       if (adev->gmc.xgmi.supported) {
-               r = adev->gfxhub.funcs->get_xgmi_info(adev);
-               if (r)
-                       return r;
-       }
-
        r = gmc_v9_0_mc_init(adev);
        if (r)
                return r;
--

2.17.1

Quoted 4 lines

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

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

author Acked-by Alex Deucher
#3 lore raw

[AMD Official Use Only - Internal Distribution Only]

Thanks , Alex.
Whole four patches are needed for the XGMI reset to work normally . I try to describe what these patches for in the first patch. But If you don't mind this , I can adjust the order as suggested .

Thanks
Shaoyun.liu

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Tuesday, February 23, 2021 11:26 AM
To: Liu, Shaoyun <[email protected]>
Cc: amd-gfx list <[email protected]>
Subject: Re: [PATCH 2/4] drm/amdgpu: get xgmi info at eary_init

Quoted 7 lines · shaoyunl

Driver need to get XGMI info function earlier before ip_init since driver need to check the XGMI setting to determine how to perform reset during init

Change-Id Ic37276bbb6640bb4e9360220fed99494cedd3ef5

I think this patch needs to come first or patch 1 won't work. With that changed, this patch is:

Quoted 36 lines
---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +4 -7
index 3686e777c76c..3e6bfab5b855 100644
@@ -1151,6 +1151,10 @@ static int gmc_v9_0_early_init(void *handle)
        adev->gmc.private_aperture_end =
                adev->gmc.private_aperture_start + (4ULL << 30) - 1;
 
+       /* Need to get xgmi info earlier to decide the reset behavior*/
+       if (adev->gmc.xgmi.supported)
+               adev->gfxhub.funcs->get_xgmi_info(adev);
+
        return 0;
 }
 
@@ -1416,12 +1420,6 @@ static int gmc_v9_0_sw_init(void *handle)
        }
        adev->need_swiotlb = drm_need_swiotlb(44);
 
-       if (adev->gmc.xgmi.supported) {
-               r = adev->gfxhub.funcs->get_xgmi_info(adev);
-               if (r)
-                       return r;
-       }
-
        r = gmc_v9_0_mc_init(adev);
        if (r)
                return r;
--

2.17.1

Quoted 10 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Csh aoyun.liu%40amd.com%7Ceb081cfaf9c94e59521008d8d817ccee%7C3dd8961fe4884 e608e11a82d994e183d%7C0%7C0%7C637496944032343059%7CUnknown%7CTWFpbGZsb 3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D% 7C1000&amp;sdata=CrS5Nv4uCh8sFRILLGM%2FRgxpVlEEs%2Bft%2FHTdoeQyyqo%3D& amp;reserved=0

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

#4 lore raw
Quoted 5 lines · Shaoyun

[AMD Official Use Only - Internal Distribution Only]

Thanks , Alex.
Whole four patches are needed for the XGMI reset to work normally . I try to describe what these patches for in the first patch. But If you don't mind this , I can adjust the order as suggested .

Just update the commit messages to indicate that these changes are needed for big rework in the later patches.

Alex

Quoted 59 lines

Thanks
Shaoyun.liu

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Tuesday, February 23, 2021 11:26 AM
To: Liu, Shaoyun <[email protected]>
Cc: amd-gfx list <[email protected]>
Subject: Re: [PATCH 2/4] drm/amdgpu: get xgmi info at eary_init

Quoted 7 lines · shaoyunl

Driver need to get XGMI info function earlier before ip_init since driver need to check the XGMI setting to determine how to perform reset during init

Change-Id Ic37276bbb6640bb4e9360220fed99494cedd3ef5

I think this patch needs to come first or patch 1 won't work. With that changed, this patch is:

Quoted 36 lines
---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +4 -7
index 3686e777c76c..3e6bfab5b855 100644
@@ -1151,6 +1151,10 @@ static int gmc_v9_0_early_init(void *handle)
        adev->gmc.private_aperture_end =
                adev->gmc.private_aperture_start + (4ULL << 30) - 1;
 
+       /* Need to get xgmi info earlier to decide the reset behavior*/
+       if (adev->gmc.xgmi.supported)
+               adev->gfxhub.funcs->get_xgmi_info(adev);
+
        return 0;
 }
 
@@ -1416,12 +1420,6 @@ static int gmc_v9_0_sw_init(void *handle)
        }
        adev->need_swiotlb = drm_need_swiotlb(44);
 
-       if (adev->gmc.xgmi.supported) {
-               r = adev->gfxhub.funcs->get_xgmi_info(adev);
-               if (r)
-                       return r;
-       }
-
        r = gmc_v9_0_mc_init(adev);
        if (r)
                return r;
--

2.17.1

Quoted 10 lines
Quoted 10 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Csh aoyun.liu%40amd.com%7Ceb081cfaf9c94e59521008d8d817ccee%7C3dd8961fe4884 e608e11a82d994e183d%7C0%7C0%7C637496944032343059%7CUnknown%7CTWFpbGZsb 3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D% 7C1000&amp;sdata=CrS5Nv4uCh8sFRILLGM%2FRgxpVlEEs%2Bft%2FHTdoeQyyqo%3D& amp;reserved=0

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