corrected amd tctl/tdie sensor failure

This commit is contained in:
Harald Hope 2022-07-27 13:26:45 -07:00
parent ff81310652
commit 6d71f06c3e
2 changed files with 22 additions and 1 deletions

16
inxi
View file

@ -23421,7 +23421,7 @@ sub lm_sensors_data {
# NOTE: I've seen an inexplicable case where: CPU:52.0°C fails to match with [\s°] but
# does match with: [\s°]*. I can't account for this, but that's why the * is there
# Tdie is a new k10temp-pci syntax for real cpu die temp. Tctl is cpu control value,
# NOT the real cpu die temp.
# NOT the real cpu die temp: UNLESS tctl and tdie are equal, sigh..
elsif ($_ =~ /^(Chip 0.*?|T?CPU.*|Tdie.*):([0-9\.]+)[\s°]*(C|F)/i){
$temp_working = $2;
$working_unit = $3;
@ -23431,6 +23431,15 @@ sub lm_sensors_data {
}
$sensors->{'temp-unit'} = set_temp_unit($sensors->{'temp-unit'},$working_unit) if $working_unit;
}
elsif ($_ =~ /^(Tctl.*):([0-9\.]+)[\s°]*(C|F)/i){
$temp_working = $2;
$working_unit = $3;
if (!$sensors->{'tctl-temp'} ||
(defined $temp_working && $temp_working > 0 && $temp_working > $sensors->{'tctl-temp'})){
$sensors->{'tctl-temp'} = $temp_working;
}
$sensors->{'temp-unit'} = set_temp_unit($sensors->{'temp-unit'},$working_unit) if $working_unit;
}
elsif ($_ =~ /^PECI\sAgent\s0.*:([0-9\.]+)[\s°]*(C|F)/i){
$sensors->{'cpu-peci-temp'} = $1;
$working_unit = $2;
@ -23755,6 +23764,11 @@ sub process_data {
my ($fan_type,$i,$j,$index_count_fan_default,$index_count_fan_main) = (0,0,0,0,0);
my $temp_diff = 20; # for C, handled for F after that is determined
my (@fan_main,@fan_default);
# kernel/sensors only show Tctl if Tctl == Tdie temp, sigh...
if (!$sensors->{'cpu-temp'} && $sensors->{'tctl-temp'}){
$sensors->{'cpu-temp'} = $sensors->{'tctl-temp'};
undef $sensors->{'tctl-temp'};
}
# first we need to handle the case where we have to determine which temp/fan to use for cpu and mobo:
# note, for rare cases of weird cool cpus, user can override in their prefs and force the assignment
# this is wrong for systems with > 2 tempX readings, but the logic is too complex with 3 variables

View file

@ -78,6 +78,10 @@ read as Rage-9.
Trinity, not KDE-Plasma as the desktop. Further, it failed to show Trinity
version, maybe because Trinity was not installed?
10. Finally found cause of Tdie vanishing in favor of Tctl, a bad decision to
hide Tdie if Tdie == Tctl, why they did that, I don't know, but at least nwo,
there will be AMD Zen cpu temp again.
--------------------------------------------------------------------------------
ENHANCEMENTS:
@ -453,6 +457,9 @@ Corrected this in print_basic() by using max-cols-basic.
7. Fixed broken sandisk vendor id.
8. Finally found docs that explain, for some terrible reason, if Tctl and Tdie
are the same, sensors or kernel does not show Tdie, sigh...
--------------------------------------------------------------------------------
ENHANCEMENTS: