Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cpufreq: ACPI: Simplify MSR read on the boot CPU

Replace the 32-bit MSR access function with a 64-bit variant to simplify
the call site, eliminating unnecessary 32-bit value manipulations.

Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Link: https://patch.msgid.link/20241106182313.165297-1-chang.seok.bae@intel.com
[ rjw: Subject edit ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Chang S. Bae and committed by
Rafael J. Wysocki
b35ea78a 70d8b648

+2 -5
+2 -5
drivers/cpufreq/acpi-cpufreq.c
··· 73 73 74 74 static bool boost_state(unsigned int cpu) 75 75 { 76 - u32 lo, hi; 77 76 u64 msr; 78 77 79 78 switch (boot_cpu_data.x86_vendor) { 80 79 case X86_VENDOR_INTEL: 81 80 case X86_VENDOR_CENTAUR: 82 81 case X86_VENDOR_ZHAOXIN: 83 - rdmsr_on_cpu(cpu, MSR_IA32_MISC_ENABLE, &lo, &hi); 84 - msr = lo | ((u64)hi << 32); 82 + rdmsrl_on_cpu(cpu, MSR_IA32_MISC_ENABLE, &msr); 85 83 return !(msr & MSR_IA32_MISC_ENABLE_TURBO_DISABLE); 86 84 case X86_VENDOR_HYGON: 87 85 case X86_VENDOR_AMD: 88 - rdmsr_on_cpu(cpu, MSR_K7_HWCR, &lo, &hi); 89 - msr = lo | ((u64)hi << 32); 86 + rdmsrl_on_cpu(cpu, MSR_K7_HWCR, &msr); 90 87 return !(msr & MSR_K7_HWCR_CPB_DIS); 91 88 } 92 89 return false;