Skip to contentSkip to conversation

drm/amd/pm: fix typo in OD fan feature mask bit clear on smu v14.0.x

PATCH In review Yang Wang 2 participants 2 messages Apr 9

Subsystems (3)
lore
Share & tools
lore

Yang Wang

author
#0 lore raw

PATCH 1/1 drm/amd/pm: fix typo in OD fan feature mask bit clear on smu v14.0.x

Fix a trivial typo in SMUv14.0.2 OverDrive fan control bit handling. The code missed the '~' bitwise NOT operator when clearing feature bits, use &= ~BIT() instead of &= BIT() to correctly clear the corresponding bits.

Fixes b787d21fab08 ("drm/amd/pm: fix incorrect FeatureCtrlMask setting on smu v14.0.x")
---
 drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c +3 -3
index 0ccad0b48c09..fa5131a2890b 100644
@@ -2434,7 +2434,7 @@ static int smu_v14_0_2_od_restore_table_single(struct smu_context *smu, long inp
 		}
 		od_table->OverDriveTable.FanMode = FAN_MODE_AUTO;
 		od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_FAN_CURVE_BIT);
-		od_table->OverDriveTable.FeatureCtrlMask &= BIT(PP_OD_FEATURE_FAN_LEGACY_BIT);
+		od_table->OverDriveTable.FeatureCtrlMask &= ~BIT(PP_OD_FEATURE_FAN_LEGACY_BIT);
 		break;
 	case PP_OD_EDIT_FAN_ZERO_RPM_ENABLE:
 		od_table->OverDriveTable.FanZeroRpmEnable =
@@ -2464,7 +2464,7 @@ static int smu_v14_0_2_od_restore_table_single(struct smu_context *smu, long inp
 					boot_overdrive_table->OverDriveTable.FanMinimumPwm;
 		od_table->OverDriveTable.FanMode = FAN_MODE_AUTO;
 		od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_FAN_LEGACY_BIT);
-		od_table->OverDriveTable.FeatureCtrlMask &= BIT(PP_OD_FEATURE_FAN_CURVE_BIT);
+		od_table->OverDriveTable.FeatureCtrlMask &= ~BIT(PP_OD_FEATURE_FAN_CURVE_BIT);
 		break;
 	default:
 		dev_info(adev->dev, "Invalid table index: %ld\n", input);
@@ -2723,7 +2723,7 @@ static int smu_v14_0_2_od_edit_dpm_table(struct smu_context *smu,
 		od_table->OverDriveTable.FanMinimumPwm = input[0];
 		od_table->OverDriveTable.FanMode = FAN_MODE_AUTO;
 		od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_FAN_LEGACY_BIT);
-		od_table->OverDriveTable.FeatureCtrlMask &= BIT(PP_OD_FEATURE_FAN_CURVE_BIT);
+		od_table->OverDriveTable.FeatureCtrlMask &= ~BIT(PP_OD_FEATURE_FAN_CURVE_BIT);
 		break;
 
 	case PP_OD_EDIT_FAN_ZERO_RPM_ENABLE:
Signature · 1 line
2.47.3
maintainer Reviewed-by on v1 1/1
#1 lore raw

[AMD Official Use Only - AMD Internal Distribution Only]

-----Original Message-----
From: Wang, Yang(Kevin) <[email protected]>
Sent: Thursday, April 9, 2026 11:10 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Zhang, Hawking <[email protected]>; Feng, Kenneth <[email protected]>
Subject: [PATCH] drm/amd/pm: fix typo in OD fan feature mask bit clear on smu v14.0.x

Fix a trivial typo in SMUv14.0.2 OverDrive fan control bit handling.
The code missed the '~' bitwise NOT operator when clearing feature bits, use &= ~BIT() instead of &= BIT() to correctly clear the corresponding bits.

Fixes b787d21fab08 ("drm/amd/pm: fix incorrect FeatureCtrlMask setting on smu v14.0.x")
---
 drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_2_ppt.c +2 -1
index 0ccad0b48c09..fa5131a2890b 100644
@@ -2434,7 +2434,7 @@ static int smu_v14_0_2_od_restore_table_single(struct smu_context *smu, long inp
                }
                od_table->OverDriveTable.FanMode = FAN_MODE_AUTO;
                od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_FAN_CURVE_BIT);
-               od_table->OverDriveTable.FeatureCtrlMask &= BIT(PP_OD_FEATURE_FAN_LEGACY_BIT);
+               od_table->OverDriveTable.FeatureCtrlMask &=
+~BIT(PP_OD_FEATURE_FAN_LEGACY_BIT);
                break;
        case PP_OD_EDIT_FAN_ZERO_RPM_ENABLE:
                od_table->OverDriveTable.FanZeroRpmEnable = @@ -2464,7 +2464,7 @@ static int smu_v14_0_2_od_restore_table_single(struct smu_context *smu, long inp
                                        boot_overdrive_table->OverDriveTable.FanMinimumPwm;
                od_table->OverDriveTable.FanMode = FAN_MODE_AUTO;
                od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_FAN_LEGACY_BIT);
-               od_table->OverDriveTable.FeatureCtrlMask &= BIT(PP_OD_FEATURE_FAN_CURVE_BIT);
+               od_table->OverDriveTable.FeatureCtrlMask &=
+~BIT(PP_OD_FEATURE_FAN_CURVE_BIT);
                break;
        default:
                dev_info(adev->dev, "Invalid table index: %ld\n", input); @@ -2723,7 +2723,7 @@ static int smu_v14_0_2_od_edit_dpm_table(struct smu_context *smu,
                od_table->OverDriveTable.FanMinimumPwm = input[0];
                od_table->OverDriveTable.FanMode = FAN_MODE_AUTO;
                od_table->OverDriveTable.FeatureCtrlMask |= BIT(PP_OD_FEATURE_FAN_LEGACY_BIT);
-               od_table->OverDriveTable.FeatureCtrlMask &= BIT(PP_OD_FEATURE_FAN_CURVE_BIT);
+               od_table->OverDriveTable.FeatureCtrlMask &=
+~BIT(PP_OD_FEATURE_FAN_CURVE_BIT);
                break;

        case PP_OD_EDIT_FAN_ZERO_RPM_ENABLE:

--
2.47.3