]> git.baikalelectronics.ru Git - kernel.git/commitdiff
x86/mce: Get rid of mcheck_intel_therm_init()
authorBorislav Petkov <bp@suse.de>
Thu, 7 Jan 2021 12:23:34 +0000 (13:23 +0100)
committerBorislav Petkov <bp@suse.de>
Mon, 8 Feb 2021 10:28:30 +0000 (11:28 +0100)
Move the APIC_LVTTHMR read which needs to happen on the BSP, to
intel_init_thermal(). One less boot dependency.

No functional changes.

Signed-off-by: Borislav Petkov <bp@suse.de>
Tested-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://lkml.kernel.org/r/20210201142704.12495-2-bp@alien8.de
arch/x86/include/asm/mce.h
arch/x86/kernel/cpu/mce/core.c
arch/x86/kernel/cpu/mce/therm_throt.c

index 56cdeaac76a0e3b484fc5e700a5fec5475ccd7c6..def9aa5e1fa40b0b507e63bcb481bf2817768de8 100644 (file)
@@ -304,12 +304,6 @@ extern int (*platform_thermal_package_notify)(__u64 msr_val);
  * callback has rate control */
 extern bool (*platform_thermal_package_rate_control)(void);
 
-#ifdef CONFIG_X86_THERMAL_VECTOR
-extern void mcheck_intel_therm_init(void);
-#else
-static inline void mcheck_intel_therm_init(void) { }
-#endif
-
 /*
  * Used by APEI to report memory error via /dev/mcelog
  */
index 6c81d0998e0a390cd7bdae4314cdc058adb4ef1f..0cb065e6786f238f40eaa70fffe7161999854317 100644 (file)
@@ -2189,7 +2189,6 @@ __setup("mce", mcheck_enable);
 
 int __init mcheck_init(void)
 {
-       mcheck_intel_therm_init();
        mce_register_decode_chain(&early_nb);
        mce_register_decode_chain(&mce_uc_nb);
        mce_register_decode_chain(&mce_default_nb);
index a7cd2d203ceda64ebd711be273b97249921f1edf..5b15d7cef1d1c03e568c50864e6280720ab644e9 100644 (file)
@@ -633,17 +633,6 @@ static int intel_thermal_supported(struct cpuinfo_x86 *c)
        return 1;
 }
 
-void __init mcheck_intel_therm_init(void)
-{
-       /*
-        * This function is only called on boot CPU. Save the init thermal
-        * LVT value on BSP and use that value to restore APs' thermal LVT
-        * entry BIOS programmed later
-        */
-       if (intel_thermal_supported(&boot_cpu_data))
-               lvtthmr_init = apic_read(APIC_LVTTHMR);
-}
-
 void intel_init_thermal(struct cpuinfo_x86 *c)
 {
        unsigned int cpu = smp_processor_id();
@@ -653,6 +642,10 @@ void intel_init_thermal(struct cpuinfo_x86 *c)
        if (!intel_thermal_supported(c))
                return;
 
+       /* On the BSP? */
+       if (c == &boot_cpu_data)
+               lvtthmr_init = apic_read(APIC_LVTTHMR);
+
        /*
         * First check if its enabled already, in which case there might
         * be some SMM goo which handles it, so we can't even put a handler