Skip to contentSkip to conversation

amd/amdgpu/sriov enable onevf mode for ARCTURUS VF

PATCH Zhang, Jack (Jian) 2 participants 4 messages Dec 27, 2019 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

-----Original Message-----
From: Jack Zhang <[email protected]>
Sent: Friday, December 27, 2019 2:57 PM
To: [email protected]
Cc: Zhang, Jack (Jian) <[email protected]>
Subject: [PATCH 1/2] amd/amdgpu/sriov enable onevf mode for ARCTURUS VF

Before, initialization of smu ip block would be skipped for sriov ASICs. But if there's only one VF being used, guest driver should be able to dump some HW info such as clks, temperature,etc.

To solve this, now after onevf mode is enabled, host driver will notify guest. If it's onevf mode, guest will do smu hw_init and skip some steps in normal smu hw_init flow because host driver has already done it for smu.

With this fix, guest app can talk with smu and dump hw information from smu.

v2: refine the logic for pm_enabled.Skip hw_init by not changing pm_enabled.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c    |  3 +-
 drivers/gpu/drm/amd/amdgpu/soc15.c         |  3 +-
 drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 45 +++++++++++++++++-------------
 3 files changed, 29 insertions(+), 22 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +2 -1
index 8469834..08130a6 100644
@@ -1448,7 +1448,8 @@ static int psp_np_fw_load(struct psp_context *psp)
                     || ucode->ucode_id == AMDGPU_UCODE_ID_RLC_G
 	            || ucode->ucode_id == AMDGPU_UCODE_ID_RLC_RESTORE_LIST_CNTL
 	            || ucode->ucode_id == AMDGPU_UCODE_ID_RLC_RESTORE_LIST_GPM_MEM
-	            || ucode->ucode_id == AMDGPU_UCODE_ID_RLC_RESTORE_LIST_SRM_MEM))
+	            || ucode->ucode_id == AMDGPU_UCODE_ID_RLC_RESTORE_LIST_SRM_MEM
+	            || ucode->ucode_id == AMDGPU_UCODE_ID_SMC))
 			/*skip ucode loading in SRIOV VF */
 			continue;
 
drivers/gpu/drm/amd/amdgpu/soc15.c +1 -2
index b53d401..a271496 100644
@@ -827,8 +827,7 @@ int soc15_set_ip_blocks(struct amdgpu_device *adev)
 			amdgpu_device_ip_block_add(adev, &dce_virtual_ip_block);
 		amdgpu_device_ip_block_add(adev, &gfx_v9_0_ip_block);
 		amdgpu_device_ip_block_add(adev, &sdma_v4_0_ip_block);
-		if (!amdgpu_sriov_vf(adev))
-			amdgpu_device_ip_block_add(adev, &smu_v11_0_ip_block);
+		amdgpu_device_ip_block_add(adev, &smu_v11_0_ip_block);
 
 		if (amdgpu_sriov_vf(adev)) {
 			if (likely(adev->firmware.load_type == AMDGPU_FW_LOAD_PSP)) diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c

index 936c682..42c0a6d 100644

drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +26 -19

77 lines not on this page · raw message

--
2.7.4

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

#2 lore raw

Hi, all,

Here is some description about sriov and pp_one_vf mode:
1) amdgpu_sriov_vf marks if it is sriov or bare-metal. While amdgpu_sriov_is_pp_one_vf is a mode of sriov- It means there is only one VF generated by host driver.
2) Host administrator can determine “vf number” when host driver is loaded. If vf_num =1, host driver will notify guest driver it is under one vf mode --- pp_one_vf return true.
Otherwise, pp_one_vf return false. Without unloading guest driver and host driver, vf_num cannot be changed. So it is a static process.
3) Under pp_one_vf mode in sriov platform, guest driver will do smu hw_init, the goal of it is to let guest driver “talk” with smu by sending authorized smu messages. This will help user mode app to dump info like clks, temperature, GPU usage….
Currently we don’t support guest driver to write value to smu. We can only read smu information.
Besides, as host driver has already initialized smu hw such as loading smu firmware and and set some feature control modes, some hw init steps need to skip in guest driver, such as write pptable, load smc firmware.
4) At the same time, pp_one_vf mode need smu some firmware changes to open permission for certain messages in VF.

B.R.
Jack
-----Original Message-----
From: Zhang, Jack (Jian)
Sent: Friday, December 27, 2019 3:00 PM
To: Feng, Kenneth <[email protected]>; Deucher, Alexander <[email protected]>; Quan, Evan <[email protected]>; Wang, Kevin(Yang) <[email protected]>; Tao, Yintian <[email protected]>; Deng, Emily <[email protected]>; Min, Frank <[email protected]>; Liu, Monk <[email protected]>; [email protected]; Zhang, Jack (Jian) <[email protected]>
Subject: RE: [PATCH 1/2] amd/amdgpu/sriov enable onevf mode for ARCTURUS VF

-----Original Message-----
From: Jack Zhang <[email protected]>
Sent: Friday, December 27, 2019 2:57 PM
To: [email protected]
Cc: Zhang, Jack (Jian) <[email protected]>
Subject: [PATCH 1/2] amd/amdgpu/sriov enable onevf mode for ARCTURUS VF

Before, initialization of smu ip block would be skipped for sriov ASICs. But if there's only one VF being used, guest driver should be able to dump some HW info such as clks, temperature,etc.

To solve this, now after onevf mode is enabled, host driver will notify guest. If it's onevf mode, guest will do smu hw_init and skip some steps in normal smu hw_init flow because host driver has already done it for smu.

With this fix, guest app can talk with smu and dump hw information from smu.

v2: refine the logic for pm_enabled.Skip hw_init by not changing pm_enabled.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c    |  3 +-
 drivers/gpu/drm/amd/amdgpu/soc15.c         |  3 +-
 drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 45 +++++++++++++++++-------------
 3 files changed, 29 insertions(+), 22 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +2 -1
index 8469834..08130a6 100644
@@ -1448,7 +1448,8 @@ static int psp_np_fw_load(struct psp_context *psp)
                     || ucode->ucode_id == AMDGPU_UCODE_ID_RLC_G
 	            || ucode->ucode_id == AMDGPU_UCODE_ID_RLC_RESTORE_LIST_CNTL
 	            || ucode->ucode_id == AMDGPU_UCODE_ID_RLC_RESTORE_LIST_GPM_MEM
-	            || ucode->ucode_id == AMDGPU_UCODE_ID_RLC_RESTORE_LIST_SRM_MEM))
+	            || ucode->ucode_id == AMDGPU_UCODE_ID_RLC_RESTORE_LIST_SRM_MEM
+	            || ucode->ucode_id == AMDGPU_UCODE_ID_SMC))
 			/*skip ucode loading in SRIOV VF */
 			continue;
 
drivers/gpu/drm/amd/amdgpu/soc15.c +1 -2
index b53d401..a271496 100644
@@ -827,8 +827,7 @@ int soc15_set_ip_blocks(struct amdgpu_device *adev)
 			amdgpu_device_ip_block_add(adev, &dce_virtual_ip_block);
 		amdgpu_device_ip_block_add(adev, &gfx_v9_0_ip_block);
 		amdgpu_device_ip_block_add(adev, &sdma_v4_0_ip_block);
-		if (!amdgpu_sriov_vf(adev))
-			amdgpu_device_ip_block_add(adev, &smu_v11_0_ip_block);
+		amdgpu_device_ip_block_add(adev, &smu_v11_0_ip_block);
 
 		if (amdgpu_sriov_vf(adev)) {
 			if (likely(adev->firmware.load_type == AMDGPU_FW_LOAD_PSP)) diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c

index 936c682..42c0a6d 100644

drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +26 -19

77 lines not on this page · raw message

--
2.7.4

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

#3 lore raw
In reply to Zhang, Jack (Jian)

[AMD Official Use Only - Internal Distribution Only]

Quoted 105 lines

-----Original Message-----
From: Zhang, Jack (Jian) <[email protected]>
Sent: Friday, December 27, 2019 3:00 PM
To: Feng, Kenneth <[email protected]>; Deucher, Alexander <[email protected]>; Quan, Evan <[email protected]>; Wang, Kevin(Yang) <[email protected]>; Tao, Yintian <[email protected]>; Deng, Emily <[email protected]>; Min, Frank <[email protected]>; Liu, Monk <[email protected]>; [email protected]; Zhang, Jack (Jian) <[email protected]>
Subject: RE: [PATCH 1/2] amd/amdgpu/sriov enable onevf mode for ARCTURUS VF

-----Original Message-----
From: Jack Zhang <[email protected]>
Sent: Friday, December 27, 2019 2:57 PM
To: [email protected]
Cc: Zhang, Jack (Jian) <[email protected]>
Subject: [PATCH 1/2] amd/amdgpu/sriov enable onevf mode for ARCTURUS VF

Before, initialization of smu ip block would be skipped for sriov ASICs. But if there's only one VF being used, guest driver should be able to dump some HW info such as clks, temperature,etc.

To solve this, now after onevf mode is enabled, host driver will notify guest. If it's onevf mode, guest will do smu hw_init and skip some steps in normal smu hw_init flow because host driver has already done it for smu.

With this fix, guest app can talk with smu and dump hw information from smu.

v2: refine the logic for pm_enabled.Skip hw_init by not changing pm_enabled.

---

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c    |  3 +-
drivers/gpu/drm/amd/amdgpu/soc15.c         |  3 +-
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 45 +++++++++++++++++------
-------
3 files changed, 29 insertions(+), 22 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +0 -0
index 8469834..08130a6 100644
@@ -1448,7 +1448,8 @@ static int psp_np_fw_load(struct psp_context *psp)
                    || ucode->ucode_id == AMDGPU_UCODE_ID_RLC_G
 	            || ucode->ucode_id ==

AMDGPU_UCODE_ID_RLC_RESTORE_LIST_CNTL

	            || ucode->ucode_id ==

AMDGPU_UCODE_ID_RLC_RESTORE_LIST_GPM_MEM

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +0 -1
-	            || ucode->ucode_id ==

AMDGPU_UCODE_ID_RLC_RESTORE_LIST_SRM_MEM))

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1 -0
+	            || ucode->ucode_id ==

AMDGPU_UCODE_ID_RLC_RESTORE_LIST_SRM_MEM

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1 -0
+	            || ucode->ucode_id == AMDGPU_UCODE_ID_SMC))
			/*skip ucode loading in SRIOV VF */
			continue;
drivers/gpu/drm/amd/amdgpu/soc15.c +1 -2
index b53d401..a271496 100644
@@ -827,8 +827,7 @@ int soc15_set_ip_blocks(struct amdgpu_device *adev)
 			amdgpu_device_ip_block_add(adev,
 &dce_virtual_ip_block);
 		amdgpu_device_ip_block_add(adev, &gfx_v9_0_ip_block);
 		amdgpu_device_ip_block_add(adev, &sdma_v4_0_ip_block);
-		if (!amdgpu_sriov_vf(adev))
-			amdgpu_device_ip_block_add(adev,
 &smu_v11_0_ip_block);
+		amdgpu_device_ip_block_add(adev, &smu_v11_0_ip_block);
 
		if (amdgpu_sriov_vf(adev)) {
			if (likely(adev->firmware.load_type ==

AMDGPU_FW_LOAD_PSP)) diff --git
a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
index 936c682..42c0a6d 100644

drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +7 -3
@@ -531,10 +531,14 @@ 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) {
-		if (amdgpu_sriov_vf(adev))
-			return false;
-		else
+		if (amdgpu_sriov_vf(adev)) {
+			if(amdgpu_sriov_is_pp_one_vf(adev))
+				return true;
+			else
+				return false;
+		} else {
 			return true;
+		}
 	} else
 		return false;

}

drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +0 -0
@@ -1062,20 +1066,19 @@ static int smu_smc_table_hw_init(struct
 smu_context *smu,
 	}

drivers/gpu/drm/amd/powerplay/amdgpu_smu.c static int smu_smc_table_hw_init(struct · line 1077

Quoted 10 lines
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +8 -0
 
 	/* smu_dump_pptable(smu); */
+	if(amdgpu_sriov_vf(adev) && !amdgpu_sriov_is_pp_one_vf(adev)){
+		/*
+		 * Copy pptable bo in the vram to smc with SMU MSGs such as
+		 * SetDriverDramAddr and TransferTableDram2Smu.
+		 */
+		ret = smu_write_pptable(smu);
+		if (ret)
+			return ret;

Why only sriov and non one vf mode need to this? What about bare metal?

Quoted 56 lines
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +5 -14
-	/*
-	 * Copy pptable bo in the vram to smc with SMU MSGs such as
-	 * SetDriverDramAddr and TransferTableDram2Smu.
-	 */
-	ret = smu_write_pptable(smu);
-	if (ret)
-		return ret;
-
-	/* issue Run*Btc msg */
-	ret = smu_run_btc(smu);
-	if (ret)
-		return ret;
-
+		/* issue Run*Btc msg */
+		ret = smu_run_btc(smu);
+		if (ret)
+			return ret;
 	ret = smu_feature_set_allowed_mask(smu);
 	if (ret)
 		return ret;
@@ -1083,7 +1086,7 @@ static int smu_smc_table_hw_init(struct
 smu_context *smu,
 	ret = smu_system_features_control(smu, true);
 	if (ret)
 		return ret;
-
+	}
 	if (adev->asic_type != CHIP_ARCTURUS) {
 		ret = smu_notify_display_change(smu);

if (ret)

drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +0 -0
@@ -1136,8 +1139,9 @@ static int smu_smc_table_hw_init(struct
 smu_context *smu,
 	/*
 	 * Set PMSTATUSLOG table bo address with SetToolsDramAddr MSG for

tools.

	 */
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +3 -2
-	ret = smu_set_tool_table_location(smu);
-
+	if(amdgpu_sriov_vf(adev) && !amdgpu_sriov_is_pp_one_vf(adev)){
+		ret = smu_set_tool_table_location(smu);
+	}
	if (!smu_is_dpm_running(smu))
		pr_info("dpm has been disabled\n");
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +3 -1
@@ -1249,6 +1253,9 @@ static int smu_hw_init(void *handle)
 		smu_set_gfx_cgpg(&adev->smu, true);
 	}
 
+	if (amdgpu_sriov_vf(adev)&& !amdgpu_sriov_is_pp_one_vf(adev))
+		return 0;
+
 	if (!smu->pm_enabled)
 		return 0;
 
--
Quoted 1 line

2.7.4

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

#4 lore raw

hi, Emily,

Thank you for your review.
Comment inline, updated patch attached

-----Original Message-----
From: Deng, Emily <[email protected]>
Sent: Friday, December 27, 2019 3:27 PM
To: Zhang, Jack (Jian) <[email protected]>; Feng, Kenneth <[email protected]>; Deucher, Alexander <[email protected]>; Quan, Evan <[email protected]>; Wang, Kevin(Yang) <[email protected]>; Tao, Yintian <[email protected]>; Min, Frank <[email protected]>; Liu, Monk <[email protected]>; [email protected]
Subject: RE: [PATCH 1/2] amd/amdgpu/sriov enable onevf mode for ARCTURUS VF

[AMD Official Use Only - Internal Distribution Only]

Quoted 106 lines

-----Original Message-----
From: Zhang, Jack (Jian) <[email protected]>
Sent: Friday, December 27, 2019 3:00 PM
To: Feng, Kenneth <[email protected]>; Deucher, Alexander <[email protected]>; Quan, Evan <[email protected]>; Wang, Kevin(Yang) <[email protected]>; Tao, Yintian <[email protected]>; Deng, Emily <[email protected]>; Min, Frank <[email protected]>; Liu, Monk <[email protected]>; [email protected]; Zhang, Jack (Jian) <[email protected]>
Subject: RE: [PATCH 1/2] amd/amdgpu/sriov enable onevf mode for ARCTURUS VF

-----Original Message-----
From: Jack Zhang <[email protected]>
Sent: Friday, December 27, 2019 2:57 PM
To: [email protected]
Cc: Zhang, Jack (Jian) <[email protected]>
Subject: [PATCH 1/2] amd/amdgpu/sriov enable onevf mode for ARCTURUS VF

Before, initialization of smu ip block would be skipped for sriov ASICs. But if there's only one VF being used, guest driver should be able to dump some HW info such as clks, temperature,etc.

To solve this, now after onevf mode is enabled, host driver will notify guest. If it's onevf mode, guest will do smu hw_init and skip some steps in normal smu hw_init flow because host driver has already done it for smu.

With this fix, guest app can talk with smu and dump hw information from smu.

v2: refine the logic for pm_enabled.Skip hw_init by not changing pm_enabled.

---

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c    |  3 +-
drivers/gpu/drm/amd/amdgpu/soc15.c         |  3 +-
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 45 
+++++++++++++++++------
-------
3 files changed, 29 insertions(+), 22 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +0 -0
index 8469834..08130a6 100644
@@ -1448,7 +1448,8 @@ static int psp_np_fw_load(struct psp_context *psp)
                    || ucode->ucode_id == AMDGPU_UCODE_ID_RLC_G
 	            || ucode->ucode_id ==

AMDGPU_UCODE_ID_RLC_RESTORE_LIST_CNTL

	            || ucode->ucode_id ==

AMDGPU_UCODE_ID_RLC_RESTORE_LIST_GPM_MEM

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +0 -1
-	            || ucode->ucode_id ==

AMDGPU_UCODE_ID_RLC_RESTORE_LIST_SRM_MEM))

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1 -0
+	            || ucode->ucode_id ==

AMDGPU_UCODE_ID_RLC_RESTORE_LIST_SRM_MEM

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1 -0
+	            || ucode->ucode_id == AMDGPU_UCODE_ID_SMC))
			/*skip ucode loading in SRIOV VF */
			continue;
drivers/gpu/drm/amd/amdgpu/soc15.c +1 -2
index b53d401..a271496 100644
@@ -827,8 +827,7 @@ int soc15_set_ip_blocks(struct amdgpu_device *adev)
 			amdgpu_device_ip_block_add(adev,
 &dce_virtual_ip_block);
 		amdgpu_device_ip_block_add(adev, &gfx_v9_0_ip_block);
 		amdgpu_device_ip_block_add(adev, &sdma_v4_0_ip_block);
-		if (!amdgpu_sriov_vf(adev))
-			amdgpu_device_ip_block_add(adev,
 &smu_v11_0_ip_block);
+		amdgpu_device_ip_block_add(adev, &smu_v11_0_ip_block);
 
		if (amdgpu_sriov_vf(adev)) {
			if (likely(adev->firmware.load_type ==

AMDGPU_FW_LOAD_PSP)) diff --git
a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
index 936c682..42c0a6d 100644

drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +7 -3
@@ -531,10 +531,14 @@ 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) {
-		if (amdgpu_sriov_vf(adev))
-			return false;
-		else
+		if (amdgpu_sriov_vf(adev)) {
+			if(amdgpu_sriov_is_pp_one_vf(adev))
+				return true;
+			else
+				return false;
+		} else {
 			return true;
+		}
 	} else
 		return false;

}

drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +0 -0
@@ -1062,20 +1066,19 @@ static int smu_smc_table_hw_init(struct 
 smu_context *smu,
 	}

drivers/gpu/drm/amd/powerplay/amdgpu_smu.c static int smu_smc_table_hw_init(struct · line 1077

Quoted 10 lines
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +8 -0
 
 	/* smu_dump_pptable(smu); */
+	if(amdgpu_sriov_vf(adev) && !amdgpu_sriov_is_pp_one_vf(adev)){
+		/*
+		 * Copy pptable bo in the vram to smc with SMU MSGs such as
+		 * SetDriverDramAddr and TransferTableDram2Smu.
+		 */
+		ret = smu_write_pptable(smu);
+		if (ret)
+			return ret;

[Emily]Why only sriov and non one vf mode need to this? What about bare metal? [Jack] changed to "if(!amdgpu_sriov_vf(adev) || !amdgpu_sriov_is_pp_one_vf(adev))"

Quoted 56 lines
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +5 -14
-	/*
-	 * Copy pptable bo in the vram to smc with SMU MSGs such as
-	 * SetDriverDramAddr and TransferTableDram2Smu.
-	 */
-	ret = smu_write_pptable(smu);
-	if (ret)
-		return ret;
-
-	/* issue Run*Btc msg */
-	ret = smu_run_btc(smu);
-	if (ret)
-		return ret;
-
+		/* issue Run*Btc msg */
+		ret = smu_run_btc(smu);
+		if (ret)
+			return ret;
 	ret = smu_feature_set_allowed_mask(smu);
 	if (ret)
 		return ret;
@@ -1083,7 +1086,7 @@ static int smu_smc_table_hw_init(struct 
 smu_context *smu,
 	ret = smu_system_features_control(smu, true);
 	if (ret)
 		return ret;
-
+	}
 	if (adev->asic_type != CHIP_ARCTURUS) {
 		ret = smu_notify_display_change(smu);

if (ret)

drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +0 -0
@@ -1136,8 +1139,9 @@ static int smu_smc_table_hw_init(struct 
 smu_context *smu,
 	/*
 	 * Set PMSTATUSLOG table bo address with SetToolsDramAddr MSG for 

tools.

	 */
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +3 -2
-	ret = smu_set_tool_table_location(smu);
-
+	if(amdgpu_sriov_vf(adev) && !amdgpu_sriov_is_pp_one_vf(adev)){
+		ret = smu_set_tool_table_location(smu);
+	}
	if (!smu_is_dpm_running(smu))
		pr_info("dpm has been disabled\n");
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +3 -1
@@ -1249,6 +1253,9 @@ static int smu_hw_init(void *handle)
 		smu_set_gfx_cgpg(&adev->smu, true);
 	}
 
+	if (amdgpu_sriov_vf(adev)&& !amdgpu_sriov_is_pp_one_vf(adev))
+		return 0;
+
 	if (!smu->pm_enabled)
 		return 0;
 
--
Quoted 1 line

2.7.4

From d7132a9c3c570007f1cc24b950f0818c50792b23 Mon Sep 17 00:00:00 2001
From: Jack Zhang <[email protected]>
Date: Tue, 10 Dec 2019 10:51:01 +0800
Subject: [PATCH 1/2] amd/amdgpu/sriov enable onevf mode for ARCTURUS VF

Before, initialization of smu ip block would be skipped for sriov ASICs. But if there's only one VF being used, guest driver should be able to dump some HW info such as clks, temperature,etc.

To solve this, now after onevf mode is enabled, host driver will notify guest. If it's onevf mode, guest will do smu hw_init and skip some steps in normal smu hw_init flow because host driver has already done it for smu.

With this fix, guest app can talk with smu and dump hw information from smu.

v2: refine the logic for pm_enabled.Skip hw_init by not changing pm_enabled.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c    |  3 +-
 drivers/gpu/drm/amd/amdgpu/soc15.c         |  3 +-
 drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 45 +++++++++++++++++-------------
 3 files changed, 29 insertions(+), 22 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +2 -1
index 8469834..08130a6 100644
@@ -1448,7 +1448,8 @@ static int psp_np_fw_load(struct psp_context *psp)
                     || ucode->ucode_id == AMDGPU_UCODE_ID_RLC_G
 	            || ucode->ucode_id == AMDGPU_UCODE_ID_RLC_RESTORE_LIST_CNTL
 	            || ucode->ucode_id == AMDGPU_UCODE_ID_RLC_RESTORE_LIST_GPM_MEM
-	            || ucode->ucode_id == AMDGPU_UCODE_ID_RLC_RESTORE_LIST_SRM_MEM))
+	            || ucode->ucode_id == AMDGPU_UCODE_ID_RLC_RESTORE_LIST_SRM_MEM
+	            || ucode->ucode_id == AMDGPU_UCODE_ID_SMC))
 			/*skip ucode loading in SRIOV VF */
 			continue;
 
drivers/gpu/drm/amd/amdgpu/soc15.c +1 -2
index b53d401..a271496 100644
@@ -827,8 +827,7 @@ int soc15_set_ip_blocks(struct amdgpu_device *adev)
 			amdgpu_device_ip_block_add(adev, &dce_virtual_ip_block);
 		amdgpu_device_ip_block_add(adev, &gfx_v9_0_ip_block);
 		amdgpu_device_ip_block_add(adev, &sdma_v4_0_ip_block);
-		if (!amdgpu_sriov_vf(adev))
-			amdgpu_device_ip_block_add(adev, &smu_v11_0_ip_block);
+		amdgpu_device_ip_block_add(adev, &smu_v11_0_ip_block);
 
 		if (amdgpu_sriov_vf(adev)) {
 			if (likely(adev->firmware.load_type == AMDGPU_FW_LOAD_PSP))
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +26 -19

77 lines not on this page · raw message

Signature · 1 line
2.7.4

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