Skip to content

Commit b35ea78

Browse files
ChangSeokBaerafaeljw
authored andcommitted
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>
1 parent 70d8b64 commit b35ea78

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/cpufreq/acpi-cpufreq.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,17 @@ static unsigned int acpi_pstate_strict;
7373

7474
static bool boost_state(unsigned int cpu)
7575
{
76-
u32 lo, hi;
7776
u64 msr;
7877

7978
switch (boot_cpu_data.x86_vendor) {
8079
case X86_VENDOR_INTEL:
8180
case X86_VENDOR_CENTAUR:
8281
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);
8583
return !(msr & MSR_IA32_MISC_ENABLE_TURBO_DISABLE);
8684
case X86_VENDOR_HYGON:
8785
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);
9087
return !(msr & MSR_K7_HWCR_CPB_DIS);
9188
}
9289
return false;

0 commit comments

Comments
 (0)