Skip to content

Commit

Permalink
drm/amd/powerplay: fix pre-check condition for setting clock range
Browse files Browse the repository at this point in the history
This fix will handle some MP1 FW issue like as mclk dpm table in renoir has a reverse
dpm clock layout and a zero frequency dpm level as following case.

cat pp_dpm_mclk
0: 1200Mhz
1: 1200Mhz
2: 800Mhz
3: 0Mhz

Signed-off-by: Prike Liang <Prike.Liang@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
  • Loading branch information
Prike Liang authored and Alex Deucher committed Mar 5, 2020
1 parent a0275df commit 80381d4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ int smu_set_soft_freq_range(struct smu_context *smu, enum smu_clk_type clk_type,
{
int ret = 0;

if (min <= 0 && max <= 0)
if (min < 0 && max < 0)
return -EINVAL;

if (!smu_clk_dpm_is_enabled(smu, clk_type))
Expand Down
3 changes: 0 additions & 3 deletions drivers/gpu/drm/amd/powerplay/smu_v12_0.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,9 +458,6 @@ int smu_v12_0_set_soft_freq_limited_range(struct smu_context *smu, enum smu_clk_
{
int ret = 0;

if (max < min)
return -EINVAL;

switch (clk_type) {
case SMU_GFXCLK:
case SMU_SCLK:
Expand Down

0 comments on commit 80381d4

Please sign in to comment.