Skip to content

Commit

Permalink
hw-mgmt: thermal: Add static sensor support
Browse files Browse the repository at this point in the history
On init flow, TC scans available sensors and adds them to DB.
Some sensors can be present or not depending on system types. For example sodimm2_temp
present not in all systems, and sensors scan will add it only if exists sensor link in sysfs.
But if the system should have sodimm2 but it is broken, we will not recognize such an issue.

Static sensor - a sensor that should be added, even if HW is not present or broken.
Static sensor list can be added to TC system data JSON file:

"static_sensor_list": ["sodimm2", "sensor_amb", "cpu_pack"]

Bug: #3569409

Signed-off-by: Oleksandr Shamray <[email protected]>
  • Loading branch information
sholeksandr committed Aug 10, 2023
1 parent a2f78fb commit db32b6b
Show file tree
Hide file tree
Showing 18 changed files with 165 additions and 84 deletions.
1 change: 1 addition & 0 deletions usr/etc/hw-management-thermal/tc_config_default.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "default",
"dmin" : {
"C2P": {
"untrusted": {"-127:120": 100},
Expand Down
4 changes: 3 additions & 1 deletion usr/etc/hw-management-thermal/tc_config_mqm8700.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "mqm8700",
"dmin" : {
"C2P": {
"untrusted": {"-127:25": 20, "26:40": 30, "41:120": 40},
Expand Down Expand Up @@ -44,5 +45,6 @@
"sensor_amb": {"pwm_min": 20, "pwm_max" : 50, "val_min": 30000, "val_max": 50000, "poll_time": 30},
"voltmon\\d+_temp": {"pwm_min": 20, "pwm_max": 100, "val_min": "!85000", "val_max": "!125000", "poll_time": 60},
"sodimm\\d_temp" :{"pwm_min": 20, "pwm_max" : 70, "val_min": "!70000", "val_max": 95000, "poll_time": 60}
}
},
"sensor_list" : ["asic1", "cpu", "drwr1", "drwr2", "drwr3", "drwr4", "drwr5", "drwr6", "psu1", "psu2", "sensor_amb", "voltmon1", "voltmon2"]
}
3 changes: 2 additions & 1 deletion usr/etc/hw-management-thermal/tc_config_mqm9700.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@
"voltmon\\d+_temp":{"pwm_min": 30, "pwm_max" : 100, "val_min": "!85000", "val_max": "!125000", "poll_time": 60},
"sodimm\\d_temp" :{"pwm_min": 30, "pwm_max" : 70, "val_min": "!70000", "val_max": 95000, "poll_time": 60},
"sensor_amb": {"pwm_min": 20, "pwm_max" : 40, "val_min": 30000, "val_max": 50000, "poll_time": 30}
}
},
"sensor_list" : ["asic1", "cpu", "drwr1", "drwr2", "drwr3", "drwr4", "drwr5", "drwr6", "drwr7", "psu1", "psu2", "sensor_amb", "voltmon1", "voltmon3", "voltmon4", "voltmon5", "voltmon6"]
}
4 changes: 3 additions & 1 deletion usr/etc/hw-management-thermal/tc_config_msn2010.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "msn2010",
"dmin" : {
"C2P": {
"untrusted": {"-127:15": 20, "16:20": 30, "21:30": 40, "31:35": 40, "36:120": 60},
Expand Down Expand Up @@ -44,5 +45,6 @@
"voltmon\\d+_temp": {"pwm_min": 20, "pwm_max": 100, "val_min": "!85000", "val_max": "!125000", "poll_time": 60},
"sodimm\\d_temp" :{"pwm_min": 20, "pwm_max" : 70, "val_min": "!70000", "val_max": 95000, "poll_time": 60}
},
"asic_config" : {"1": {"bus" : 2, "addr" : "0048", "pwm_control": true, "fan_control": true}}
"asic_config" : {"1": {"bus" : 2, "addr" : "0048", "pwm_control": true, "fan_control": true}},
"sensor_list" : ["asic1", "cpu", "drwr1", "drwr2", "drwr3", "drwr4", "sensor_amb", "voltmon1", "voltmon2"]
}
4 changes: 3 additions & 1 deletion usr/etc/hw-management-thermal/tc_config_msn2100.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "msn2100",
"dmin" : {
"C2P": {
"untrusted": {"-127:15": 20, "16:20": 30, "21:30": 40, "31:35": 40, "36:120": 60},
Expand Down Expand Up @@ -44,5 +45,6 @@
"voltmon\\d+_temp": {"pwm_min": 20, "pwm_max": 100, "val_min": "!85000", "val_max": "!125000", "poll_time": 60},
"sodimm\\d_temp" :{"pwm_min": 20, "pwm_max" : 70, "val_min": "!70000", "val_max": 95000, "poll_time": 60}
},
"asic_config" : {"1": {"bus" : 2, "addr" : "0048", "pwm_control": true, "fan_control": true}}
"asic_config" : {"1": {"bus" : 2, "addr" : "0048", "pwm_control": true, "fan_control": true}},
"sensor_list" : ["asic1", "cpu", "drwr1", "drwr2", "drwr3", "drwr4", "sensor_amb", "voltmon1", "voltmon2", "voltmon6"]
}
4 changes: 3 additions & 1 deletion usr/etc/hw-management-thermal/tc_config_msn2201.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "msn2210",
"dmin" : {
"C2P": {
"untrusted": {"-127:20": 30, "21:25": 40, "26:30": 50, "31:35": 60, "36:40": 70, "41:120": 80},
Expand Down Expand Up @@ -44,5 +45,6 @@
"voltmon\\d+_temp": {"pwm_min": 20, "pwm_max": 100, "val_min": "!85000", "val_max": "!125000", "poll_time": 60},
"sodimm\\d_temp" :{"pwm_min": 20, "pwm_max" : 70, "val_min": "!70000", "val_max": 95000, "poll_time": 60}
},
"asic_config" : {"1": {"bus" : 2, "addr" : "0048", "pwm_control": true, "fan_control": true}}
"asic_config" : {"1": {"bus" : 2, "addr" : "0048", "pwm_control": true, "fan_control": true}},
"sensor_list" : ["asic1", "cpu", "drwr1", "drwr2", "drwr3", "drwr4", "psu1", "psu2", "sensor_amb"]
}
3 changes: 2 additions & 1 deletion usr/etc/hw-management-thermal/tc_config_msn2700_msb7x00.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
"voltmon\\d+_temp": {"pwm_min": 30, "pwm_max": 100, "val_min": "!85000", "val_max": "!125000", "poll_time": 60},
"sodimm\\d_temp" :{"pwm_min": 30, "pwm_max" : 70, "val_min": "!70000", "val_max": 95000, "poll_time": 60}
},
"asic_config" : {"1": {"bus" : 2, "addr" : "0048", "pwm_control": true, "fan_control": true}}
"asic_config" : {"1": {"bus" : 2, "addr" : "0048", "pwm_control": true, "fan_control": true}},
"sensor_list" : ["asic1", "cpu", "drwr1", "drwr2", "drwr3", "drwr4", "psu1", "psu2", "sensor_amb", "voltmon1", "voltmon2", "voltmon6"]
}


4 changes: 3 additions & 1 deletion usr/etc/hw-management-thermal/tc_config_msn3420.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "msn34200",
"dmin" : {
"C2P": {
"untrusted": {"-127:25": 20, "26:40": 30, "41:120": 40},
Expand Down Expand Up @@ -44,5 +45,6 @@
"sensor_amb": {"pwm_min": 20, "pwm_max" : 50, "val_min": 30000, "val_max": 50000, "poll_time": 30},
"voltmon\\d+_temp": {"pwm_min": 20, "pwm_max": 100, "val_min": "!85000", "val_max": "!125000", "poll_time": 60},
"sodimm\\d_temp" :{"pwm_min": 20, "pwm_max" : 70, "val_min": "!70000", "val_max": 95000, "poll_time": 60}
}
},
"sensor_list" : ["asic1", "cpu", "drwr1", "drwr2", "drwr3", "drwr4", "drwr5", "psu1", "psu2", "sensor_amb", "voltmon1", "voltmon2"]
}
4 changes: 3 additions & 1 deletion usr/etc/hw-management-thermal/tc_config_msn3700.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "msn3700",
"dmin" : {
"C2P": {
"untrusted": {"-127:25": 20, "26:40": 30, "41:120": 40},
Expand Down Expand Up @@ -44,5 +45,6 @@
"sensor_amb": {"pwm_min": 20, "pwm_max" : 50, "val_min": 30000, "val_max": 50000, "poll_time": 30},
"voltmon\\d+_temp": {"pwm_min": 20, "pwm_max": 100, "val_min": "!85000", "val_max": "!125000", "poll_time": 60},
"sodimm\\d_temp" :{"pwm_min": 20, "pwm_max" : 70, "val_min": "!70000", "val_max": 95000, "poll_time": 60}
}
},
"sensor_list" : ["asic1", "cpu", "drwr1", "drwr2", "drwr3", "drwr4", "drwr5", "drwr6", "psu1", "psu2", "sensor_amb", "voltmon1", "voltmon2"]
}
6 changes: 4 additions & 2 deletions usr/etc/hw-management-thermal/tc_config_msn3700C.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
{
"name": "msn3700C",
"dmin" : {
"C2P": {
"untrusted": {"-127:25": 20, "26:40": 30, "41:120": 40},
Expand Down Expand Up @@ -44,5 +45,6 @@
"sensor_amb": {"pwm_min": 20, "pwm_max" : 50, "val_min": 30000, "val_max": 50000, "poll_time": 30},
"voltmon\\d+_temp": {"pwm_min": 20, "pwm_max": 100, "val_min": "!85000", "val_max": "!125000", "poll_time": 60},
"sodimm\\d_temp" :{"pwm_min": 20, "pwm_max" : 70, "val_min": "!70000", "val_max": 95000, "poll_time": 60}
}
},
"sensor_list" : ["asic1", "cpu", "drwr1", "drwr2", "drwr3", "drwr4", "drwr5", "drwr6", "psu1", "psu2", "sensor_amb", "voltmon1", "voltmon2"]
}
6 changes: 4 additions & 2 deletions usr/etc/hw-management-thermal/tc_config_msn3800.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
{
"name": "msn3800",
"dmin" : {
"C2P": {
"fan_err": {
Expand Down Expand Up @@ -44,5 +45,6 @@
"voltmon\\d+_temp": {"pwm_min": 20, "pwm_max": 100, "val_min": "!85000", "val_max": "!125000", "poll_time": 60},
"sodimm\\d_temp" :{"pwm_min": 20, "pwm_max" : 70, "val_min": "!70000", "val_max": 95000, "poll_time": 60},
"gearbox\\d+": {"pwm_min": 20, "pwm_max" : 100, "val_min":"!70000", "val_max":"!105000", "poll_time": 20}
}
},
"sensor_list" : ["asic1", "cpu", "drwr1", "drwr2", "drwr3", "psu1", "psu2", "sensor_amb", "voltmon1", "voltmon2", "voltmon3", "voltmon4"]
}
4 changes: 3 additions & 1 deletion usr/etc/hw-management-thermal/tc_config_msn4410.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "msn4410",
"dmin" : {
"C2P": {
"untrusted": {"-127:25": 20, "26:40": 30, "41:120": 40},
Expand Down Expand Up @@ -44,5 +45,6 @@
"sensor_amb": {"pwm_min": 20, "pwm_max" : 50, "val_min": 30000, "val_max": 50000, "poll_time": 30},
"voltmon\\d+_temp": {"pwm_min": 20, "pwm_max": 100, "val_min": "!85000", "val_max": "!125000", "poll_time": 60},
"sodimm\\d_temp" :{"pwm_min": 20, "pwm_max" : 70, "val_min": "!70000", "val_max": 95000, "poll_time": 60}
}
},
"sensor_list" : ["asic1", "cpu", "drwr1", "drwr2", "drwr3", "drwr4", "drwr5", "drwr6", "psu1", "psu2", "sensor_amb", "voltmon1", "voltmon2", "voltmon3", "voltmon4", "voltmon5", "voltmon6", "voltmon7"]
}
4 changes: 3 additions & 1 deletion usr/etc/hw-management-thermal/tc_config_msn4600.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "msn4600",
"dmin" : {
"C2P": {
"untrusted": {"-127:25": 20, "26:35": 30, "36:120": 40},
Expand Down Expand Up @@ -44,5 +45,6 @@
"sensor_amb": {"pwm_min": 20, "pwm_max" : 40, "val_min": 30000, "val_max": 50000, "poll_time": 30},
"voltmon\\d+_temp": {"pwm_min": 20, "pwm_max": 100, "val_min": "!85000", "val_max": "!125000", "poll_time": 60},
"sodimm\\d_temp" :{"pwm_min": 20, "pwm_max" : 70, "val_min": "!70000", "val_max": 95000, "poll_time": 60}
}
},
"sensor_list" : ["asic1", "cpu", "drwr1", "drwr2", "drwr3", "psu1", "psu2", "sensor_amb", "voltmon1", "voltmon2", "voltmon3", "voltmon5", "voltmon7"]
}
4 changes: 3 additions & 1 deletion usr/etc/hw-management-thermal/tc_config_msn4600C.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "msn4600C",
"dmin" : {
"C2P": {
"untrusted": {"-127:25": 20, "26:35": 30, "36:120": 40},
Expand Down Expand Up @@ -44,5 +45,6 @@
"sensor_amb": {"pwm_min": 20, "pwm_max" : 40, "val_min": 30000, "val_max": 50000, "poll_time": 30},
"voltmon\\d+_temp": {"pwm_min": 20, "pwm_max": 100, "val_min": "!85000", "val_max": "!125000", "poll_time": 60},
"sodimm\\d_temp" :{"pwm_min": 20, "pwm_max" : 70, "val_min": "!70000", "val_max": 95000, "poll_time": 60}
}
},
"sensor_list" : ["asic1", "cpu", "drwr1", "drwr2", "drwr3", "psu1", "psu2", "sensor_amb", "voltmon1", "voltmon2", "voltmon3", "voltmon5", "voltmon7"]
}
3 changes: 2 additions & 1 deletion usr/etc/hw-management-thermal/tc_config_msn4700.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"sensor_amb": {"pwm_min": 20, "pwm_max" : 50, "val_min": 30000, "val_max": 50000, "poll_time": 30},
"voltmon\\d+_temp": {"pwm_min": 20, "pwm_max": 100, "val_min": "!85000", "val_max": "!125000", "poll_time": 60},
"sodimm\\d_temp" :{"pwm_min": 20, "pwm_max" : 70, "val_min": "!70000", "val_max": 95000, "poll_time": 60}
}
},
"sensor_list" : ["asic1", "cpu", "drwr1", "drwr2", "drwr3", "drwr4", "drwr5", "drwr6", "psu1", "psu2", "sensor_amb", "voltmon1", "voltmon2", "voltmon3", "voltmon4", "voltmon5", "voltmon6", "voltmon7"]
}
4 changes: 3 additions & 1 deletion usr/etc/hw-management-thermal/tc_config_msn5600.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "msn5600",
"dmin" : {
"C2P": {
"fan_err": {
Expand Down Expand Up @@ -42,5 +43,6 @@
"sensor_amb": {"pwm_min": 30, "pwm_max" : 50, "val_min": 30000, "val_max": 55000, "poll_time": 30},
"voltmon\\d+_temp": {"pwm_min": 30, "pwm_max": 100, "val_min": "!85000", "val_max": "!125000", "poll_time": 60},
"sodimm\\d_temp" :{"pwm_min": 30, "pwm_max" : 70, "val_min": "!70000", "val_max": 95000, "poll_time": 60}
}
},
"sensor_list" : ["asic1", "cpu", "drwr1", "drwr2", "drwr3", "drwr4", "psu1", "psu2", "sensor_amb", "voltmon1", "voltmon2", "voltmon3", "voltmon4", "voltmon5", "voltmon6", "voltmon7", "voltmon8", "voltmon9", "voltmon10", "voltmon11"]
}
1 change: 1 addition & 0 deletions usr/etc/hw-management-thermal/tc_config_not_supported.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"name": "unsupported platform",
"platform_support" : 0
}
Loading

0 comments on commit db32b6b

Please sign in to comment.