Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=67f363b1f6a31cf5027a97372f64bcced4f05ba6
Commit:     67f363b1f6a31cf5027a97372f64bcced4f05ba6
Parent:     7574d7e937f81754dfd82deac24aea5880107e2d
Author:     Rudolf Marek <[EMAIL PROTECTED]>
AuthorDate: Sun May 27 22:17:43 2007 +0200
Committer:  Jean Delvare <[EMAIL PROTECTED]>
CommitDate: Sun May 27 22:17:43 2007 +0200

    hwmon/coretemp: Add more safety checks
    
    Add detection of AE18 Errata of Core processor and warns
    users that the absolute readings might be wrong for Core2 processor.
    
    Signed-off-by: Rudolf Marek <[EMAIL PROTECTED]>
    Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
---
 drivers/hwmon/coretemp.c |   32 +++++++++++++++++++++++++++++---
 1 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index 75e3911..0328382 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -176,6 +176,22 @@ static int __devinit coretemp_probe(struct platform_device 
*pdev)
                goto exit_free;
        }
 
+       /* Check if we have problem with errata AE18 of Core processors:
+          Readings might stop update when processor visited too deep sleep,
+          fixed for stepping D0 (6EC).
+       */
+
+       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) {
+                       dev_err(&pdev->dev,
+                               "Errata AE18 not fixed, update BIOS or "
+                               "microcode of the CPU!\n");
+                       goto exit_free;
+               }
+       }
+
        /* Some processors have Tjmax 85 following magic should detect it
           Intel won't disclose the information without signed NDA, but
           individuals cannot sign it. Catch(ed) 22.
@@ -193,6 +209,19 @@ static int __devinit coretemp_probe(struct platform_device 
*pdev)
                }
        }
 
+       /* Intel says that above should not work for desktop Core2 processors,
+          but it seems to work. There is no other way how get the absolute
+          readings. Warn the user about this. First check if are desktop,
+          bit 50 of MSR_IA32_PLATFORM_ID should be 0.
+       */
+
+       rdmsr_safe_on_cpu(data->id, MSR_IA32_PLATFORM_ID, &eax, &edx);
+
+       if ((c->x86_model == 0xf) && (!(edx & 0x00040000))) {
+               dev_warn(&pdev->dev, "Using undocumented features, absolute "
+                        "temperature might be wrong!\n");
+       }
+
        platform_set_drvdata(pdev, data);
 
        if ((err = sysfs_create_group(&pdev->dev.kobj, &coretemp_group)))
@@ -330,9 +359,6 @@ static int __init coretemp_init(void)
        int i, err = -ENODEV;
        struct pdev_entry *p, *n;
 
-       printk(KERN_NOTICE DRVNAME ": This driver uses undocumented features "
-               "of Core CPU. Temperature might be wrong!\n");
-
        /* quick check if we run Intel */
        if (cpu_data[0].x86_vendor != X86_VENDOR_INTEL)
                goto exit;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to