From ea434a2363ec824c5b746389c9f7a22d924c7a0a Mon Sep 17 00:00:00 2001 From: Louis Stermole Date: Thu, 2 May 2019 15:06:18 -0400 Subject: Fix Explorer getRSP for endianness and buffer size Add call to correct response data endianness Fix number of bytes read from data buffer Change-Id: I2dafb40b3a89826c1e3fede9c439b848404363a6 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/76887 Tested-by: FSP CI Jenkins Tested-by: Jenkins Server Tested-by: Hostboot CI Reviewed-by: STEPHEN GLANCY Reviewed-by: ANDRE A. MARIN Reviewed-by: Jennifer A. Stofer Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/76902 Reviewed-by: Daniel M. Crowell Tested-by: Daniel M. Crowell --- src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C b/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C index 57464bb8a..4db9ebc12 100644 --- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C +++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C @@ -533,11 +533,12 @@ fapi2::ReturnCode getRSP( if (o_rsp.response_length > 0) { // make sure expected size is a multiple of 8 - o_data.resize( o_rsp.response_length + - (8 - (o_rsp.response_length % 8)) ); + const uint32_t l_padding = ((o_rsp.response_length % 8) > 0) ? (8 - (o_rsp.response_length % 8)) : 0; + o_data.resize( o_rsp.response_length + l_padding ); FAPI_INF("Reading response data..."); FAPI_TRY( fapi2::getMMIO(i_target, EXPLR_IB_DATA_ADDR, BUFFER_TRANSACTION_SIZE, o_data) ); + FAPI_TRY( correctMMIOEndianForStruct(o_data) ); } else { -- cgit v1.2.1