[PATCH] drm/amdgpu: fix for set df cstate failed under sriov

Shikang Fan shikang.fan at amd.com
Fri Nov 25 07:15:18 UTC 2022


- set_df_cstate won't be called under sriov case.

Signed-off-by: Shikang Fan <shikang.fan at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 818fa72c670d..c557585aa46c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2943,13 +2943,15 @@ static int amdgpu_device_ip_suspend_phase1(struct amdgpu_device *adev)
 	amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE);
 	amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE);
 
-	/*
-	 * Per PMFW team's suggestion, driver needs to handle gfxoff
-	 * and df cstate features disablement for gpu reset(e.g. Mode1Reset)
-	 * scenario. Add the missing df cstate disablement here.
-	 */
-	if (amdgpu_dpm_set_df_cstate(adev, DF_CSTATE_DISALLOW))
-		dev_warn(adev->dev, "Failed to disallow df cstate");
+	if (!amdgpu_sriov_vf(adev)) {
+		/*
+		 * Per PMFW team's suggestion, driver needs to handle gfxoff
+		 * and df cstate features disablement for gpu reset(e.g. Mode1Reset)
+		 * scenario. Add the missing df cstate disablement here.
+		 */
+		if (amdgpu_dpm_set_df_cstate(adev, DF_CSTATE_DISALLOW))
+			dev_warn(adev->dev, "Failed to disallow df cstate");
+	}
 
 	for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
 		if (!adev->ip_blocks[i].status.valid)
-- 
2.25.1



More information about the amd-gfx mailing list