From: Guenter Roeck <guenter.roeck@ericsson.com>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH] coretemp: fix reading of microcode
Date: Sat, 09 Oct 2010 18:44:30 +0000 [thread overview]
Message-ID: <20101009184430.GA29892@ericsson.com> (raw)
In-Reply-To: <4CADB0A1020000780001B335@vpn.id2.novell.com>
On Fri, Oct 08, 2010 at 04:59:38AM -0400, Jan Beulich wrote:
> According to the documentation, simply reading the respective MSR
> isn't sufficient: It should be written with zeros, cpuid(1) be
> executed, and then read (see arch/x86/kernel/cpu/intel.c for an
> example).
>
> v2: Fail probe when microcode revision cannot be determined, but is
> needed to check for proper operation.
>
> Signed-off-by: Jan Beulich <jbeulich@novell.com>
> Cc: Fenghua Yu <fenghua.yu@intel.com>
> Cc: Chen Gong <gong.chen@linux.intel.com>
> Cc: Jean Delvare <khali@linux-fr.org>
>
> ---
> drivers/hwmon/coretemp.c | 20 ++++++++++++++++++--
> 1 file changed, 18 insertions(+), 2 deletions(-)
>
> --- linux-2.6.36-rc7/drivers/hwmon/coretemp.c
> +++ 2.6.36-rc7-coretemp-ucode/drivers/hwmon/coretemp.c
> @@ -292,6 +292,15 @@ static int __devinit get_tjmax(struct cp
> }
> }
>
> +static void __devinit get_ucode_rev_on_cpu(void *edx)
> +{
> + u32 eax;
> +
> + wrmsr(MSR_IA32_UCODE_REV, 0, 0);
> + sync_core();
> + rdmsr(MSR_IA32_UCODE_REV, eax, *(u32 *)edx);
> +}
> +
> static int __devinit coretemp_probe(struct platform_device *pdev)
> {
> struct coretemp_data *data;
> @@ -327,8 +336,15 @@ static int __devinit coretemp_probe(stru
>
> if ((c->x86_model = 0xe) && (c->x86_mask < 0xc)) {
> /* check for microcode update */
> - rdmsr_on_cpu(data->id, MSR_IA32_UCODE_REV, &eax, &edx);
> - if (edx < 0x39) {
> + err = smp_call_function_single(data->id, get_ucode_rev_on_cpu,
> + &edx, 1);
> + if (err) {
> + dev_err(&pdev->dev,
> + "Cannot determine microcode revision of "
> + "CPU#%u (%d)!\n", data->id, err);
> + err = -ENODEV;
> + goto exit_free;
> + } else if (edx < 0x39) {
> err = -ENODEV;
> dev_err(&pdev->dev,
> "Errata AE18 not fixed, update BIOS or "
>
Do we have a conclusion on this ? Looks like no one Acked it, and there was
a suggestion to provice a generic piece of code to retrieve the ucode version.
Turns out the ucode revision is already available via ucode_cpu_info[cpu].cpu_sig.rev
unless I am missing something.
Guenter
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next prev parent reply other threads:[~2010-10-09 18:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-07 9:36 [lm-sensors] [PATCH] coretemp: fix reading of microcode revision Jan Beulich
2010-10-07 18:46 ` Fenghua Yu
2010-10-08 7:05 ` Jan Beulich
2010-10-08 8:22 ` Jean Delvare
2010-10-08 8:59 ` Jan Beulich
2010-10-08 12:33 ` Henrique de Moraes Holschuh
2010-10-08 12:34 ` [lm-sensors] [PATCH] coretemp: fix reading of microcode Henrique de Moraes Holschuh
2010-10-08 12:44 ` [lm-sensors] [PATCH] coretemp: fix reading of microcode revision Guenter Roeck
2010-10-09 0:03 ` Henrique de Moraes Holschuh
2010-10-09 18:44 ` Guenter Roeck [this message]
2010-10-11 6:51 ` [lm-sensors] [PATCH] coretemp: fix reading of microcode Jan Beulich
2010-10-11 12:40 ` Guenter Roeck
2010-10-11 15:13 ` Fenghua Yu
2010-10-11 23:07 ` Guenter Roeck
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=20101009184430.GA29892@ericsson.com \
--to=guenter.roeck@ericsson.com \
--cc=lm-sensors@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.