x86_pkg_temp_thermal: Fix the thermal zone type
PATCH 1/1 x86_pkg_temp_thermal: Fix the thermal zone type
The thermal zone type should not include an instance number. Otherwise each zone is considered a different type and the thermal-to-hwmon bridge fails to group them all in a single hwmon device.
I also changed the type to "x86_pkg_temp", because "pkg" was too generic, and other thermal drivers use an underscore, not a dash, as a separator. Or maybe "cpu_pkg_temp" would be better?
---
Candidate for stable trees?
drivers/thermal/x86_pkg_temp_thermal.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/thermal/x86_pkg_temp_thermal.c +1 -4
@@ -394,7 +394,6 @@ static int pkg_temp_thermal_device_add(uint err;u32 tj_max;struct phy_dev_entry *phy_dev_entry; -char buffer[30 ];int thres_count;u32 eax, ebx, ecx, edx;u8 *temp;
@@ -440,9 +439,7 @@ static int pkg_temp_thermal_device_add(u phy_dev_entry->first_cpu = cpu; phy_dev_entry->tj_max = tj_max; phy_dev_entry->ref_cnt =1 ; -snprintf (buffer,sizeof (buffer),"pkg-temp-%d\n" , - phy_dev_entry->phys_proc_id); - phy_dev_entry->tzone = thermal_zone_device_register(buffer, + phy_dev_entry->tzone = thermal_zone_device_register("x86_pkg_temp", thres_count, (thres_count == MAX_NUMBER_OF_TRIPS) ? 0x03 : 0x01,
Signature · 2 lines
Jean Delvare SUSE L3 Support
Rui, Eduardo,
We start getting more complaints from libsensors users, for example:
http://lists.lm-sensors.org/pipermail/lm-sensors/2014-March/041486.html
So it would be great to have this fix (and the following one) upstream quickly.
Thanks,
Jean
Quoted 40 lines · Jean Delvare
The thermal zone type should not include an instance number. Otherwise each zone is considered a different type and the thermal-to-hwmon bridge fails to group them all in a single hwmon device.
I also changed the type to "
x86_pkg_temp", because "pkg" was too generic, and other thermal drivers use an underscore, not a dash, as a separator. Or maybe "cpu_pkg_temp" would be better?Signed-off-by Jean Delvare <[email protected]>Cc Zhang Rui <[email protected]>Cc Eduardo Valentin <[email protected]>---
Candidate for stable trees?drivers/thermal/x86_pkg_temp_thermal.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/thermal/x86_pkg_temp_thermal.c +1
-4@@ -394,7 +394,6 @@ static int pkg_temp_thermal_device_add(uint err;u32 tj_max;struct phy_dev_entry *phy_dev_entry; -char buffer[30 ];int thres_count;u32 eax, ebx, ecx, edx;u8 *temp;@@ -440,9 +439,7 @@ static int pkg_temp_thermal_device_add(u phy_dev_entry->first_cpu = cpu; phy_dev_entry->tj_max = tj_max; phy_dev_entry->ref_cnt =1 ; -snprintf (buffer,sizeof (buffer),"pkg-temp-%d\n" , - phy_dev_entry->phys_proc_id); - phy_dev_entry->tzone = thermal_zone_device_register(buffer, + phy_dev_entry->tzone = thermal_zone_device_register("x86_pkg_temp", thres_count, (thres_count == MAX_NUMBER_OF_TRIPS) ? 0x03 : 0x01,