Unverified Commit c1a10b94 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files
parents 57836297 92946fa9
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -3,10 +3,12 @@
#define _ASM_X86_THERMAL_H

#ifdef CONFIG_X86_THERMAL_VECTOR
void therm_lvt_init(void);
void intel_init_thermal(struct cpuinfo_x86 *c);
bool x86_thermal_enabled(void);
void intel_thermal_interrupt(void);
#else
static inline void therm_lvt_init(void)				{ }
static inline void intel_init_thermal(struct cpuinfo_x86 *c)	{ }
#endif

+9 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@
#include <asm/pci-direct.h>
#include <asm/prom.h>
#include <asm/proto.h>
#include <asm/thermal.h>
#include <asm/unwind.h>
#include <asm/vsyscall.h>
#include <linux/vmalloc.h>
@@ -1100,6 +1101,14 @@ void __init setup_arch(char **cmdline_p)

	x86_init.timers.wallclock_init();

	/*
	 * This needs to run before setup_local_APIC() which soft-disables the
	 * local APIC temporarily and that masks the thermal LVT interrupt,
	 * leading to softlockups on machines which have configured SMI
	 * interrupt delivery.
	 */
	therm_lvt_init();

	mcheck_init();

	register_refined_jiffies(CLOCK_TICK_RATE);
+11 −4
Original line number Diff line number Diff line
@@ -637,6 +637,17 @@ bool x86_thermal_enabled(void)
	return atomic_read(&therm_throt_en);
}

void __init therm_lvt_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();
@@ -646,10 +657,6 @@ 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