Commit cb5932f8 authored by Jonathan Kim's avatar Jonathan Kim Committed by Alex Deucher

drm/amdgpu: fix vega20 pstate status change

vega20 only requires all devices be set to same pstate level for low
pstate and not high.
Signed-off-by: default avatarJonathan Kim <Jonathan.Kim@amd.com>
Reviewed-by: default avatarEvan Quan <Evan.Quan@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 2af81531
...@@ -276,6 +276,7 @@ int amdgpu_xgmi_set_pstate(struct amdgpu_device *adev, int pstate) ...@@ -276,6 +276,7 @@ int amdgpu_xgmi_set_pstate(struct amdgpu_device *adev, int pstate)
struct amdgpu_hive_info *hive = amdgpu_get_xgmi_hive(adev, 0); struct amdgpu_hive_info *hive = amdgpu_get_xgmi_hive(adev, 0);
struct amdgpu_device *tmp_adev; struct amdgpu_device *tmp_adev;
bool update_hive_pstate = true; bool update_hive_pstate = true;
bool is_high_pstate = pstate && adev->asic_type == CHIP_VEGA20;
if (!hive) if (!hive)
return 0; return 0;
...@@ -283,8 +284,8 @@ int amdgpu_xgmi_set_pstate(struct amdgpu_device *adev, int pstate) ...@@ -283,8 +284,8 @@ int amdgpu_xgmi_set_pstate(struct amdgpu_device *adev, int pstate)
mutex_lock(&hive->hive_lock); mutex_lock(&hive->hive_lock);
if (hive->pstate == pstate) { if (hive->pstate == pstate) {
mutex_unlock(&hive->hive_lock); adev->pstate = is_high_pstate ? pstate : adev->pstate;
return 0; goto out;
} }
dev_dbg(adev->dev, "Set xgmi pstate %d.\n", pstate); dev_dbg(adev->dev, "Set xgmi pstate %d.\n", pstate);
...@@ -317,7 +318,7 @@ int amdgpu_xgmi_set_pstate(struct amdgpu_device *adev, int pstate) ...@@ -317,7 +318,7 @@ int amdgpu_xgmi_set_pstate(struct amdgpu_device *adev, int pstate)
break; break;
} }
} }
if (update_hive_pstate) if (update_hive_pstate || is_high_pstate)
hive->pstate = pstate; hive->pstate = pstate;
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment