Skip to contentSkip to conversation

drm/amd/amdgpu: Fix the CGCG setting is overwritten for SRIOV.

PATCH In review Gavin Wan 3 participants 4 messages May 22, 2020 – May 26, 2020

Subsystems (2)
lore
Share & tools
lore

Gavin Wan

author
#0 lore raw

PATCH 1/1 drm/amd/amdgpu: Fix the CGCG setting is overwritten for SRIOV.

For SRIOV, since the CP_INT_CNTL_RING0 is programed on host side. The Guest should not program CP_INT_CNTL_RING0 again.

Change-Id Ic336fab3b23b8371c9e9e192182a3ba14a8db8e1
---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +3 -0
index bd5dd4f64311..39275bf79448 100644
@@ -4558,6 +4558,9 @@ static void gfx_v10_0_constants_init(struct amdgpu_device *adev)
 static void gfx_v10_0_enable_gui_idle_interrupt(struct amdgpu_device *adev,
 					       bool enable)
 {
+	if (amdgpu_sriov_vf(adev))
+		return;
+
 	u32 tmp = RREG32_SOC15(GC, 0, mmCP_INT_CNTL_RING0);
 
 	tmp = REG_SET_FIELD(tmp, CP_INT_CNTL_RING0, CNTX_BUSY_INT_ENABLE,
Signature · 6 lines
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#1 lore raw
Quoted 15 lines · Gavin Wan

For SRIOV, since the CP_INT_CNTL_RING0 is programed on host side. The Guest should not program CP_INT_CNTL_RING0 again.

Change-Id Ic336fab3b23b8371c9e9e192182a3ba14a8db8e1
---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +0 -0
index bd5dd4f64311..39275bf79448 100644

drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c static void gfx_v10_0_constants_init(struct amdgpu_device *adev) · line 4563

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +3 -0
@@ -4558,6 +4558,9 @@ static void gfx_v10_0_constants_init(struct amdgpu_device *adev)
 static void gfx_v10_0_enable_gui_idle_interrupt(struct amdgpu_device *adev,
                                               bool enable)
 {
+       if (amdgpu_sriov_vf(adev))
+               return;
+

This needs to be below the stack variable declarations or you'll get a warning.

Alex

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +0 -1
        u32 tmp = RREG32_SOC15(GC, 0, mmCP_INT_CNTL_RING0);
 
        tmp = REG_SET_FIELD(tmp, CP_INT_CNTL_RING0, CNTX_BUSY_INT_ENABLE,
--

2.25.1

_______________________________________________
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
#2 lore raw

HI Alex,

I fixed it as your suggestion.

Thanks,
Gavin

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Friday, May 22, 2020 3:11 PM
To: Wan, Gavin <[email protected]>
Cc: amd-gfx list <[email protected]>
Subject: Re: [PATCH] drm/amd/amdgpu: Fix the CGCG setting is overwritten for SRIOV.

Quoted 16 lines · Gavin Wan

For SRIOV, since the CP_INT_CNTL_RING0 is programed on host side. The Guest should not program CP_INT_CNTL_RING0 again.

Change-Id Ic336fab3b23b8371c9e9e192182a3ba14a8db8e1
---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +0 -0
index bd5dd4f64311..39275bf79448 100644

drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c static void gfx_v10_0_constants_init(struct · line 4562

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +3 -0
@@ -4558,6 +4558,9 @@ static void gfx_v10_0_constants_init(struct 
 amdgpu_device *adev)  static void gfx_v10_0_enable_gui_idle_interrupt(struct amdgpu_device *adev,
                                               bool enable)  {
+       if (amdgpu_sriov_vf(adev))
+               return;
+

This needs to be below the stack variable declarations or you'll get a warning.

Alex

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +0 -1
        u32 tmp = RREG32_SOC15(GC, 0, mmCP_INT_CNTL_RING0);
 
        tmp = REG_SET_FIELD(tmp, CP_INT_CNTL_RING0, 
 CNTX_BUSY_INT_ENABLE,
--

2.25.1

Quoted 8 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=02%7C01%7CGa vin.Wan%40amd.com%7C23c1770b248841c7032a08d7fe83d940%7C3dd8961fe4884e6 08e11a82d994e183d%7C0%7C0%7C637257714548695750&amp;sdata=PaWH5hLNb3N1Z lalw4GsjeeB46xzCVxXDWBROndcKsk%3D&amp;reserved=0

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

#3 lore raw

This one looks better

You can put my RB

Thanks

_____________________________________
Monk Liu|GPU Virtualization Team |AMD

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Wan, Gavin
Sent: Saturday, May 23, 2020 3:41 AM
To: Alex Deucher <[email protected]>
Cc: amd-gfx list <[email protected]>
Subject: RE: [PATCH] drm/amd/amdgpu: Fix the CGCG setting is overwritten for SRIOV.

HI Alex,

I fixed it as your suggestion.

Thanks,
Gavin

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Friday, May 22, 2020 3:11 PM
To: Wan, Gavin <[email protected]>
Cc: amd-gfx list <[email protected]>
Subject: Re: [PATCH] drm/amd/amdgpu: Fix the CGCG setting is overwritten for SRIOV.

Quoted 16 lines · Gavin Wan

For SRIOV, since the CP_INT_CNTL_RING0 is programed on host side. The Guest should not program CP_INT_CNTL_RING0 again.

Change-Id Ic336fab3b23b8371c9e9e192182a3ba14a8db8e1
---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +0 -0
index bd5dd4f64311..39275bf79448 100644

drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c static void gfx_v10_0_constants_init(struct · line 4562

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +3 -0
@@ -4558,6 +4558,9 @@ static void gfx_v10_0_constants_init(struct 
 amdgpu_device *adev)  static void gfx_v10_0_enable_gui_idle_interrupt(struct amdgpu_device *adev,
                                               bool enable)  {
+       if (amdgpu_sriov_vf(adev))
+               return;
+

This needs to be below the stack variable declarations or you'll get a warning.

Alex

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +0 -1
        u32 tmp = RREG32_SOC15(GC, 0, mmCP_INT_CNTL_RING0);
 
        tmp = REG_SET_FIELD(tmp, CP_INT_CNTL_RING0, 
 CNTX_BUSY_INT_ENABLE,
--

2.25.1

Quoted 8 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=02%7C01%7CGa vin.Wan%40amd.com%7C23c1770b248841c7032a08d7fe83d940%7C3dd8961fe4884e6 08e11a82d994e183d%7C0%7C0%7C637257714548695750&amp;sdata=PaWH5hLNb3N1Z lalw4GsjeeB46xzCVxXDWBROndcKsk%3D&amp;reserved=0

_______________________________________________
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%7Cmonk.liu%40amd.com%7Cc7ef193b2ceb418c3be608d7fe880de4%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637257732654114415&amp;sdata=2kIarekeuDY4gio%2F%2BKbQJsl8RbWrmPC9K1KnwopK5FM%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx