All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 1/1] drm/amdgpu: only skip smc sdma sos ta and asd fw in SRIOV for navi12
@ 2020-11-24  9:49 Stanley.Yang
  2020-11-24 13:47 ` Chen, Guchun
  0 siblings, 1 reply; 5+ messages in thread
From: Stanley.Yang @ 2020-11-24  9:49 UTC (permalink / raw)
  To: amd-gfx, Jingwen.Chen2; +Cc: Stanley.Yang

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.

v2: remove unnecessary asic type check.

Signed-off-by: Stanley.Yang <Stanley.Yang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c              |  3 ---
 drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c              |  2 +-
 drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c              |  3 ---
 .../gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c | 13 ++++++-------
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c           |  2 +-
 5 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
index 16b551f330a4..8309dd95aa48 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
@@ -593,9 +593,6 @@ 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))
-		return 0;
-
 	DRM_DEBUG("\n");
 
 	switch (adev->asic_type) {
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
index 9c72b95b7463..fad1cc394219 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
@@ -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");
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
index cb5a6f1437f8..5ea11a0f568f 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
@@ -153,9 +153,6 @@ 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))
-		return 0;
-
 	DRM_DEBUG("\n");
 
 	switch (adev->asic_type) {
diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c
index daf122f24f23..e2192d8762a4 100644
--- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c
+++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c
@@ -208,14 +208,13 @@ 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)) {
-		ret = cgs_get_firmware_info(hwmgr->device,
-						CGS_UCODE_ID_SMU,
-						&info);
-		if (ret || !info.kptr)
-			return -EINVAL;
-	}
+	ret = cgs_get_firmware_info(hwmgr->device,
+					CGS_UCODE_ID_SMU,
+					&info);
+	if (ret || !info.kptr)
+		return -EINVAL;
 
 	priv = kzalloc(sizeof(struct vega10_smumgr), GFP_KERNEL);
 
diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index 1904df5a3e20..80c0bfaed097 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -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
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [PATCH V2 1/1] drm/amdgpu: only skip smc sdma sos ta and asd fw in SRIOV for navi12
  2020-11-24  9:49 [PATCH V2 1/1] drm/amdgpu: only skip smc sdma sos ta and asd fw in SRIOV for navi12 Stanley.Yang
@ 2020-11-24 13:47 ` Chen, Guchun
  2020-11-24 14:36   ` Yang, Stanley
  0 siblings, 1 reply; 5+ messages in thread
From: Chen, Guchun @ 2020-11-24 13:47 UTC (permalink / raw)
  To: Yang, Stanley, amd-gfx, Chen, JingWen; +Cc: Yang, Stanley

[AMD Public Use]

--- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c
+++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c
@@ -208,14 +208,13 @@ 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;

Why add this local variable? Looks no one is using it.

Regards,
Guchun

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Stanley.Yang
Sent: Tuesday, November 24, 2020 5:49 PM
To: amd-gfx@lists.freedesktop.org; Chen, JingWen <JingWen.Chen2@amd.com>
Cc: Yang, Stanley <Stanley.Yang@amd.com>
Subject: [PATCH V2 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.

v2: remove unnecessary asic type check.

Signed-off-by: Stanley.Yang <Stanley.Yang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c              |  3 ---
 drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c              |  2 +-
 drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c              |  3 ---
 .../gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c | 13 ++++++-------
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c           |  2 +-
 5 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
index 16b551f330a4..8309dd95aa48 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
@@ -593,9 +593,6 @@ 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))
-		return 0;
-
 	DRM_DEBUG("\n");
 
 	switch (adev->asic_type) {
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
index 9c72b95b7463..fad1cc394219 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
@@ -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");
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
index cb5a6f1437f8..5ea11a0f568f 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
@@ -153,9 +153,6 @@ 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))
-		return 0;
-
 	DRM_DEBUG("\n");
 
 	switch (adev->asic_type) {
diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c
index daf122f24f23..e2192d8762a4 100644
--- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c
+++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c
@@ -208,14 +208,13 @@ 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)) {
-		ret = cgs_get_firmware_info(hwmgr->device,
-						CGS_UCODE_ID_SMU,
-						&info);
-		if (ret || !info.kptr)
-			return -EINVAL;
-	}
+	ret = cgs_get_firmware_info(hwmgr->device,
+					CGS_UCODE_ID_SMU,
+					&info);
+	if (ret || !info.kptr)
+		return -EINVAL;
 
 	priv = kzalloc(sizeof(struct vega10_smumgr), GFP_KERNEL);
 
diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index 1904df5a3e20..80c0bfaed097 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -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
amd-gfx@lists.freedesktop.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Cguchun.chen%40amd.com%7Cdf14a0bc671547d5315708d8905e330b%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637418081554620468%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=BNU5d%2FQSOnNZNYHQ3ZjBjIubUl1wa6lmkaWBf2XuIjw%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [PATCH V2 1/1] drm/amdgpu: only skip smc sdma sos ta and asd fw in SRIOV for navi12
  2020-11-24 13:47 ` Chen, Guchun
@ 2020-11-24 14:36   ` Yang, Stanley
  2020-11-25  6:45     ` Chen, Guchun
  0 siblings, 1 reply; 5+ messages in thread
From: Yang, Stanley @ 2020-11-24 14:36 UTC (permalink / raw)
  To: Chen, Guchun, amd-gfx, Chen, JingWen

[AMD Public Use]

Hi Guchun,

This is an oversight. I forgot to remove it from patch version first.

Regards,
Stanley
> -----Original Message-----
> From: Chen, Guchun <Guchun.Chen@amd.com>
> Sent: Tuesday, November 24, 2020 9:47 PM
> To: Yang, Stanley <Stanley.Yang@amd.com>; amd-gfx@lists.freedesktop.org;
> Chen, JingWen <JingWen.Chen2@amd.com>
> Cc: Yang, Stanley <Stanley.Yang@amd.com>
> Subject: RE: [PATCH V2 1/1] drm/amdgpu: only skip smc sdma sos ta and asd
> fw in SRIOV for navi12
> 
> [AMD Public Use]
> 
> --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c
> @@ -208,14 +208,13 @@ 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;
> 
> Why add this local variable? Looks no one is using it.
> 
> Regards,
> Guchun
> 
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of
> Stanley.Yang
> Sent: Tuesday, November 24, 2020 5:49 PM
> To: amd-gfx@lists.freedesktop.org; Chen, JingWen
> <JingWen.Chen2@amd.com>
> Cc: Yang, Stanley <Stanley.Yang@amd.com>
> Subject: [PATCH V2 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.
> 
> v2: remove unnecessary asic type check.
> 
> Signed-off-by: Stanley.Yang <Stanley.Yang@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c              |  3 ---
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c              |  2 +-
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c              |  3 ---
>  .../gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c | 13 ++++++---
> ----
>  drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c           |  2 +-
>  5 files changed, 8 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> index 16b551f330a4..8309dd95aa48 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> @@ -593,9 +593,6 @@ 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))
> -		return 0;
> -
>  	DRM_DEBUG("\n");
> 
>  	switch (adev->asic_type) {
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> index 9c72b95b7463..fad1cc394219 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> @@ -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");
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> index cb5a6f1437f8..5ea11a0f568f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> @@ -153,9 +153,6 @@ 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))
> -		return 0;
> -
>  	DRM_DEBUG("\n");
> 
>  	switch (adev->asic_type) {
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c
> b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c
> index daf122f24f23..e2192d8762a4 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c
> @@ -208,14 +208,13 @@ 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)) {
> -		ret = cgs_get_firmware_info(hwmgr->device,
> -						CGS_UCODE_ID_SMU,
> -						&info);
> -		if (ret || !info.kptr)
> -			return -EINVAL;
> -	}
> +	ret = cgs_get_firmware_info(hwmgr->device,
> +					CGS_UCODE_ID_SMU,
> +					&info);
> +	if (ret || !info.kptr)
> +		return -EINVAL;
> 
>  	priv = kzalloc(sizeof(struct vega10_smumgr), GFP_KERNEL);
> 
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> index 1904df5a3e20..80c0bfaed097 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> @@ -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
> amd-gfx@lists.freedesktop.org
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.f
> reedesktop.org%2Fmailman%2Flistinfo%2Famd-
> gfx&amp;data=04%7C01%7Cguchun.chen%40amd.com%7Cdf14a0bc671547d
> 5315708d8905e330b%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%
> 7C637418081554620468%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjA
> wMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;s
> data=BNU5d%2FQSOnNZNYHQ3ZjBjIubUl1wa6lmkaWBf2XuIjw%3D&amp;res
> erved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH V2 1/1] drm/amdgpu: only skip smc sdma sos ta and asd fw in SRIOV for navi12
  2020-11-24 14:36   ` Yang, Stanley
@ 2020-11-25  6:45     ` Chen, Guchun
  2020-11-25  6:53       ` Yang, Stanley
  0 siblings, 1 reply; 5+ messages in thread
From: Chen, Guchun @ 2020-11-25  6:45 UTC (permalink / raw)
  To: Yang, Stanley, amd-gfx, Chen, JingWen

[AMD Public Use]

Okay. With that fixed, the patch is:

Reviewed-by: Guchun Chen <guchun.chen@amd.com>

Regards,
Guchun

-----Original Message-----
From: Yang, Stanley <Stanley.Yang@amd.com> 
Sent: Tuesday, November 24, 2020 10:37 PM
To: Chen, Guchun <Guchun.Chen@amd.com>; amd-gfx@lists.freedesktop.org; Chen, JingWen <JingWen.Chen2@amd.com>
Subject: RE: [PATCH V2 1/1] drm/amdgpu: only skip smc sdma sos ta and asd fw in SRIOV for navi12

[AMD Public Use]

Hi Guchun,

This is an oversight. I forgot to remove it from patch version first.

Regards,
Stanley
> -----Original Message-----
> From: Chen, Guchun <Guchun.Chen@amd.com>
> Sent: Tuesday, November 24, 2020 9:47 PM
> To: Yang, Stanley <Stanley.Yang@amd.com>; 
> amd-gfx@lists.freedesktop.org; Chen, JingWen <JingWen.Chen2@amd.com>
> Cc: Yang, Stanley <Stanley.Yang@amd.com>
> Subject: RE: [PATCH V2 1/1] drm/amdgpu: only skip smc sdma sos ta and 
> asd fw in SRIOV for navi12
> 
> [AMD Public Use]
> 
> --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c
> @@ -208,14 +208,13 @@ 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;
> 
> Why add this local variable? Looks no one is using it.
> 
> Regards,
> Guchun
> 
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of 
> Stanley.Yang
> Sent: Tuesday, November 24, 2020 5:49 PM
> To: amd-gfx@lists.freedesktop.org; Chen, JingWen 
> <JingWen.Chen2@amd.com>
> Cc: Yang, Stanley <Stanley.Yang@amd.com>
> Subject: [PATCH V2 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.
> 
> v2: remove unnecessary asic type check.
> 
> Signed-off-by: Stanley.Yang <Stanley.Yang@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c              |  3 ---
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c              |  2 +-
>  drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c              |  3 ---
>  .../gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c | 13 ++++++---
> ----
>  drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c           |  2 +-
>  5 files changed, 8 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> index 16b551f330a4..8309dd95aa48 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> @@ -593,9 +593,6 @@ 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))
> -		return 0;
> -
>  	DRM_DEBUG("\n");
> 
>  	switch (adev->asic_type) {
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> index 9c72b95b7463..fad1cc394219 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> @@ -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");
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> index cb5a6f1437f8..5ea11a0f568f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> @@ -153,9 +153,6 @@ 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))
> -		return 0;
> -
>  	DRM_DEBUG("\n");
> 
>  	switch (adev->asic_type) {
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c
> b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c
> index daf122f24f23..e2192d8762a4 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c
> @@ -208,14 +208,13 @@ 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)) {
> -		ret = cgs_get_firmware_info(hwmgr->device,
> -						CGS_UCODE_ID_SMU,
> -						&info);
> -		if (ret || !info.kptr)
> -			return -EINVAL;
> -	}
> +	ret = cgs_get_firmware_info(hwmgr->device,
> +					CGS_UCODE_ID_SMU,
> +					&info);
> +	if (ret || !info.kptr)
> +		return -EINVAL;
> 
>  	priv = kzalloc(sizeof(struct vega10_smumgr), GFP_KERNEL);
> 
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> index 1904df5a3e20..80c0bfaed097 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> @@ -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
> amd-gfx@lists.freedesktop.org
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
> s.f
> reedesktop.org%2Fmailman%2Flistinfo%2Famd-
> gfx&amp;data=04%7C01%7Cguchun.chen%40amd.com%7Cdf14a0bc671547d
> 5315708d8905e330b%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%
> 7C637418081554620468%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjA
> wMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;s
> data=BNU5d%2FQSOnNZNYHQ3ZjBjIubUl1wa6lmkaWBf2XuIjw%3D&amp;res
> erved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH V2 1/1] drm/amdgpu: only skip smc sdma sos ta and asd fw in SRIOV for navi12
  2020-11-25  6:45     ` Chen, Guchun
@ 2020-11-25  6:53       ` Yang, Stanley
  0 siblings, 0 replies; 5+ messages in thread
From: Yang, Stanley @ 2020-11-25  6:53 UTC (permalink / raw)
  To: Chen, Guchun, amd-gfx, Chen, JingWen

[AMD Public Use]

Hi Guchun,

Thanks for your review.

Regards,
Stanley

> -----Original Message-----
> From: Chen, Guchun <Guchun.Chen@amd.com>
> Sent: Wednesday, November 25, 2020 2:45 PM
> To: Yang, Stanley <Stanley.Yang@amd.com>; amd-gfx@lists.freedesktop.org;
> Chen, JingWen <JingWen.Chen2@amd.com>
> Subject: RE: [PATCH V2 1/1] drm/amdgpu: only skip smc sdma sos ta and asd
> fw in SRIOV for navi12
> 
> [AMD Public Use]
> 
> Okay. With that fixed, the patch is:
> 
> Reviewed-by: Guchun Chen <guchun.chen@amd.com>
> 
> Regards,
> Guchun
> 
> -----Original Message-----
> From: Yang, Stanley <Stanley.Yang@amd.com>
> Sent: Tuesday, November 24, 2020 10:37 PM
> To: Chen, Guchun <Guchun.Chen@amd.com>; amd-
> gfx@lists.freedesktop.org; Chen, JingWen <JingWen.Chen2@amd.com>
> Subject: RE: [PATCH V2 1/1] drm/amdgpu: only skip smc sdma sos ta and asd
> fw in SRIOV for navi12
> 
> [AMD Public Use]
> 
> Hi Guchun,
> 
> This is an oversight. I forgot to remove it from patch version first.
> 
> Regards,
> Stanley
> > -----Original Message-----
> > From: Chen, Guchun <Guchun.Chen@amd.com>
> > Sent: Tuesday, November 24, 2020 9:47 PM
> > To: Yang, Stanley <Stanley.Yang@amd.com>;
> > amd-gfx@lists.freedesktop.org; Chen, JingWen
> <JingWen.Chen2@amd.com>
> > Cc: Yang, Stanley <Stanley.Yang@amd.com>
> > Subject: RE: [PATCH V2 1/1] drm/amdgpu: only skip smc sdma sos ta and
> > asd fw in SRIOV for navi12
> >
> > [AMD Public Use]
> >
> > --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c
> > +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c
> > @@ -208,14 +208,13 @@ 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;
> >
> > Why add this local variable? Looks no one is using it.
> >
> > Regards,
> > Guchun
> >
> > -----Original Message-----
> > From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of
> > Stanley.Yang
> > Sent: Tuesday, November 24, 2020 5:49 PM
> > To: amd-gfx@lists.freedesktop.org; Chen, JingWen
> > <JingWen.Chen2@amd.com>
> > Cc: Yang, Stanley <Stanley.Yang@amd.com>
> > Subject: [PATCH V2 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.
> >
> > v2: remove unnecessary asic type check.
> >
> > Signed-off-by: Stanley.Yang <Stanley.Yang@amd.com>
> > ---
> >  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c              |  3 ---
> >  drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c              |  2 +-
> >  drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c              |  3 ---
> >  .../gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c | 13
> ++++++---
> > ----
> >  drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c           |  2 +-
> >  5 files changed, 8 insertions(+), 15 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> > b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> > index 16b551f330a4..8309dd95aa48 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> > @@ -593,9 +593,6 @@ 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))
> > -		return 0;
> > -
> >  	DRM_DEBUG("\n");
> >
> >  	switch (adev->asic_type) {
> > diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> > b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> > index 9c72b95b7463..fad1cc394219 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> > @@ -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");
> > diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> > b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> > index cb5a6f1437f8..5ea11a0f568f 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> > @@ -153,9 +153,6 @@ 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))
> > -		return 0;
> > -
> >  	DRM_DEBUG("\n");
> >
> >  	switch (adev->asic_type) {
> > diff --git
> a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c
> > b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c
> > index daf122f24f23..e2192d8762a4 100644
> > --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c
> > +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c
> > @@ -208,14 +208,13 @@ 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)) {
> > -		ret = cgs_get_firmware_info(hwmgr->device,
> > -						CGS_UCODE_ID_SMU,
> > -						&info);
> > -		if (ret || !info.kptr)
> > -			return -EINVAL;
> > -	}
> > +	ret = cgs_get_firmware_info(hwmgr->device,
> > +					CGS_UCODE_ID_SMU,
> > +					&info);
> > +	if (ret || !info.kptr)
> > +		return -EINVAL;
> >
> >  	priv = kzalloc(sizeof(struct vega10_smumgr), GFP_KERNEL);
> >
> > diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> > b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> > index 1904df5a3e20..80c0bfaed097 100644
> > --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> > +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> > @@ -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
> > amd-gfx@lists.freedesktop.org
> > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
> > s.f
> > reedesktop.org%2Fmailman%2Flistinfo%2Famd-
> >
> gfx&amp;data=04%7C01%7Cguchun.chen%40amd.com%7Cdf14a0bc671547d
> > 5315708d8905e330b%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%
> > 7C637418081554620468%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjA
> >
> wMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;s
> >
> data=BNU5d%2FQSOnNZNYHQ3ZjBjIubUl1wa6lmkaWBf2XuIjw%3D&amp;res
> > erved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-25  6:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-24  9:49 [PATCH V2 1/1] drm/amdgpu: only skip smc sdma sos ta and asd fw in SRIOV for navi12 Stanley.Yang
2020-11-24 13:47 ` Chen, Guchun
2020-11-24 14:36   ` Yang, Stanley
2020-11-25  6:45     ` Chen, Guchun
2020-11-25  6:53       ` Yang, Stanley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.