Skip to contentSkip to conversation

drm/amdgpu: only skip smc sdma sos ta and asd fw in SRIOV for navi12

PATCH Superseded Stanley.Yang 2 participants 3 messages Nov 23, 2020 – Nov 24, 2020

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: only skip smc sdma sos ta and asd fw in SRIOV for navi12

The KFDTopologyTest.BasicTest will failed if skip smc, sdma, sos, ta and asd fw in SRIOV for vega10, so adjust above fw and skip load them in SRIOV only for navi12.

Change-Id Id354be93723d7b5d769d73dc67c596af300305af
---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c                  | 2 +-
 drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c                  | 2 +-
 drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c                  | 2 +-
 drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c | 3 ++-
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c               | 2 +-
 5 files changed, 6 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +1 -1
index 16b551f330a4..7e2f063120d8 100644
@@ -593,7 +593,7 @@ static int sdma_v4_0_init_microcode(struct amdgpu_device *adev)
 	struct amdgpu_firmware_info *info = NULL;
 	const struct common_firmware_header *header = NULL;
 
-	if (amdgpu_sriov_vf(adev))
+	if (amdgpu_sriov_vf(adev) && (adev->asic_type == CHIP_NAVI12))
 		return 0;
 
 	DRM_DEBUG("\n");
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +1 -1
index 9c72b95b7463..fad1cc394219 100644
@@ -203,7 +203,7 @@ static int sdma_v5_0_init_microcode(struct amdgpu_device *adev)
 	const struct common_firmware_header *header = NULL;
 	const struct sdma_firmware_header_v1_0 *hdr;
 
-	if (amdgpu_sriov_vf(adev))
+	if (amdgpu_sriov_vf(adev) && (adev->asic_type == CHIP_NAVI12))
 		return 0;
 
 	DRM_DEBUG("\n");
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c +1 -1
index cb5a6f1437f8..674bc88c3ec1 100644
@@ -153,7 +153,7 @@ 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))
+	if (amdgpu_sriov_vf(adev) && (adev->asic_type == CHIP_NAVI12))
 		return 0;
 
 	DRM_DEBUG("\n");
drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c +2 -1
index daf122f24f23..192149e94f6c 100644
@@ -208,8 +208,9 @@ static int vega10_smu_init(struct pp_hwmgr *hwmgr)
 	unsigned long tools_size;
 	int ret;
 	struct cgs_firmware_info info = {0};
+	struct amdgpu_device *adev = hwmgr->adev;
 
-	if (!amdgpu_sriov_vf((struct amdgpu_device *)hwmgr->adev)) {
+	if (!amdgpu_sriov_vf(adev) || (adev->asic_type != CHIP_NAVI12)) {
 		ret = cgs_get_firmware_info(hwmgr->device,
 						CGS_UCODE_ID_SMU,
 						&info);
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +1 -1
index 1904df5a3e20..80c0bfaed097 100644
@@ -847,7 +847,7 @@ 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)) {
+	if (!amdgpu_sriov_vf(adev) || (adev->asic_type != CHIP_NAVI12)) {
 		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]

@@ -593,7 +593,7 @@ static int sdma_v4_0_init_microcode(struct amdgpu_device *adev)
struct amdgpu_firmware_info *info = NULL;
const struct common_firmware_header *header = NULL;

- if (amdgpu_sriov_vf(adev))
+ if (amdgpu_sriov_vf(adev) && (adev->asic_type == CHIP_NAVI12))

Navi12 doesn't integrate sdma v4. Why we need to check Navi12 in sdma v4 function.

Regards,
Hawking

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Stanley.Yang
Sent: Monday, November 23, 2020 21:19
To: [email protected]; Chen, JingWen <[email protected]>
Cc: Yang, Stanley <[email protected]>
Subject: [PATCH 1/1] drm/amdgpu: only skip smc sdma sos ta and asd fw in SRIOV for navi12

The KFDTopologyTest.BasicTest will failed if skip smc, sdma, sos, ta and asd fw in SRIOV for vega10, so adjust above fw and skip load them in SRIOV only for navi12.

Change-Id Id354be93723d7b5d769d73dc67c596af300305af
---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c                  | 2 +-
 drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c                  | 2 +-
 drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c                  | 2 +-
 drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c | 3 ++-
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c               | 2 +-
 5 files changed, 6 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +1 -1
index 16b551f330a4..7e2f063120d8 100644
@@ -593,7 +593,7 @@ static int sdma_v4_0_init_microcode(struct amdgpu_device *adev)
 	struct amdgpu_firmware_info *info = NULL;
 	const struct common_firmware_header *header = NULL;
 
-	if (amdgpu_sriov_vf(adev))
+	if (amdgpu_sriov_vf(adev) && (adev->asic_type == CHIP_NAVI12))
 		return 0;
 
 	DRM_DEBUG("\n");
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +1 -1
index 9c72b95b7463..fad1cc394219 100644
@@ -203,7 +203,7 @@ static int sdma_v5_0_init_microcode(struct amdgpu_device *adev)
 	const struct common_firmware_header *header = NULL;
 	const struct sdma_firmware_header_v1_0 *hdr;
 
-	if (amdgpu_sriov_vf(adev))
+	if (amdgpu_sriov_vf(adev) && (adev->asic_type == CHIP_NAVI12))
 		return 0;
 
 	DRM_DEBUG("\n");
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c +1 -1
index cb5a6f1437f8..674bc88c3ec1 100644
@@ -153,7 +153,7 @@ 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))
+	if (amdgpu_sriov_vf(adev) && (adev->asic_type == CHIP_NAVI12))
 		return 0;
 
 	DRM_DEBUG("\n");
drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c +2 -1
index daf122f24f23..192149e94f6c 100644
@@ -208,8 +208,9 @@ static int vega10_smu_init(struct pp_hwmgr *hwmgr)
 	unsigned long tools_size;
 	int ret;
 	struct cgs_firmware_info info = {0};
+	struct amdgpu_device *adev = hwmgr->adev;
 
-	if (!amdgpu_sriov_vf((struct amdgpu_device *)hwmgr->adev)) {
+	if (!amdgpu_sriov_vf(adev) || (adev->asic_type != CHIP_NAVI12)) {
 		ret = cgs_get_firmware_info(hwmgr->device,
 						CGS_UCODE_ID_SMU,
 						&info);
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +1 -1
index 1904df5a3e20..80c0bfaed097 100644
@@ -847,7 +847,7 @@ 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)) {
+	if (!amdgpu_sriov_vf(adev) || (adev->asic_type != CHIP_NAVI12)) {
 		ret = smu_init_microcode(smu);
 		if (ret) {
 			dev_err(adev->dev, "Failed to load smu firmware!\n");

--
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=04%7C01%7Chawking.zhang%40amd.com%7C11dc63c434444a86675608d88fb26e4c%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637417343805220247%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=SUkSApUQErJH80J5XELokS%2FuIDKMDsqwmBPVrfyvSOA%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 Hawking,

Thanks for your reminding, it is unnecessary to check navi12 asic type in sdma v4, I will update patch and resend it.

Regards,
Stanley

Quoted 129 lines

-----Original Message-----
From: Zhang, Hawking <[email protected]>
Sent: Monday, November 23, 2020 9:31 PM
To: Yang, Stanley <[email protected]>; [email protected]; Chen, JingWen <[email protected]>
Cc: Yang, Stanley <[email protected]>
Subject: RE: [PATCH 1/1] drm/amdgpu: only skip smc sdma sos ta and asd fw in SRIOV for navi12

[AMD Public Use]

drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +1 -1
@@ -593,7 +593,7 @@ static int sdma_v4_0_init_microcode(struct
 amdgpu_device *adev)
 	struct amdgpu_firmware_info *info = NULL;
 	const struct common_firmware_header *header = NULL;
 
-	if (amdgpu_sriov_vf(adev))
+	if (amdgpu_sriov_vf(adev) && (adev->asic_type == CHIP_NAVI12))
 

Navi12 doesn't integrate sdma v4. Why we need to check Navi12 in sdma v4 function.

Regards,
Hawking

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Stanley.Yang
Sent: Monday, November 23, 2020 21:19
To: [email protected]; Chen, JingWen <[email protected]>
Cc: Yang, Stanley <[email protected]>
Subject: [PATCH 1/1] drm/amdgpu: only skip smc sdma sos ta and asd fw in SRIOV for navi12

The KFDTopologyTest.BasicTest will failed if skip smc, sdma, sos, ta and asd fw in SRIOV for vega10, so adjust above fw and skip load them in SRIOV only for navi12.

Change-Id Id354be93723d7b5d769d73dc67c596af300305af
---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c                  | 2 +-
 drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c                  | 2 +-
 drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c                  | 2 +-
 drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c | 3 ++-
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c               | 2 +-
 5 files changed, 6 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +1 -1
index 16b551f330a4..7e2f063120d8 100644
@@ -593,7 +593,7 @@ static int sdma_v4_0_init_microcode(struct
 amdgpu_device *adev)
 	struct amdgpu_firmware_info *info = NULL;
 	const struct common_firmware_header *header = NULL;
 
-	if (amdgpu_sriov_vf(adev))
+	if (amdgpu_sriov_vf(adev) && (adev->asic_type == CHIP_NAVI12))
 		return 0;
 
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +0 -0
 	DRM_DEBUG("\n");
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +1 -1
index 9c72b95b7463..fad1cc394219 100644
@@ -203,7 +203,7 @@ static int sdma_v5_0_init_microcode(struct
 amdgpu_device *adev)
 	const struct common_firmware_header *header = NULL;
 	const struct sdma_firmware_header_v1_0 *hdr;
 
-	if (amdgpu_sriov_vf(adev))
+	if (amdgpu_sriov_vf(adev) && (adev->asic_type == CHIP_NAVI12))
 		return 0;
 
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c +0 -0
 	DRM_DEBUG("\n");
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c +1 -1
index cb5a6f1437f8..674bc88c3ec1 100644
@@ -153,7 +153,7 @@ 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))
+	if (amdgpu_sriov_vf(adev) && (adev->asic_type == CHIP_NAVI12))
 		return 0;
 
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c +0 -0
 	DRM_DEBUG("\n");
drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c +2 -1
index daf122f24f23..192149e94f6c 100644
@@ -208,8 +208,9 @@ static int vega10_smu_init(struct pp_hwmgr *hwmgr)
 	unsigned long tools_size;
 	int ret;
 	struct cgs_firmware_info info = {0};
+	struct amdgpu_device *adev = hwmgr->adev;
 
-	if (!amdgpu_sriov_vf((struct amdgpu_device *)hwmgr->adev)) {
+	if (!amdgpu_sriov_vf(adev) || (adev->asic_type != CHIP_NAVI12)) {
 		ret = cgs_get_firmware_info(hwmgr->device,
 						CGS_UCODE_ID_SMU,
 						&info);
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +1 -1
index 1904df5a3e20..80c0bfaed097 100644
@@ -847,7 +847,7 @@ 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)) {
+	if (!amdgpu_sriov_vf(adev) || (adev->asic_type != CHIP_NAVI12)) {
 		ret = smu_init_microcode(smu);
 		if (ret) {

dev_err(adev->dev, "Failed to load smu
firmware!\n");
--
2.17.1

Quoted 11 lines

_______________________________________________
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=04%7C01%7Chawking.zhang%40amd.com%7C11dc63c434444 a86675608d88fb26e4c%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0% 7C637417343805220247%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAw MDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sda ta=SUkSApUQErJH80J5XELokS%2FuIDKMDsqwmBPVrfyvSOA%3D&amp;rese rved=0

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