lkml.org 
[lkml]   [2021]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] thermal: Move therm_throt there from x86/mce
On Fri, Jan 08, 2021 at 09:54:30AM +0100, Borislav Petkov wrote:
> +#ifdef CONFIG_X86_THERMAL_VECTOR
> +static void unexpected_thermal_interrupt(void)
> +{
> + pr_err("CPU%d: Unexpected LVT thermal interrupt!\n",
> + smp_processor_id());
> +}
> +
> +static void (*smp_thermal_vector)(void) = unexpected_thermal_interrupt;
> +
> +void thermal_set_handler(void (*handler)(void))
> +{
> + if (handler) {
WARN_ON(smp_thermal_vector != unexpected_thermal_interrupt);
> + smp_thermal_vector = handler;
> + } else
> + smp_thermal_vector = unexpected_thermal_interrupt;
> +}
> +EXPORT_SYMBOL_GPL(thermal_set_handler);

You really don't want multiple modules to touch that at the same time.

> +DEFINE_IDTENTRY_SYSVEC(sysvec_thermal)
> +{
> + trace_thermal_apic_entry(THERMAL_APIC_VECTOR);
> + inc_irq_stat(irq_thermal_count);
> + smp_thermal_vector();
> + trace_thermal_apic_exit(THERMAL_APIC_VECTOR);
> + ack_APIC_irq();
> +}
> +#endif

\
 
 \ /
  Last update: 2021-01-08 10:48    [W:0.056 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site