Skip to content

Commit 1007bc3

Browse files
Ma Junalexdeucher
authored andcommitted
drm/amd/pm: Add reset option for fan_ctrl interfaces
Add reset option for fan_ctrl interfaces. For example: User can use the "echo r > acoustic_limit_rpm_threshold" command to reset acoustic_limit_rpm_threshold to boot value Signed-off-by: Ma Jun <Jun.Ma2@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent c66705c commit 1007bc3

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

drivers/gpu/drm/amd/pm/amdgpu_pm.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3680,6 +3680,9 @@ static umode_t fan_curve_visible(struct amdgpu_device *adev)
36803680
* When you have finished the editing, write "c" (commit) to the file to commit
36813681
* your changes.
36823682
*
3683+
* If you want to reset to the default value, write "r" (reset) to the file to
3684+
* reset them
3685+
*
36833686
* This setting works under auto fan control mode only. It adjusts the PMFW's
36843687
* behavior about the maximum speed in RPM the fan can spin. Setting via this
36853688
* interface will switch the fan control to auto mode implicitly.
@@ -3735,6 +3738,9 @@ static umode_t acoustic_limit_threshold_visible(struct amdgpu_device *adev)
37353738
* When you have finished the editing, write "c" (commit) to the file to commit
37363739
* your changes.
37373740
*
3741+
* If you want to reset to the default value, write "r" (reset) to the file to
3742+
* reset them
3743+
*
37383744
* This setting works under auto fan control mode only. It can co-exist with
37393745
* other settings which can work also under auto mode. It adjusts the PMFW's
37403746
* behavior about the maximum speed in RPM the fan can spin when ASIC
@@ -3792,6 +3798,9 @@ static umode_t acoustic_target_threshold_visible(struct amdgpu_device *adev)
37923798
* When you have finished the editing, write "c" (commit) to the file to commit
37933799
* your changes.
37943800
*
3801+
* If you want to reset to the default value, write "r" (reset) to the file to
3802+
* reset them
3803+
*
37953804
* This setting works under auto fan control mode only. It can co-exist with
37963805
* other settings which can work also under auto mode. Paring with the
37973806
* acoustic_target_rpm_threshold setting, they define the maximum speed in
@@ -3850,6 +3859,9 @@ static umode_t fan_target_temperature_visible(struct amdgpu_device *adev)
38503859
* When you have finished the editing, write "c" (commit) to the file to commit
38513860
* your changes.
38523861
*
3862+
* If you want to reset to the default value, write "r" (reset) to the file to
3863+
* reset them
3864+
*
38533865
* This setting works under auto fan control mode only. It can co-exist with
38543866
* other settings which can work also under auto mode. It adjusts the PMFW's
38553867
* behavior about the minimum fan speed in PWM the fan should spin. Setting

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,6 +1533,30 @@ static int smu_v13_0_0_od_restore_table_single(struct smu_context *smu, long inp
15331533
od_table->OverDriveTable.FanMode = FAN_MODE_AUTO;
15341534
od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_FAN_CURVE_BIT);
15351535
break;
1536+
case PP_OD_EDIT_ACOUSTIC_LIMIT:
1537+
od_table->OverDriveTable.AcousticLimitRpmThreshold =
1538+
boot_overdrive_table->OverDriveTable.AcousticLimitRpmThreshold;
1539+
od_table->OverDriveTable.FanMode = FAN_MODE_AUTO;
1540+
od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_FAN_CURVE_BIT);
1541+
break;
1542+
case PP_OD_EDIT_ACOUSTIC_TARGET:
1543+
od_table->OverDriveTable.AcousticTargetRpmThreshold =
1544+
boot_overdrive_table->OverDriveTable.AcousticTargetRpmThreshold;
1545+
od_table->OverDriveTable.FanMode = FAN_MODE_AUTO;
1546+
od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_FAN_CURVE_BIT);
1547+
break;
1548+
case PP_OD_EDIT_FAN_TARGET_TEMPERATURE:
1549+
od_table->OverDriveTable.FanTargetTemperature =
1550+
boot_overdrive_table->OverDriveTable.FanTargetTemperature;
1551+
od_table->OverDriveTable.FanMode = FAN_MODE_AUTO;
1552+
od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_FAN_CURVE_BIT);
1553+
break;
1554+
case PP_OD_EDIT_FAN_MINIMUM_PWM:
1555+
od_table->OverDriveTable.FanMinimumPwm =
1556+
boot_overdrive_table->OverDriveTable.FanMinimumPwm;
1557+
od_table->OverDriveTable.FanMode = FAN_MODE_AUTO;
1558+
od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_FAN_CURVE_BIT);
1559+
break;
15361560
default:
15371561
dev_info(adev->dev, "Invalid table index: %ld\n", input);
15381562
return -EINVAL;

0 commit comments

Comments
 (0)