Skip to contentSkip to conversation

amd/amdgpu/sriov swSMU disable for sriov

PATCH In review Jack Zhang 3 participants 5 messages Dec 2, 2019 – Dec 3, 2019

Subsystems (2)
lore
Share & tools
lore

Jack Zhang

author
#0 lore raw

PATCH 1/1 amd/amdgpu/sriov swSMU disable for sriov

For boards greater than ARCTURUS, and under sriov platform, swSMU is not supported because smu ip block is commented at guest driver.

Generally for sriov, initialization of smu is moved to host driver. Thus, smu sw_init and hw_init will not be executed at guest driver.

Without sw structure being initialized in guest driver, swSMU cannot declare to be supported.

---
 drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +4 -1
index 36001a4..0b8a53b 100644
@@ -531,7 +531,10 @@ bool is_support_sw_smu(struct amdgpu_device *adev)
 	if (adev->asic_type == CHIP_VEGA20)
 		return (amdgpu_dpm == 2) ? true : false;
 	else if (adev->asic_type >= CHIP_ARCTURUS)
-		return true;
+		if (amdgpu_sriov_vf(adev))
+			return false;
+		else
+			return true;
 	else
 		return false;
 }
Signature · 6 lines
2.7.4

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

Hi, Team,

Would you please help to review this patch?

Best,
Jack

-----Original Message-----
From: Jack Zhang <[email protected]>
Sent: Monday, December 2, 2019 7:05 PM
To: [email protected]
Cc: Zhang, Jack (Jian) <[email protected]>
Subject: [PATCH] amd/amdgpu/sriov swSMU disable for sriov

For boards greater than ARCTURUS, and under sriov platform, swSMU is not supported because smu ip block is commented at guest driver.

Generally for sriov, initialization of smu is moved to host driver. Thus, smu sw_init and hw_init will not be executed at guest driver.

Without sw structure being initialized in guest driver, swSMU cannot declare to be supported.

---
 drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +4 -1
index 36001a4..0b8a53b 100644
@@ -531,7 +531,10 @@ bool is_support_sw_smu(struct amdgpu_device *adev)
 	if (adev->asic_type == CHIP_VEGA20)
 		return (amdgpu_dpm == 2) ? true : false;
 	else if (adev->asic_type >= CHIP_ARCTURUS)
-		return true;
+		if (amdgpu_sriov_vf(adev))
+			return false;
+		else
+			return true;
 	else
 		return false;
 }

--
2.7.4

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

Reviewed-by on v1 1/1
#2 lore raw
In reply to Jack Zhang

[AMD Official Use Only - Internal Distribution Only]

But it's better to optimize the flow of control in is_support_sw_smu()

Best Regards,
Kevin

________________________________
From: amd-gfx <[email protected]> on behalf of Jack Zhang <[email protected]>
Sent: Monday, December 2, 2019 7:05 PM
To: [email protected] <[email protected]>
Cc: Zhang, Jack (Jian) <[email protected]>
Subject: [PATCH] amd/amdgpu/sriov swSMU disable for sriov

For boards greater than ARCTURUS, and under sriov platform, swSMU is not supported because smu ip block is commented at guest driver.

Generally for sriov, initialization of smu is moved to host driver. Thus, smu sw_init and hw_init will not be executed at guest driver.

Without sw structure being initialized in guest driver, swSMU cannot declare to be supported.

---
 drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +4 -1
index 36001a4..0b8a53b 100644
@@ -531,7 +531,10 @@ bool is_support_sw_smu(struct amdgpu_device *adev)
         if (adev->asic_type == CHIP_VEGA20)
                 return (amdgpu_dpm == 2) ? true : false;
         else if (adev->asic_type >= CHIP_ARCTURUS)
-               return true;
+               if (amdgpu_sriov_vf(adev))
+                       return false;
+               else
+                       return true;
         else
                 return false;
 }

--
2.7.4

_______________________________________________
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%7CKevin1.Wang%40amd.com%7Cc80551b2c7d9426a7d5e08d777178bb9%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637108815398674653&amp;sdata=5dFralarJqC8%2FkwhQWCjsU8b5UQDILN2p6HafXGi0TM%3D&amp;reserved=0

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

#3 lore raw
In reply to Jack Zhang
Quoted 31 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Jack Zhang
Sent: Monday, December 2, 2019 7:05 PM
To: [email protected]
Cc: Zhang, Jack (Jian) <[email protected]>
Subject: [PATCH] amd/amdgpu/sriov swSMU disable for sriov

For boards greater than ARCTURUS, and under sriov platform, swSMU is not supported because smu ip block is commented at guest driver.

Generally for sriov, initialization of smu is moved to host driver. Thus, smu sw_init and hw_init will not be executed at guest driver.

Without sw structure being initialized in guest driver, swSMU cannot declare to be supported.

---
 drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +0 -0
index 36001a4..0b8a53b 100644

drivers/gpu/drm/amd/powerplay/amdgpu_smu.c bool is_support_sw_smu(struct amdgpu_device *adev) · line 537

Quoted 8 lines
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +4 -1
@@ -531,7 +531,10 @@ bool is_support_sw_smu(struct amdgpu_device *adev)
 	if (adev->asic_type == CHIP_VEGA20)
 		return (amdgpu_dpm == 2) ? true : false;
 	else if (adev->asic_type >= CHIP_ARCTURUS)
-		return true;
+		if (amdgpu_sriov_vf(adev))
+			return false;
+		else
+			return true;

[Quan, Evan] Are "{" and "}" missing around this code block? This seems a little weird.

Quoted 6 lines
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +0 -1
 	else
 		return false;
 }
--

2.7.4

Quoted 9 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.free
desktop.org%2Fmailman%2Flistinfo%2Famd- gfx&amp;data=02%7C01%7Cevan.quan%40amd.com%7Ca0119099a3db450554 f208d777178b5f%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C6371 08815384772040&amp;sdata=8RJ1QyDzHEcnOnk0EBGkhfVljeiPWaZSNlO6OyAa enc%3D&amp;reserved=0

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

#4 lore raw

Thanks Evan, I will add "{ }" before I check-in the code.

Best,
Jack

-----Original Message-----
From: Quan, Evan <[email protected]>
Sent: Tuesday, December 3, 2019 10:45 AM
To: Zhang, Jack (Jian) <[email protected]>; [email protected]
Cc: Zhang, Jack (Jian) <[email protected]>
Subject: RE: [PATCH] amd/amdgpu/sriov swSMU disable for sriov

Quoted 28 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Jack Zhang
Sent: Monday, December 2, 2019 7:05 PM
To: [email protected]
Cc: Zhang, Jack (Jian) <[email protected]>
Subject: [PATCH] amd/amdgpu/sriov swSMU disable for sriov

For boards greater than ARCTURUS, and under sriov platform, swSMU is not supported because smu ip block is commented at guest driver.

Generally for sriov, initialization of smu is moved to host driver. Thus, smu sw_init and hw_init will not be executed at guest driver.

Without sw structure being initialized in guest driver, swSMU cannot declare to be supported.

---
 drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +0 -0
index 36001a4..0b8a53b 100644

drivers/gpu/drm/amd/powerplay/amdgpu_smu.c bool is_support_sw_smu(struct amdgpu_device *adev) · line 537

Quoted 8 lines
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +4 -1
@@ -531,7 +531,10 @@ bool is_support_sw_smu(struct amdgpu_device *adev)
 	if (adev->asic_type == CHIP_VEGA20)
 		return (amdgpu_dpm == 2) ? true : false;
 	else if (adev->asic_type >= CHIP_ARCTURUS)
-		return true;
+		if (amdgpu_sriov_vf(adev))
+			return false;
+		else
+			return true;

[Quan, Evan] Are "{" and "}" missing around this code block? This seems a little weird.

Quoted 6 lines
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +0 -1
 	else
 		return false;
 }
--

2.7.4

Quoted 10 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.free
desktop.org%2Fmailman%2Flistinfo%2Famd- gfx&amp;data=02%7C01%7Cevan.quan%40amd.com%7Ca0119099a3db450554 f208d777178b5f%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C6371 08815384772040&amp;sdata=8RJ1QyDzHEcnOnk0EBGkhfVljeiPWaZSNlO6OyAa enc%3D&amp;reserved=0

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