Skip to content

Commit

Permalink
hwmon: (coretemp) Fix TjMax for Atom N450/D410/D510 CPUs
Browse files Browse the repository at this point in the history
The max junction temperature of Atom N450/D410/D510 CPUs is 100 degrees
Celsius. Since these CPUs are always coupled with Intel NM10 chipset in
one package, the best way to verify whether an Atom CPU is N450/D410/D510
is to check the host bridge device.

Signed-off-by: Yong Wang <yong.y.wang@intel.com>
Acked-by: Huaxu Wan <huaxu.wan@intel.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
  • Loading branch information
Yong Wang authored and Jean Delvare committed Jan 10, 2010
1 parent c5114a1 commit 1fe63ab
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/hwmon/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ config SENSORS_GL520SM

config SENSORS_CORETEMP
tristate "Intel Core/Core2/Atom temperature sensor"
depends on X86 && EXPERIMENTAL
depends on X86 && PCI && EXPERIMENTAL
help
If you say yes here you get support for the temperature
sensor inside your CPU. Most of the family 6 CPUs
Expand Down
16 changes: 14 additions & 2 deletions drivers/hwmon/coretemp.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <linux/list.h>
#include <linux/platform_device.h>
#include <linux/cpu.h>
#include <linux/pci.h>
#include <asm/msr.h>
#include <asm/processor.h>

Expand Down Expand Up @@ -161,18 +162,29 @@ static int __devinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *
int usemsr_ee = 1;
int err;
u32 eax, edx;
struct pci_dev *host_bridge;

/* Early chips have no MSR for TjMax */

if ((c->x86_model == 0xf) && (c->x86_mask < 4)) {
usemsr_ee = 0;
}

/* Atoms seems to have TjMax at 90C */
/* Atom CPUs */

if (c->x86_model == 0x1c) {
usemsr_ee = 0;
tjmax = 90000;

host_bridge = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));

if (host_bridge && host_bridge->vendor == PCI_VENDOR_ID_INTEL
&& (host_bridge->device == 0xa000 /* NM10 based nettop */
|| host_bridge->device == 0xa010)) /* NM10 based netbook */
tjmax = 100000;
else
tjmax = 90000;

pci_dev_put(host_bridge);
}

if ((c->x86_model > 0xe) && (usemsr_ee)) {
Expand Down

0 comments on commit 1fe63ab

Please sign in to comment.