From f03937aa32b79e8bde0fa5ff09a0e11e4750bb6f Mon Sep 17 00:00:00 2001 From: Corey Swenson Date: Mon, 14 Jan 2019 12:46:22 -0600 Subject: [PATCH] Vesnin patch Change-Id: I1116c92f9176d53630a9316312656c03f2a16723 Hank Chang: This patch achieves the following goals: a. Auto set all empty sensors with reserved ID - 0xFF instead of being 0x0 in the mrw process (would cause some duplicate sensor@0 in skiboot) b. In this way, they could simply save 128 empty DIMM_Temp* IDs to become all 0xFF, and OCC would still report all the non-zero ID's DIMM_Temp* reading in the poll response. And then, apply another "occ-0001-Add-DIMM-temperature-sensors.patch" can customize/override these 0xFF temp_sid again based on the different CPU/Cen/DIMM index which can be decoded by OpenBMC accordingly. c. Just simply prints the "N/A" (0xFF) string in the *.rpt file for reviewing all the undefined/reserved sensor targets. Originally created by MSI (S188) Signed-off-by: Artem Senichev --- src/usr/ipmiext/ipmisensor.C | 6 ++---- src/usr/targeting/common/processMrw.pl | 25 ++++++++++++++++++++----- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/usr/ipmiext/ipmisensor.C b/src/usr/ipmiext/ipmisensor.C index e3c6405..63a4196 100644 --- a/src/usr/ipmiext/ipmisensor.C +++ b/src/usr/ipmiext/ipmisensor.C @@ -6,6 +6,7 @@ /* OpenPOWER HostBoot Project */ /* */ /* Contributors Listed Below - COPYRIGHT 2014,2019 */ +/* [+] International Business Machines Corp. */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ @@ -214,14 +215,11 @@ namespace SENSOR } else { - TRACFCOMP(g_trac_ipmi,"We were not able to find a sensor number in" + TRACFCOMP(g_trac_ipmi,"Found a reserved sensor number (0xFF) in" " the IPMI_SENSORS attribute for sensor_name=0x%x" "for target with huid=0x%x, skipping call to " "sendSetSensorReading()", iv_name, TARGETING::get_huid( iv_target )); - - assert(false); - } return l_err; diff --git a/src/usr/targeting/common/processMrw.pl b/src/usr/targeting/common/processMrw.pl index 8bfa7bd..66783c8 100644 --- a/src/usr/targeting/common/processMrw.pl +++ b/src/usr/targeting/common/processMrw.pl @@ -6,7 +6,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2015,2017 +# Contributors Listed Below - COPYRIGHT 2015,2019 # [+] International Business Machines Corp. # # @@ -239,14 +239,29 @@ sub processIpmiSensors { $sensor_name=$name."_".$name_suffix; } my $attribute_name=""; - my $s=sprintf("0x%02X%02X,0x%02X", - oct($sensor_type),oct($entity_id),oct($sensor_id)); - push(@sensors,$s); + + if ($sensor_id ne "") + { + my $s = sprintf("0x%02X%02X,0x%02X", + oct($sensor_type), oct($entity_id), oct($sensor_id)); + push(@sensors, $s); + } + else + { + my $s = sprintf("0x%02X%02X,0xFF", + oct($sensor_type), oct($entity_id)); + push(@sensors, $s); + } + my $sensor_id_str = ""; if ($sensor_id ne "") { $sensor_id_str = sprintf("0x%02X",oct($sensor_id)); } + else + { + $sensor_id_str = sprintf("N/A"); + } my $str=sprintf( " %30s | %10s | 0x%02X | 0x%02X | 0x%02x |" . " %4s | %4d | %4d | %10s | %s\n", @@ -1428,7 +1443,7 @@ Options: exit(1); } -# eliminate extra whitespace +# eliminate extra whitespace # Input: string to chop sub nowhitespace { -- 1.8.2.2