From 8d3e7a742e11a79f2d86ec22b75510fe8c123f7d Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Mon, 23 Nov 2009 12:15:26 +0000 Subject: [PATCH] Restore detection for AMD Family 10h thermal sensors. Only CPU with model > 2 are reported, as older ones are known to have broken sensors. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5800 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 2 +- prog/detect/sensors-detect | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 3072cd61..0ad18ce9 100644 --- a/CHANGES +++ b/CHANGES @@ -25,7 +25,7 @@ SVN-HEAD The SMSC LPC47M233 isn't currently supported Support upcoming sysfs path to i2c adapters Rename the modprobe configuration file to lm_sensors.conf - Drop AMD K10 detection (unreliable sensors) + Only report AMD Family 10h CPU with model > 2 Add detection for AMD Family 11h thermal sensors Add detection for Intel Atom thermal sensors Add detection for National Semiconductor LM73 diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index aa184309..d4f774a4 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -1877,6 +1877,10 @@ use vars qw(@cpu_ids); name => "AMD K8 thermal sensors", driver => "k8temp", detect => \&k8temp_pci_detect, + }, { + name => "AMD Family 10h thermal sensors", + driver => "to-be-written", + detect => \&fam10h_pci_detect, }, { name => "AMD Family 11h thermal sensors", driver => "to-be-written", @@ -5334,6 +5338,25 @@ sub k8temp_pci_detect return 9; } +sub fam10h_pci_detect +{ + return unless exists $pci_list{'1022:1203'}; + + # Errata 319 (Inaccurate Temperature Measurement) affects + # revisions DR-BA, DR-B2 and DR-B3, all have model number = 2. + # So we only pick CPU with model number > 2. + my $probecpu; + foreach $probecpu (@cpu) { + if ($probecpu->{vendor_id} eq 'AuthenticAMD' && + $probecpu->{'cpu family'} == 0x10 && + $probecpu->{model} > 2) { + return 9; + } + } + + return; +} + sub fam11h_pci_detect { return unless exists $pci_list{'1022:1303'};