From: Andrew Morton <akpm@linux-foundation.org>
To: "Russell Leidich" <rml@google.com>
Cc: linux-kernel@vger.kernel.org, "Andi Kleen" <ak@suse.de>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Ingo Molnar" <mingo@elte.hu>
Subject: Re: [PATCH] AMD Thermal Interrupt Support
Date: Thu, 27 Dec 2007 23:34:19 -0800 [thread overview]
Message-ID: <20071227233419.d1adf3f3.akpm@linux-foundation.org> (raw)
In-Reply-To: <3f1a065b0712271057s150b62f8nb11ebc28dc55f811@mail.gmail.com>
On Thu, 27 Dec 2007 10:57:20 -0800 "Russell Leidich" <rml@google.com> wrote:
> Thanks Andrew. I have a few questions on your comments...
>
> On Dec 25, 2007 2:04 PM, Andrew Morton <akpm@linux-foundation.org> wrote:
> > > + unsigned int apic_lv_therm;
> > > +
> > > + /* Set up APIC_LVTTHMR to issue THERMAL_APIC_VECTOR. */
> > > + apic_lv_therm = apic_read(APIC_LVTTHMR);
> > > + /*
> > > + * See if some agent other than this routine has already initialized
> > > + * APIC_LVTTHMR, i.e. if it's unmasked, but not equal to the value that
> > > + * we would have programmed, had we been here before on this core.
> > > + */
> > > + if ((!(apic_lv_therm & APIC_LVT_MASKED)) && ((apic_lv_therm &
> > > + (APIC_MODE_MASK | APIC_VECTOR_MASK)) != (APIC_DM_FIXED |
> > > + THERMAL_APIC_VECTOR))) {
> > > + unsigned int cpu = smp_processor_id();
> >
> > afaict this function is called while the calling thread is running
> > preemptibly. This smp_processor_id() call should have generated a runtime
> > warning if it was tested with all debug options enabled?
>
> I thought that the whole point of on_each_cpu(&thermal_apic_init,
> NULL, 1, 0) was to ensure that thermal_apic_init() runs
> (nonpreemptibly) on each core. No?
oh, OK.
> > > +static void default_smp_thermal_interrupt(void) {}
> >
> > static void default_smp_thermal_interrupt(void)
> > {
> > }
> >
> > please.
> >
> >
> > Can this function ever actually be called?
>
> My colleauge was concerned that we have a do-nothing handler in case
> we get a spurious thermal interrupt. In my view, there's no point
> programming for the possibility of broken hardware. On the other
> hand, I do need some sort of indirection to bind the entry.S thermal
> handler from assembly language to either Intel or AMD C code. Trouble
> is, at compiletime, we might have both Intel and AMD support
> installed, but only one of them should actually receive the interrupt
> at runtime. So I think I need to do runtime binding, unless I want to
> do CPUID inside the ISR. What do you think?
If it "can't happen" then we can just leave the vector pointing at 0 until
it gets set up properly. But nobody ever got fired for mistrusting
hardware (and BIOS) so perhaps what we should do is to leave that there, but
make it emit a suitable diagnostic? A printk_ratelimit()ed one, probably.
next prev parent reply other threads:[~2007-12-28 7:37 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-17 18:54 [PATCH] AMD Thermal Interrupt Support Russell Leidich
2007-12-25 22:04 ` Andrew Morton
2007-12-27 18:57 ` Russell Leidich
2007-12-28 7:34 ` Andrew Morton [this message]
2007-12-28 20:40 ` Russell Leidich
2007-12-29 2:11 ` Andi Kleen
2007-12-29 2:30 ` Valdis.Kletnieks
2007-12-29 2:34 ` Andi Kleen
2007-12-29 2:57 ` Valdis.Kletnieks
2007-12-30 18:39 ` Andi Kleen
2008-01-02 19:43 ` Russell Leidich
2008-01-02 20:00 ` Andi Kleen
2008-01-02 21:12 ` Russell Leidich
2008-01-02 21:33 ` Torsten Kaiser
2008-01-02 21:50 ` Russell Leidich
2008-01-02 21:54 ` Andi Kleen
2008-01-02 22:32 ` Russell Leidich
2008-01-04 21:33 ` Russell Leidich
2008-01-04 22:26 ` Andi Kleen
2008-01-05 0:53 ` Russell Leidich
2008-01-05 13:24 ` Andi Kleen
2008-01-05 20:08 ` Russell Leidich
2008-01-08 23:42 ` Russell Leidich
2008-01-08 23:52 ` Andi Kleen
2008-01-09 2:28 ` Russell Leidich
2008-01-09 2:37 ` Andi Kleen
2008-01-11 2:21 ` Russell Leidich
2008-01-18 1:06 ` Russell Leidich
2008-02-03 0:10 ` Andrew Morton
2008-02-03 0:27 ` Harvey Harrison
2008-02-03 0:39 ` Andrew Morton
2008-02-03 0:50 ` [PATCH] x86: Remove pt_regs arg from smp_thermal_interrupt Harvey Harrison
2008-02-03 1:01 ` Harvey Harrison
2008-02-04 7:12 ` Andi Kleen
-- strict thread matches above, loose matches on Subject: below --
2007-12-11 18:44 [PATCH] AMD Thermal Interrupt Support Russell Leidich
2007-12-11 19:13 ` Russell Leidich
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=20071227233419.d1adf3f3.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=ak@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rml@google.com \
--cc=tglx@linutronix.de \
/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