Skip to content

Commit 904f309

Browse files
spandruvadarafaeljw
authored andcommitted
thermal: intel: Don't set HFI status bit to 1
When CPU doesn't support HFI (Hardware Feedback Interface), don't include BIT 26 in the mask to prevent clearing. otherwise this results in: unchecked MSR access error: WRMSR to 0x1b1 (tried to write 0x0000000004000aa8) at rIP: 0xffffffff8b8559fe (throttle_active_work+0xbe/0x1b0) Fixes: 6fe1e64 ("thermal: intel: Prevent accidental clearing of HFI status") Reported-by: Linus Torvalds <[email protected]> Tested-by: Linus Torvalds <[email protected]> Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 75b15aa commit 904f309

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/thermal/intel/therm_throt.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ static const struct attribute_group thermal_attr_group = {
194194
#define THERM_STATUS_PROCHOT_LOG BIT(1)
195195

196196
#define THERM_STATUS_CLEAR_CORE_MASK (BIT(1) | BIT(3) | BIT(5) | BIT(7) | BIT(9) | BIT(11) | BIT(13) | BIT(15))
197-
#define THERM_STATUS_CLEAR_PKG_MASK (BIT(1) | BIT(3) | BIT(5) | BIT(7) | BIT(9) | BIT(11) | BIT(26))
197+
#define THERM_STATUS_CLEAR_PKG_MASK (BIT(1) | BIT(3) | BIT(5) | BIT(7) | BIT(9) | BIT(11))
198198

199199
/*
200200
* Clear the bits in package thermal status register for bit = 1
@@ -211,6 +211,9 @@ void thermal_clear_package_intr_status(int level, u64 bit_mask)
211211
} else {
212212
msr = MSR_IA32_PACKAGE_THERM_STATUS;
213213
msr_val = THERM_STATUS_CLEAR_PKG_MASK;
214+
if (boot_cpu_has(X86_FEATURE_HFI))
215+
msr_val |= BIT(26);
216+
214217
}
215218

216219
msr_val &= ~bit_mask;

0 commit comments

Comments
 (0)