Skip to content

Commit 5566e4c

Browse files
Yang Wanggregkh
authored andcommitted
drm/amd/pm: fix incorrect FeatureCtrlMask setting on smu v14.0.x
commit 504f009 upstream. OverDriveTable.FanMinimumPwm and FeatureCtrlMask.PP_OD_FEATURE_FAN_LEGACY_BIT have a hard dependency. Invalid handling of this dependency leads to disabled thermal monitoring and temperature boundary validation. v2: squash in typo fix (Yang) Fixes: 9710b84 ("drm/amd/pm: add overdrive support on smu v14.0.2/3") Cc: stable@vger.kernel.org Signed-off-by: Yang Wang <kevinyang.wang@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f5250ad commit 5566e4c

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2424,6 +2424,7 @@ static int smu_v14_0_2_od_restore_table_single(struct smu_context *smu, long inp
24242424
}
24252425
od_table->OverDriveTable.FanMode = FAN_MODE_AUTO;
24262426
od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_FAN_CURVE_BIT);
2427+
od_table->OverDriveTable.FeatureCtrlMask &= ~BIT(PP_OD_FEATURE_FAN_LEGACY_BIT);
24272428
break;
24282429
case PP_OD_EDIT_ACOUSTIC_LIMIT:
24292430
od_table->OverDriveTable.AcousticLimitRpmThreshold =
@@ -2447,7 +2448,8 @@ static int smu_v14_0_2_od_restore_table_single(struct smu_context *smu, long inp
24472448
od_table->OverDriveTable.FanMinimumPwm =
24482449
boot_overdrive_table->OverDriveTable.FanMinimumPwm;
24492450
od_table->OverDriveTable.FanMode = FAN_MODE_AUTO;
2450-
od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_FAN_CURVE_BIT);
2451+
od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_FAN_LEGACY_BIT);
2452+
od_table->OverDriveTable.FeatureCtrlMask &= ~BIT(PP_OD_FEATURE_FAN_CURVE_BIT);
24512453
break;
24522454
default:
24532455
dev_info(adev->dev, "Invalid table index: %ld\n", input);
@@ -2617,6 +2619,7 @@ static int smu_v14_0_2_od_edit_dpm_table(struct smu_context *smu,
26172619
od_table->OverDriveTable.FanLinearPwmPoints[input[0]] = input[2];
26182620
od_table->OverDriveTable.FanMode = FAN_MODE_MANUAL_LINEAR;
26192621
od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_FAN_CURVE_BIT);
2622+
od_table->OverDriveTable.FeatureCtrlMask &= ~BIT(PP_OD_FEATURE_FAN_LEGACY_BIT);
26202623
break;
26212624

26222625
case PP_OD_EDIT_ACOUSTIC_LIMIT:
@@ -2686,7 +2689,7 @@ static int smu_v14_0_2_od_edit_dpm_table(struct smu_context *smu,
26862689
break;
26872690

26882691
case PP_OD_EDIT_FAN_MINIMUM_PWM:
2689-
if (!smu_v14_0_2_is_od_feature_supported(smu, PP_OD_FEATURE_FAN_CURVE_BIT)) {
2692+
if (!smu_v14_0_2_is_od_feature_supported(smu, PP_OD_FEATURE_FAN_LEGACY_BIT)) {
26902693
dev_warn(adev->dev, "Fan curve setting not supported!\n");
26912694
return -ENOTSUPP;
26922695
}
@@ -2704,7 +2707,8 @@ static int smu_v14_0_2_od_edit_dpm_table(struct smu_context *smu,
27042707

27052708
od_table->OverDriveTable.FanMinimumPwm = input[0];
27062709
od_table->OverDriveTable.FanMode = FAN_MODE_AUTO;
2707-
od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_FAN_CURVE_BIT);
2710+
od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_FAN_LEGACY_BIT);
2711+
od_table->OverDriveTable.FeatureCtrlMask &= ~BIT(PP_OD_FEATURE_FAN_CURVE_BIT);
27082712
break;
27092713

27102714
case PP_OD_RESTORE_DEFAULT_TABLE:

0 commit comments

Comments
 (0)