[AMD Official Use Only - General]

Hi Shikang,

your patch will impact all amdgpu devices.
May I know which device/asic has this issue ?

other words, you'd better move your changes into smu side as well (likes 
smu_v13_xx_ppt.c).

Best Regards,
Kevin

-----Original Message-----
From: amd-gfx <amd-gfx-boun...@lists.freedesktop.org> On Behalf Of Shikang Fan
Sent: 2022年11月25日 15:15
To: amd-gfx@lists.freedesktop.org
Cc: Fan, Shikang <shikang....@amd.com>
Subject: [PATCH] drm/amdgpu: fix for set df cstate failed under sriov

- set_df_cstate won't be called under sriov case.

Signed-off-by: Shikang Fan <shikang....@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

<<attachment: winmail.dat>>

Reply via email to