Skip to contentSkip to conversation

Hwmon: Merge Pkgtemp with Coretemp

PATCH Superseded Durgadoss R 2 participants 4 messages May 14, 2011 – May 17, 2011

Subsystems (3)

v7 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

PATCH v7 1/1 Hwmon: Merge Pkgtemp with Coretemp

This patch merges the pkgtemp with coretemp driver. The sysfs interfaces for all cores in the same pkg are shown under one directory, in hwmon. It also supports CONFIG_HOTPLUG_CPU. So, the sysfs interfaces are created when each core comes online and are removed when it goes offline.

---
v1:
* Basic Merging of pkgtemp with coretemp.
* Creates one hwmon device per core.
v2:
* Fixed some Data structure related comments from v1.
* Creates one hwmon device per core.
v3:
* Creates one hwmon device per physical package.
* No appropriate support for CPU hotplug.
v4:
* Creates one hwmon device per package.
* Added appropriate support for CONFIG_HOTPLUG_CPU.
v5:
* Changed naming of sysfs based on core_id
* Changed all %d to %u appropriately
* Removed unnecessary variables crit/max_alarm
* Fixed the flow of show_temp method
* Removed unwanted print messages
* Removed per-core related code from coretemp_device_add
* Corrected the error handling in get_core_online
v6:
* Added support to bring a HT core online, when real core is offlined
* Updated the Documentation/hwmon/coretemp
* Rearranged the code to avoid forward declarations
* Added locking for coretemp_remove_core method
* Added appropriate CONFIG_SMP #ifdefs
* Made variables static in create_core_attrs method
v7:
* Removed unnecessary mutexes from create_core_data and remove_core methods
* Fixed data->valid conditions in show_temp method
* Fixed coretemp_get_pdev for non-smp config

 Documentation/hwmon/coretemp |   21 +-
 drivers/hwmon/coretemp.c     |  652 ++++++++++++++++++++++++++++-------------
 2 files changed, 459 insertions(+), 214 deletions(-)
Documentation/hwmon/coretemp +14 -7
index 25568f8..f85e913 100644
@@ -15,8 +15,13 @@ Author: Rudolf Marek
 
 Description
 -----------
+This driver permits reading the DTS (Digital Temperature Sensor) embedded
+inside Intel CPUs. This driver can read both the per-core and per-package
+temperature using the appropriate sensors. The per-package sensor is new;
+as of now, it is present only in the SandyBridge platform. The driver will
+show the temperature of all cores inside a package under a single device
+directory inside hwmon.
 
-This driver permits reading temperature sensor embedded inside Intel Core CPU.
 Temperature is measured in degrees Celsius and measurement resolution is
 1 degree C. Valid temperatures are from 0 to TjMax degrees C, because
 the actual value of temperature register is in fact a delta from TjMax.
@@ -27,13 +32,15 @@ mechanism will perform actions to forcibly cool down the processor. Alarm
 may be raised, if the temperature grows enough (more than TjMax) to trigger
 the Out-Of-Spec bit. Following table summarizes the exported sysfs files:
 
-temp1_input	 - Core temperature (in millidegrees Celsius).
-temp1_max	 - All cooling devices should be turned on (on Core2).
-temp1_crit	 - Maximum junction temperature (in millidegrees Celsius).
-temp1_crit_alarm - Set when Out-of-spec bit is set, never clears.
+All Sysfs entries are named with their core_id (represented here by 'X').
+tempX_input	 - Core temperature (in millidegrees Celsius).
+tempX_max	 - All cooling devices should be turned on (on Core2).
+tempX_crit	 - Maximum junction temperature (in millidegrees Celsius).
+tempX_crit_alarm - Set when Out-of-spec bit is set, never clears.
 		   Correct CPU operation is no longer guaranteed.
-temp1_label	 - Contains string "Core X", where X is processor
-		   number.
+tempX_label	 - Contains string "Core X", where X is processor
+		   number. For Package temp, this will be "Physical id Y",
+		   where Y is the package number.
 
 The TjMax temperature is set to 85 degrees C if undocumented model specific
 register (UMSR) 0xee has bit 30 set. If not the TjMax is 100 degrees C as
drivers/hwmon/coretemp.c +445 -207

778 lines not on this page · raw message

Signature · 7 lines
1.6.1


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#1 lore raw
Quoted 8 lines · Durgadoss R

This patch merges the pkgtemp with coretemp driver. The sysfs interfaces for all cores in the same pkg are shown under one directory, in hwmon. It also supports CONFIG_HOTPLUG_CPU. So, the sysfs interfaces are created when each core comes online and are removed when it goes offline.

Hi,

I did some testing on a SandyBridge system with two CPUs.

If I take all cores of the second CPU offline, the second instance of the driver still sticks around and tries to display the package sensor temperature. However, the temperature is always reported as "N/A". I think the driver instace should be removed if all cores of a CPU are offline.

Also, the Physical ID is "0" for both CPUs. Is this intentional ? It does not make much sense to me.

Thanks,
Guenter

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#2 lore raw
In reply to Durgadoss R

Hi Guenter,

Quoted 9 lines

Hi,

I did some testing on a SandyBridge system with two CPUs.

If I take all cores of the second CPU offline, the second instance of the driver
still sticks around and tries to display the package sensor temperature. However, the temperature is always reported as "N/A". I think the driver instance should be removed if all cores of a CPU are offline.

I agree with you that the driver instance should be removed, in this case. But how can we find that all cores of a CPU are offline ?
One way is to use a "count" variable and manipulate it when cores are Onlined/offlined. Kindly let me know of any better ways to implement this.

Quoted 2 lines

Also, the Physical ID is "0" for both CPUs. Is this intentional ? It does not make much sense to me.

Got it.. It is not intentional...I missed it..
Shall add this in the next version.

Thanks,
Durga

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#3 lore raw
In reply to Durgadoss R
Quoted 12 lines · Durgadoss

Hi Guenter,

Quoted 9 lines

Hi,

I did some testing on a SandyBridge system with two CPUs.

If I take all cores of the second CPU offline, the second instance of the driver
still sticks around and tries to display the package sensor temperature. However, the temperature is always reported as "N/A". I think the driver instance should be removed if all cores of a CPU are offline.

Quoted 5 lines

I agree with you that the driver instance should be removed, in this case. But how can we find that all cores of a CPU are offline ?
One way is to use a "count" variable and manipulate it when cores are Onlined/offlined. Kindly let me know of any better ways to implement this.

You can define a counter in platform_data, or write a simple function to count the number of online cores for a given physical processor in pdev_list.

A simpler mechanism might be to use cpu_core_mask(). Not sure if that works, though.

Thanks,
Guenter

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors