From: Peter Zijlstra <peterz@infradead.org>
To: Borislav Petkov <bp@alien8.de>
Cc: X86 ML <x86@kernel.org>, Tony Luck <tony.luck@intel.com>,
Zhang Rui <rui.zhang@intel.com>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Amit Kucheria <amitk@kernel.org>,
linux-pm@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] thermal: Move therm_throt there from x86/mce
Date: Fri, 8 Jan 2021 10:46:17 +0100 [thread overview]
Message-ID: <X/gp6YRRwmjkDWa0@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20210108085430.13449-3-bp@alien8.de>
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
prev parent reply other threads:[~2021-01-08 9:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-08 8:54 [PATCH 0/2] Move ...mce/therm_throt.c to drivers/thermal/ Borislav Petkov
2021-01-08 8:54 ` [PATCH 1/2] x86/mce: Get rid of mcheck_intel_therm_init() Borislav Petkov
2021-01-08 8:54 ` [PATCH 2/2] thermal: Move therm_throt there from x86/mce Borislav Petkov
2021-01-08 9:46 ` Peter Zijlstra [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=X/gp6YRRwmjkDWa0@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=amitk@kernel.org \
--cc=bp@alien8.de \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rui.zhang@intel.com \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox