Skip to content

Commit

Permalink
dcmi: update parameters to read temperature sensors
Browse files Browse the repository at this point in the history
Issue:
When the system has number of CPU temperature sensors more than 8,
"ipmitool dcmi get_temp_reading" can not show all of sensors.

Root cause:
To request to read multiple sensors for each message, ipmitool has to
send "Get Temperature Readings" command with the "Entity Instance" always
0 and the "Entity Instance Start" as the offset. But the current code is
sending "Entity Instance" is offset and "Entity Instance Start" always is
0. It makes ipmitool only read 1 sensor each time. Besides that, the
"Entity Instance Start" value starts from 1 (not 0), therefore, the
initialization has to be set to 1.

Solution:
This commit corrects the order of parameters and the initialization of
"Entity Instance Start" byte.

Resolves ipmitool/ipmitool#3

Tested:
1. Update BMC software to support 24 CPU temperature sensors
2. Request to read the temperature sensors
$ipmitool dcmi get_temp_reading
3. Display full 24 CPU temperature sensors.

Signed-off-by: Thang Tran <thuutran@amperecomputing.com>
  • Loading branch information
thangtran-ampere authored and Alexander Amelkin committed Oct 29, 2023
1 parent ed6baeb commit ab5ce5b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ipmi_dcmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1595,15 +1595,15 @@ ipmi_dcmi_prnt_get_temp_readings(struct ipmi_intf * intf)
continue;
}
/* Total number of available instances for the Entity ID */
offset = 0;
offset = 1;
tota_inst = rsp->data[1];
while (tota_inst > 0) {
get_inst = ((tota_inst / DCMI_MAX_BYTE_TEMP_READ_SIZE) ?
DCMI_MAX_BYTE_TEMP_READ_SIZE :
(tota_inst % DCMI_MAX_BYTE_TEMP_READ_SIZE));
rsp = ipmi_dcmi_get_temp_readings(intf,
dcmi_temp_read_vals[i].val,
offset, 0);
0, offset);
if (chk_rsp(rsp)) {
continue;
}
Expand Down

0 comments on commit ab5ce5b

Please sign in to comment.