Skip to contentSkip to conversation

drm/amdgpu: skip load smu and sdma microcode on sriov for SIENNA_CICHLID

PATCH Superseded Stanley.Yang 2 participants 3 messages Dec 14, 2020

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: skip load smu and sdma microcode on sriov for SIENNA_CICHLID

skip load smu and sdma fw on sriov due to smc, sos, ta and asd fw have been skipped for SIENNA_CICHLID.

---
 drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c    | 3 +++
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c +3 -0
index 39e17aae655f..87566dee048d 100644
@@ -153,6 +153,9 @@ static int sdma_v5_2_init_microcode(struct amdgpu_device *adev)
 	struct amdgpu_firmware_info *info = NULL;
 	const struct common_firmware_header *header = NULL;
 
+	if (amdgpu_sriov_vf(adev) && (adev->asic_type == CHIP_SIENNA_CICHLID))
+		return 0;
+
 	DRM_DEBUG("\n");
 
 	switch (adev->asic_type) {
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +3 -1
index cf999b7a2164..31f05d96586c 100644
@@ -847,7 +847,9 @@ static int smu_sw_init(void *handle)
 	smu->smu_dpm.dpm_level = AMD_DPM_FORCED_LEVEL_AUTO;
 	smu->smu_dpm.requested_dpm_level = AMD_DPM_FORCED_LEVEL_AUTO;
 
-	if (!amdgpu_sriov_vf(adev) || (adev->asic_type != CHIP_NAVI12)) {
+	if (!amdgpu_sriov_vf(adev) ||
+			((adev->asic_type != CHIP_NAVI12) &&
+			(adev->asic_type != CHIP_SIENNA_CICHLID))) {
 		ret = smu_init_microcode(smu);
 		if (ret) {
 			dev_err(adev->dev, "Failed to load smu firmware!\n");
Signature · 6 lines
2.17.1

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

[AMD Public Use]

Quoted 55 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Stanley.Yang
Sent: Monday, December 14, 2020 8:41 AM
To: [email protected]
Cc: Yang, Stanley <[email protected]>; Jian, Jane <[email protected]>
Subject: [PATCH 1/1] drm/amdgpu: skip load smu and sdma microcode on sriov for SIENNA_CICHLID

[CAUTION: External Email]

skip load smu and sdma fw on sriov due to smc, sos, ta and asd fw have been skipped for SIENNA_CICHLID.

---
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 3 +++
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 4 +++-

2 files changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c +3 -0
index 39e17aae655f..87566dee048d 100644
@@ -153,6 +153,9 @@ static int sdma_v5_2_init_microcode(struct
 amdgpu_device *adev)
       struct amdgpu_firmware_info *info = NULL;
       const struct common_firmware_header *header = NULL;
 
+       if (amdgpu_sriov_vf(adev) && (adev->asic_type ==
 CHIP_SIENNA_CICHLID))
+               return 0;
+
       DRM_DEBUG("\n");
       switch (adev->asic_type) {
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +3 -1
index cf999b7a2164..31f05d96586c 100644
@@ -847,7 +847,9 @@ static int smu_sw_init(void *handle)
       smu->smu_dpm.dpm_level = AMD_DPM_FORCED_LEVEL_AUTO;
       smu->smu_dpm.requested_dpm_level =
 AMD_DPM_FORCED_LEVEL_AUTO;
 
-       if (!amdgpu_sriov_vf(adev) || (adev->asic_type != CHIP_NAVI12)) {
+       if (!amdgpu_sriov_vf(adev) ||
+                       ((adev->asic_type != CHIP_NAVI12) &&
+                       (adev->asic_type != CHIP_SIENNA_CICHLID))) {
               ret = smu_init_microcode(smu);
               if (ret) {
                       dev_err(adev->dev, "Failed to load smu firmware!\n");
Quoted 1 line

--

It's not good to keep adding ASIC checks in the generic interface code. Move this check to smuv11.

Thanks,
Lijo

Quoted 12 lines

2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.f
reedesktop.org%2Fmailman%2Flistinfo%2Famd- gfx&amp;data=04%7C01%7Clijo.lazar%40amd.com%7C0a496c71fa1d4bc6a872 08d89fddf683%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637435 122965129344%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQ IjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=i1y6snfi 3bnQVHOuVGfMqjSG%2FsBLYtxLkrnT9PV4%2FbU%3D&amp;reserved=0

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

#2 lore raw

[AMD Public Use]

Hi Lijo,

Good point, I will modify and send patch version two.

Regards,
Stanley

Quoted 84 lines

-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Monday, December 14, 2020 12:01 PM
To: Yang, Stanley <[email protected]>; [email protected]
Cc: Yang, Stanley <[email protected]>; Jian, Jane <[email protected]>
Subject: RE: [PATCH 1/1] drm/amdgpu: skip load smu and sdma microcode on sriov for SIENNA_CICHLID

[AMD Public Use]

Quoted 44 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Stanley.Yang
Sent: Monday, December 14, 2020 8:41 AM
To: [email protected]
Cc: Yang, Stanley <[email protected]>; Jian, Jane <[email protected]>
Subject: [PATCH 1/1] drm/amdgpu: skip load smu and sdma microcode on sriov for SIENNA_CICHLID

[CAUTION: External Email]

skip load smu and sdma fw on sriov due to smc, sos, ta and asd fw have been skipped for SIENNA_CICHLID.

---
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 3 +++
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 4 +++-

2 files changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c +3 -0
index 39e17aae655f..87566dee048d 100644
@@ -153,6 +153,9 @@ static int sdma_v5_2_init_microcode(struct
 amdgpu_device *adev)
       struct amdgpu_firmware_info *info = NULL;
       const struct common_firmware_header *header = NULL;
 
+       if (amdgpu_sriov_vf(adev) && (adev->asic_type ==
 CHIP_SIENNA_CICHLID))
+               return 0;
+
       DRM_DEBUG("\n");
       switch (adev->asic_type) {
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +0 -0
index cf999b7a2164..31f05d96586c 100644

drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c static int smu_sw_init(void *handle) · line 848

Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +0 -0
@@ -847,7 +847,9 @@ static int smu_sw_init(void *handle)
       smu->smu_dpm.dpm_level = AMD_DPM_FORCED_LEVEL_AUTO;
       smu->smu_dpm.requested_dpm_level =

AMD_DPM_FORCED_LEVEL_AUTO;

drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c static int smu_sw_init(void *handle)

Quoted 10 lines
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +3 -2
-       if (!amdgpu_sriov_vf(adev) || (adev->asic_type != CHIP_NAVI12)) {
+       if (!amdgpu_sriov_vf(adev) ||
+                       ((adev->asic_type != CHIP_NAVI12) &&
+                       (adev->asic_type != CHIP_SIENNA_CICHLID))) {
               ret = smu_init_microcode(smu);
               if (ret) {
                       dev_err(adev->dev, "Failed to load smu
 firmware!\n");
--

It's not good to keep adding ASIC checks in the generic interface code. Move this check to smuv11.

Thanks,
Lijo

Quoted 6 lines

2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist

s

Quoted 3 lines

.f
reedesktop.org%2Fmailman%2Flistinfo%2Famd- gfx&amp;data=04%7C01%7Clijo.lazar%40amd.com%7C0a496c71fa1d4bc6a8

Quoted 8 lines

72

Quoted 1 line

08d89fddf683%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C6374

35

Quoted 1 line

122965129344%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLC

JQ

Quoted 1 line

IjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=i1y6s

nfi

Quoted 1 line

3bnQVHOuVGfMqjSG%2FsBLYtxLkrnT9PV4%2FbU%3D&amp;reserved=0

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