]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (k8temp) Bypass core swapping on single-core processors
authorJean Delvare <khali@linux-fr.org>
Sun, 20 Jun 2010 07:22:32 +0000 (09:22 +0200)
committerJean Delvare <khali@linux-fr.org>
Sun, 20 Jun 2010 07:22:32 +0000 (09:22 +0200)
commitcc9e575b1871c03c75ff1d35da2b645bb7283da8
tree11a3b26e3b66bb3a971c8029ccb559e2c0e1ea88
parentc60448fde91ff32c9898f800c6b32e8923d1a57a
hwmon: (k8temp) Bypass core swapping on single-core processors

Commit 03df2e3abda731e461f6ea15d80e9b0387e853ad introduced core
swapping for CPU models 64 and later. I recently had a report about
a Sempron 3200+, model 95, for which this patch broke temperature
reading. It happens that this is a single-core processor, so the
effect of the swapping was to read a temperature value for a core
that didn't exist, leading to an incorrect value (-49 degrees C.)

Disabling core swapping on singe-core processors should fix this.

Additional comment from Andreas:

The BKDG says

  Thermal Sensor Core Select (ThermSenseCoreSel)-Bit 2. This bit
  selects the CPU whose temperature is reported in the CurTemp
  field. This bit only applies to dual core processors. For
  single core processors CPU0 Thermal Sensor is always selected.

k8temp_probe() correctly detected that SEL_CORE can't be used on single
core CPU. Thus k8temp did never update the temperature values stored
in temp[1][x] and -49 degrees was reported. For single core CPUs we
must use the values read into temp[0][x].

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Rick Moritz <rhavin@gmx.net>
Acked-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Cc: stable@kernel.org
drivers/hwmon/k8temp.c