summaryrefslogtreecommitdiffstats
path: root/src/usr/ipmi
diff options
context:
space:
mode:
authorBrian Horton <brianh@linux.ibm.com>2015-08-19 13:41:30 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2015-09-03 14:40:03 -0500
commit0579143faea0a19bd4133ce5179855ec7dc3c9b7 (patch)
treebb79013be84055a49f57913a8aa814ea20c5d776 /src/usr/ipmi
parent06e40c4aa3efe6f006dc7971ad58f08f42117ea3 (diff)
downloadblackbird-hostboot-0579143faea0a19bd4133ce5179855ec7dc3c9b7.tar.gz
blackbird-hostboot-0579143faea0a19bd4133ce5179855ec7dc3c9b7.zip
fix issues with dup sel/esel
. call errlmanager ack inline/synchronously, so that we don't have dup eSELs due to shutdown . don't resend sensor SEL events for errorlogs read out of PNOR Depends-On: Ia2b211d8ebf489e92f2bc3d281d92175a6b61f30 Change-Id: I32c8e49ef2e00567987cdf030a225b61e7077cf6 CQ: SW312094 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/19993 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: WILLIAM G. HOFFA <wghoffa@us.ibm.com> Reviewed-by: Richard J. Knight <rjknight@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/ipmi')
-rw-r--r--src/usr/ipmi/ipmisel.C83
1 files changed, 54 insertions, 29 deletions
diff --git a/src/usr/ipmi/ipmisel.C b/src/usr/ipmi/ipmisel.C
index 54512e606..26ef43771 100644
--- a/src/usr/ipmi/ipmisel.C
+++ b/src/usr/ipmi/ipmisel.C
@@ -32,6 +32,7 @@
#include <ipmi/ipmisel.H>
#include "ipmiconfig.H"
#include <ipmi/ipmi_reasoncodes.H>
+#include <ipmi/ipmisensor.H>
#include <sys/task.h>
#include <initservice/taskargs.H>
@@ -190,8 +191,8 @@ void process_esel(msg_t *i_msg)
else if((l_cc == IPMI::CC_OK) && // no error
(l_eid != 0)) // and it's an errorlog
{
- // eSEL successfully sent to the BMC - 'send' an ack to the errlmanager
- IPMI_TRAC(INFO_MRK "Sending ack for eid 0x%.8X", l_eid);
+ // eSEL successfully sent to the BMC - have errlmanager do the ack
+ IPMI_TRAC(INFO_MRK "Doing ack for eid 0x%.8X", l_eid);
ERRORLOG::ErrlManager::errlAckErrorlog(l_eid);
}
@@ -216,6 +217,14 @@ void send_esel(eselInitData * i_data,
do{
const size_t l_eSELlen = i_data->dataSize;
+
+ if (l_eSELlen == 0)
+ {
+ IPMI_TRAC(INFO_MRK "no eSEL data present, skipping to SEL");
+ // sending sensor SELs only, not the eSEL
+ break;
+ }
+
uint8_t reserveID[2] = {0,0};
// we need to send down the extended sel data (eSEL), which is
// longer than the protocol buffer, so we need to do a reservation and
@@ -339,41 +348,57 @@ void send_esel(eselInitData * i_data,
}while(0);
// if eSEL wasn't created due to an error, we don't want to continue
- if(o_err == NULL)
+ if (o_err == NULL)
{
- // if the eSEL wasn't created due to a bad completion code, we will
- // still try to send down a SEL that we create, which will contain
- // the eSEL recordID (if it was successful)
- delete [] data;
- len = sizeof(IPMISEL::selRecord);
- data = new uint8_t[len];
-
- // copy in the SEL event record data
- memcpy(data, i_data->eSel, sizeof(IPMISEL::selRecord));
- // copy the eSEL recordID (if it was created) into the extra data area
- data[offsetof(selRecord,event_data2)] = esel_recordID[1];
- data[offsetof(selRecord,event_data3)] = esel_recordID[0];
-
- // use local cc so that we don't corrupt the esel from above
- IPMI::completion_code l_cc = IPMI::CC_UNKBAD;
- TRACFBIN( g_trac_ipmi, INFO_MRK"add_sel:", data, len);
- o_err = IPMI::sendrecv(IPMI::add_sel(),l_cc,len,data);
- if(o_err)
+ // caller wants us to NOT create sensor SEL
+ if ((i_data->eSel[offsetof(selRecord,sensor_type)] == SENSOR::INVALID_TYPE) &&
+ (i_data->eSel[offsetof(selRecord,sensor_number)] == TARGETING::UTIL::INVALID_IPMI_SENSOR)
+ )
{
- IPMI_TRAC(ERR_MRK "error from add_sel");
- }
- else if (l_cc != IPMI::CC_OK)
- {
- IPMI_TRAC(ERR_MRK "failed add_sel, l_cc %02x", l_cc);
+ IPMI_TRAC(INFO_MRK "Invalid sensor type/number - NOT sending sensor SELs");
}
else
{
- // if CC_OK, then len = 2 and data contains the recordID of the new SEL
- storeReserveRecord(sel_recordID,data);
+ // if the eSEL wasn't created due to a bad completion code, we will
+ // still try to send down a SEL that we create, which will contain
+ // the eSEL recordID (if it was successful)
+ if (data)
+ {
+ delete [] data;
+ }
+ len = sizeof(IPMISEL::selRecord);
+ data = new uint8_t[len];
+
+ // copy in the SEL event record data
+ memcpy(data, i_data->eSel, sizeof(IPMISEL::selRecord));
+ // copy the eSEL recordID (if it was created) into the extra data area
+ data[offsetof(selRecord,event_data2)] = esel_recordID[1];
+ data[offsetof(selRecord,event_data3)] = esel_recordID[0];
+
+ // use local cc so that we don't corrupt the esel from above
+ IPMI::completion_code l_cc = IPMI::CC_UNKBAD;
+ TRACFBIN( g_trac_ipmi, INFO_MRK"add_sel:", data, len);
+ o_err = IPMI::sendrecv(IPMI::add_sel(),l_cc,len,data);
+ if(o_err)
+ {
+ IPMI_TRAC(ERR_MRK "error from add_sel");
+ }
+ else if (l_cc != IPMI::CC_OK)
+ {
+ IPMI_TRAC(ERR_MRK "failed add_sel, l_cc %02x", l_cc);
+ }
+ else
+ {
+ // if CC_OK, then len=2 and data contains the recordID of the new SEL
+ storeReserveRecord(sel_recordID,data);
+ }
}
}
- delete[] data;
+ if (data)
+ {
+ delete [] data;
+ }
IPMI_TRAC(EXIT_MRK
"send_esel o_err=%.8X, o_cc=x%.2x, sel recID=x%x%x, esel recID=x%x%x",
OpenPOWER on IntegriCloud