Artem Senichev | 67355a8 | 2018-03-16 12:35:51 +0300 | [diff] [blame] | 1 | From a1f98d850d356001d37242ccf13f94114bd6378c Mon Sep 17 00:00:00 2001 |
| 2 | From: Artem Senichev <a.senichev@yadro.com> |
| 3 | Date: Tue, 13 Mar 2018 15:44:05 +0300 |
| 4 | Subject: [PATCH] Fill empty sensor id to reserved id 0xFF |
| 5 | |
Artem Senichev | 18bb8e5 | 2018-04-02 11:46:13 +0300 | [diff] [blame] | 6 | |
| 7 | Hank Chang: This patch achieves the following goals: |
| 8 | a. Auto set all empty sensors with reserved ID - 0xFF instead of being 0x0 in |
| 9 | the mrw process (would cause some duplicate sensor@0 in skiboot) |
| 10 | b. In this way, they could simply save 128 empty DIMM_Temp* IDs to become |
| 11 | all 0xFF, and OCC would still report all the non-zero ID's DIMM_Temp* |
| 12 | reading in the poll response. |
| 13 | And then, apply another "occ-0001-Add-DIMM-temperature-sensors.patch" |
| 14 | can customize/override these 0xFF temp_sid again based on the different |
| 15 | CPU/Cen/DIMM index which can be decoded by OpenBMC accordingly. |
| 16 | c. Just simply prints the "N/A" (0xFF) string in the *.rpt file for reviewing |
| 17 | all the undefined/reserved sensor targets. |
| 18 | |
Artem Senichev | 67355a8 | 2018-03-16 12:35:51 +0300 | [diff] [blame] | 19 | Originally created by MSI (S188) |
| 20 | |
| 21 | Signed-off-by: Artem Senichev <a.senichev@yadro.com> |
| 22 | --- |
| 23 | src/usr/ipmi/ipmisensor.C | 5 +---- |
| 24 | src/usr/targeting/common/processMrw.pl | 21 ++++++++++++++++++--- |
| 25 | 2 files changed, 19 insertions(+), 7 deletions(-) |
| 26 | |
| 27 | diff --git a/src/usr/ipmi/ipmisensor.C b/src/usr/ipmi/ipmisensor.C |
| 28 | index 4aa1c9f4b..a5bded63a 100644 |
| 29 | --- a/src/usr/ipmi/ipmisensor.C |
| 30 | +++ b/src/usr/ipmi/ipmisensor.C |
| 31 | @@ -216,14 +216,11 @@ namespace SENSOR |
| 32 | } |
| 33 | else |
| 34 | { |
| 35 | - TRACFCOMP(g_trac_ipmi,"We were not able to find a sensor number in" |
| 36 | + TRACFCOMP(g_trac_ipmi,"Found a reserved sensor number (0xFF) in" |
| 37 | " the IPMI_SENSORS attribute for sensor_name=0x%x" |
| 38 | "for target with huid=0x%x, skipping call to " |
| 39 | "sendSetSensorReading()", |
| 40 | iv_name, TARGETING::get_huid( iv_target )); |
| 41 | - |
| 42 | - assert(false); |
| 43 | - |
| 44 | } |
| 45 | |
| 46 | return l_err; |
| 47 | diff --git a/src/usr/targeting/common/processMrw.pl b/src/usr/targeting/common/processMrw.pl |
| 48 | index 8bfa7bddd..45d250872 100644 |
| 49 | --- a/src/usr/targeting/common/processMrw.pl |
| 50 | +++ b/src/usr/targeting/common/processMrw.pl |
| 51 | @@ -239,14 +239,29 @@ sub processIpmiSensors { |
| 52 | $sensor_name=$name."_".$name_suffix; |
| 53 | } |
| 54 | my $attribute_name=""; |
| 55 | - my $s=sprintf("0x%02X%02X,0x%02X", |
| 56 | - oct($sensor_type),oct($entity_id),oct($sensor_id)); |
| 57 | - push(@sensors,$s); |
| 58 | + |
| 59 | + if ($sensor_id ne "") |
| 60 | + { |
| 61 | + my $s = sprintf("0x%02X%02X,0x%02X", |
| 62 | + oct($sensor_type), oct($entity_id), oct($sensor_id)); |
| 63 | + push(@sensors, $s); |
| 64 | + } |
| 65 | + else |
| 66 | + { |
| 67 | + my $s = sprintf("0x%02X%02X,0xFF", |
| 68 | + oct($sensor_type), oct($entity_id)); |
| 69 | + push(@sensors, $s); |
| 70 | + } |
| 71 | + |
| 72 | my $sensor_id_str = ""; |
| 73 | if ($sensor_id ne "") |
| 74 | { |
| 75 | $sensor_id_str = sprintf("0x%02X",oct($sensor_id)); |
| 76 | } |
| 77 | + else |
| 78 | + { |
| 79 | + $sensor_id_str = sprintf("N/A"); |
| 80 | + } |
| 81 | my $str=sprintf( |
| 82 | " %30s | %10s | 0x%02X | 0x%02X | 0x%02x |" . |
| 83 | " %4s | %4d | %4d | %10s | %s\n", |
| 84 | -- |
| 85 | 2.14.1 |
| 86 | |