Skip to content

Commit

Permalink
Fix MC_TYPE used in restore_dram_repairs common code
Browse files Browse the repository at this point in the history
The lowest level code in this library hadn't gotten the
MC_TYPE template passed down, causing calls to place_symbol_mark
and place_chip_mark to look for parent targets of incorrect type.
This resulted in errors like the following in firmware:
Assertion [ l_parentList.size() == 1 ] failed; Found 0 parents of
the same...

CQ:SW491725
Change-Id: I78e7ab4390fdd526fb34e777a482502c22fa7829
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/96691
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M Crowell <dcrowell@us.ibm.com>
  • Loading branch information
stermole authored and dcrowell77 committed May 11, 2020
1 parent db5cabf commit c7738e1
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 346 deletions.
293 changes: 0 additions & 293 deletions src/import/chips/p9/procedures/hwp/memory/lib/mc/port.C
Expand Up @@ -322,297 +322,4 @@ fapi2::ReturnCode ecc_reg_settings_draminit_mc<mss::mc_type::NIMBUS>(
return fapi2::FAPI2_RC_SUCCESS;
}

///
/// @brief Perform a repair for a single bad DQ bit in a nibble
/// Specialization for TARGET_TYPE_DIMM
/// @param[in,out] io_machine the repair state machine
/// @param[in] i_target the DIMM target
/// @param[in] i_rank the rank
/// @param[in] i_dq the DQ bit index
/// @param[in,out] io_repairs_applied 8-bit mask, where a bit set means that rank had repairs applied
/// @param[in,out] io_repairs_exceeded 2-bit mask, where a bit set means that DIMM had more bad bits than could be repaired
/// @return FAPI2_RC_SUCCESS if and only if ok
///
template<>
fapi2::ReturnCode no_fails<fapi2::TARGET_TYPE_DIMM>::one_bad_dq(repair_state_machine<fapi2::TARGET_TYPE_DIMM>&
io_machine,
const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const uint64_t i_rank,
const uint64_t i_dq,
fapi2::buffer<uint8_t>& io_repairs_applied,
fapi2::buffer<uint8_t>& io_repairs_exceeded)
{
// place a symbol mark
FAPI_TRY( place_symbol_mark(i_target, i_rank, i_dq) );
io_repairs_applied.setBit(i_rank);
{
const auto new_state = std::make_shared<symbol_mark_only<fapi2::TARGET_TYPE_DIMM>>();
set_state(io_machine, new_state);
}
fapi_try_exit:
return fapi2::current_err;
}

///
/// @brief Perform a repair for multiple bad DQ bits in a nibble
/// Specialization for TARGET_TYPE_DIMM
/// @param[in,out] io_machine the repair state machine
/// @param[in] i_target the DIMM target
/// @param[in] i_rank the rank
/// @param[in] i_dq one of the bad DQ bit indexes
/// @param[in,out] io_repairs_applied 8-bit mask, where a bit set means that rank had repairs applied
/// @param[in,out] io_repairs_exceeded 2-bit mask, where a bit set means that DIMM had more bad bits than could be repaired
/// @return FAPI2_RC_SUCCESS if and only if ok
///
template<>
fapi2::ReturnCode no_fails<fapi2::TARGET_TYPE_DIMM>::multiple_bad_dq(repair_state_machine<fapi2::TARGET_TYPE_DIMM>&
io_machine,
const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const uint64_t i_rank,
const uint64_t i_dq,
fapi2::buffer<uint8_t>& io_repairs_applied,
fapi2::buffer<uint8_t>& io_repairs_exceeded)
{
// place a chip mark
FAPI_TRY( place_chip_mark(i_target, i_rank, i_dq) );
io_repairs_applied.setBit(i_rank);
{
const auto new_state = std::make_shared<chip_mark_only<fapi2::TARGET_TYPE_DIMM>>();
set_state(io_machine, new_state);
}
fapi_try_exit:
return fapi2::current_err;
}

///
/// @brief Perform a repair for a single bad DQ bit in a nibble
/// Specialization for TARGET_TYPE_DIMM
/// @param[in,out] io_machine the repair state machine
/// @param[in] i_target the DIMM target
/// @param[in] i_rank the rank
/// @param[in] i_dq the DQ bit index
/// @param[in,out] io_repairs_applied 8-bit mask, where a bit set means that rank had repairs applied
/// @param[in,out] io_repairs_exceeded 2-bit mask, where a bit set means that DIMM had more bad bits than could be repaired
/// @return FAPI2_RC_SUCCESS if and only if ok
///
template<>
fapi2::ReturnCode symbol_mark_only<fapi2::TARGET_TYPE_DIMM>::one_bad_dq(repair_state_machine<fapi2::TARGET_TYPE_DIMM>&
io_machine,
const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const uint64_t i_rank,
const uint64_t i_dq,
fapi2::buffer<uint8_t>& io_repairs_applied,
fapi2::buffer<uint8_t>& io_repairs_exceeded)
{
// leave an unrepaired DQ
const auto new_state = std::make_shared<symbol_mark_plus_unrepaired_dq<fapi2::TARGET_TYPE_DIMM>>();
set_state(io_machine, new_state);
return fapi2::FAPI2_RC_SUCCESS;
}

///
/// @brief Perform a repair for multiple bad DQ bits in a nibble
/// Specialization for TARGET_TYPE_DIMM
/// @param[in,out] io_machine the repair state machine
/// @param[in] i_target the DIMM target
/// @param[in] i_rank the rank
/// @param[in] i_dq one of the bad DQ bit indexes
/// @param[in,out] io_repairs_applied 8-bit mask, where a bit set means that rank had repairs applied
/// @param[in,out] io_repairs_exceeded 2-bit mask, where a bit set means that DIMM had more bad bits than could be repaired
/// @return FAPI2_RC_SUCCESS if and only if ok
///
template<>
fapi2::ReturnCode symbol_mark_only<fapi2::TARGET_TYPE_DIMM>::multiple_bad_dq(
repair_state_machine<fapi2::TARGET_TYPE_DIMM>& io_machine,
const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const uint64_t i_rank,
const uint64_t i_dq,
fapi2::buffer<uint8_t>& io_repairs_applied,
fapi2::buffer<uint8_t>& io_repairs_exceeded)
{
// place a chip mark
FAPI_TRY( place_chip_mark(i_target, i_rank, i_dq) );
io_repairs_applied.setBit(i_rank);
{
const auto new_state = std::make_shared<chip_and_symbol_mark<fapi2::TARGET_TYPE_DIMM>>();
set_state(io_machine, new_state);
}
fapi_try_exit:
return fapi2::current_err;
}

///
/// @brief Perform a repair for a single bad DQ bit in a nibble
/// Specialization for TARGET_TYPE_DIMM
/// @param[in,out] io_machine the repair state machine
/// @param[in] i_target the DIMM target
/// @param[in] i_rank the rank
/// @param[in] i_dq the DQ bit index
/// @param[in,out] io_repairs_applied 8-bit mask, where a bit set means that rank had repairs applied
/// @param[in,out] io_repairs_exceeded 2-bit mask, where a bit set means that DIMM had more bad bits than could be repaired
/// @return FAPI2_RC_SUCCESS if and only if ok
///
template<>
fapi2::ReturnCode symbol_mark_plus_unrepaired_dq<fapi2::TARGET_TYPE_DIMM>::one_bad_dq(
repair_state_machine<fapi2::TARGET_TYPE_DIMM>& io_machine,
const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const uint64_t i_rank,
const uint64_t i_dq,
fapi2::buffer<uint8_t>& io_repairs_applied,
fapi2::buffer<uint8_t>& io_repairs_exceeded)
{
// repairs exceeded
FAPI_INF("%s Repairs exceeded (symbol mark and unrepaired DQ exist, plus bad DQ) on rank:%d DQ:%d",
mss::c_str(i_target), i_rank, i_dq);
io_repairs_exceeded.setBit(mss::index(i_target));
return fapi2::FAPI2_RC_SUCCESS;
}

///
/// @brief Perform a repair for multiple bad DQ bits in a nibble
/// Specialization for TARGET_TYPE_DIMM
/// @param[in,out] io_machine the repair state machine
/// @param[in] i_target the DIMM target
/// @param[in] i_rank the rank
/// @param[in] i_dq one of the bad DQ bit indexes
/// @param[in,out] io_repairs_applied 8-bit mask, where a bit set means that rank had repairs applied
/// @param[in,out] io_repairs_exceeded 2-bit mask, where a bit set means that DIMM had more bad bits than could be repaired
/// @return FAPI2_RC_SUCCESS if and only if ok
///
template<>
fapi2::ReturnCode symbol_mark_plus_unrepaired_dq<fapi2::TARGET_TYPE_DIMM>::multiple_bad_dq(
repair_state_machine<fapi2::TARGET_TYPE_DIMM>& io_machine,
const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const uint64_t i_rank,
const uint64_t i_dq,
fapi2::buffer<uint8_t>& io_repairs_applied,
fapi2::buffer<uint8_t>& io_repairs_exceeded)
{
// place a chip mark, but also repairs exceeded
FAPI_TRY( place_chip_mark(i_target, i_rank, i_dq) );
io_repairs_applied.setBit(i_rank);
io_repairs_exceeded.setBit(mss::index(i_target));
FAPI_INF("%s Repairs exceeded (symbol mark and unrepaired DQ exist, plus bad nibble) on rank:%d DQ:%d",
mss::c_str(i_target), i_rank, i_dq);
{
const auto new_state = std::make_shared<chip_and_symbol_mark<fapi2::TARGET_TYPE_DIMM>>();
set_state(io_machine, new_state);
}
fapi_try_exit:
return fapi2::current_err;
}

///
/// @brief Perform a repair for a single bad DQ bit in a nibble
/// Specialization for TARGET_TYPE_DIMM
/// @param[in,out] io_machine the repair state machine
/// @param[in] i_target the DIMM target
/// @param[in] i_rank the rank
/// @param[in] i_dq the DQ bit index
/// @param[in,out] io_repairs_applied 8-bit mask, where a bit set means that rank had repairs applied
/// @param[in,out] io_repairs_exceeded 2-bit mask, where a bit set means that DIMM had more bad bits than could be repaired
/// @return FAPI2_RC_SUCCESS if and only if ok
///
template<>
fapi2::ReturnCode chip_mark_only<fapi2::TARGET_TYPE_DIMM>::one_bad_dq(
repair_state_machine<fapi2::TARGET_TYPE_DIMM>&
io_machine,
const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const uint64_t i_rank,
const uint64_t i_dq,
fapi2::buffer<uint8_t>& io_repairs_applied,
fapi2::buffer<uint8_t>& io_repairs_exceeded)
{
// place a symbol mark
FAPI_TRY( place_symbol_mark(i_target, i_rank, i_dq) );
io_repairs_applied.setBit(i_rank);
{
const auto new_state = std::make_shared<chip_and_symbol_mark<fapi2::TARGET_TYPE_DIMM>>();
set_state(io_machine, new_state);
}
fapi_try_exit:
return fapi2::current_err;
}

///
/// @brief Perform a repair for multiple bad DQ bits in a nibble
/// Specialization for TARGET_TYPE_DIMM
/// @param[in,out] io_machine the repair state machine
/// @param[in] i_target the DIMM target
/// @param[in] i_rank the rank
/// @param[in] i_dq one of the bad DQ bit indexes
/// @param[in,out] io_repairs_applied 8-bit mask, where a bit set means that rank had repairs applied
/// @param[in,out] io_repairs_exceeded 2-bit mask, where a bit set means that DIMM had more bad bits than could be repaired
/// @return FAPI2_RC_SUCCESS if and only if ok
///
template<>
fapi2::ReturnCode chip_mark_only<fapi2::TARGET_TYPE_DIMM>::multiple_bad_dq(
repair_state_machine<fapi2::TARGET_TYPE_DIMM>& io_machine,
const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const uint64_t i_rank,
const uint64_t i_dq,
fapi2::buffer<uint8_t>& io_repairs_applied,
fapi2::buffer<uint8_t>& io_repairs_exceeded)
{
// repairs exceeded
io_repairs_exceeded.setBit(mss::index(i_target));
FAPI_INF("%s Repairs exceeded (chip mark exists, plus bad nibble) on rank:%d DQ:%d",
mss::c_str(i_target), i_rank, i_dq);
return fapi2::FAPI2_RC_SUCCESS;
}

///
/// @brief Perform a repair for a single bad DQ bit in a nibble
/// Specialization for TARGET_TYPE_DIMM
/// @param[in,out] io_machine the repair state machine
/// @param[in] i_target the DIMM target
/// @param[in] i_rank the rank
/// @param[in] i_dq the DQ bit index
/// @param[in,out] io_repairs_applied 8-bit mask, where a bit set means that rank had repairs applied
/// @param[in,out] io_repairs_exceeded 2-bit mask, where a bit set means that DIMM had more bad bits than could be repaired
/// @return FAPI2_RC_SUCCESS if and only if ok
///
template<>
fapi2::ReturnCode chip_and_symbol_mark<fapi2::TARGET_TYPE_DIMM>::one_bad_dq(
repair_state_machine<fapi2::TARGET_TYPE_DIMM>& io_machine,
const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const uint64_t i_rank,
const uint64_t i_dq,
fapi2::buffer<uint8_t>& io_repairs_applied,
fapi2::buffer<uint8_t>& io_repairs_exceeded)
{
// repairs exceeded
io_repairs_exceeded.setBit(mss::index(i_target));
FAPI_INF("%s Repairs exceeded (chip mark and symbol mark exist, plus one bad DQ) on rank:%d DQ:%d",
mss::c_str(i_target), i_rank, i_dq);
return fapi2::FAPI2_RC_SUCCESS;
}

///
/// @brief Perform a repair for multiple bad DQ bits in a nibble
/// Specialization for TARGET_TYPE_DIMM
/// @param[in,out] io_machine the repair state machine
/// @param[in] i_target the DIMM target
/// @param[in] i_rank the rank
/// @param[in] i_dq one of the bad DQ bit indexes
/// @param[in,out] io_repairs_applied 8-bit mask, where a bit set means that rank had repairs applied
/// @param[in,out] io_repairs_exceeded 2-bit mask, where a bit set means that DIMM had more bad bits than could be repaired
/// @return FAPI2_RC_SUCCESS if and only if ok
///
template<>
fapi2::ReturnCode chip_and_symbol_mark<fapi2::TARGET_TYPE_DIMM>::multiple_bad_dq(
repair_state_machine<fapi2::TARGET_TYPE_DIMM>& io_machine,
const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
const uint64_t i_rank,
const uint64_t i_dq,
fapi2::buffer<uint8_t>& io_repairs_applied,
fapi2::buffer<uint8_t>& io_repairs_exceeded)
{
// repairs exceeded
io_repairs_exceeded.setBit(mss::index(i_target));
FAPI_INF("%s Repairs exceeded (chip mark and symbol mark exist, plus one bad nibble) on rank:%d DQ:%d",
mss::c_str(i_target), i_rank, i_dq);
return fapi2::FAPI2_RC_SUCCESS;
}

} // ns mss
4 changes: 2 additions & 2 deletions src/import/chips/p9/procedures/hwp/memory/p9_mss_memdiag.C
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* Contributors Listed Below - COPYRIGHT 2015,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -122,7 +122,7 @@ extern "C"
fapi2::buffer<uint8_t> l_repairs_exceeded;
std::vector<uint64_t> l_ranks;

FAPI_TRY( mss::restore_repairs( l_mca, l_repairs_applied, l_repairs_exceeded) );
FAPI_TRY( mss::restore_repairs<mss::mc_type::NIMBUS>( l_mca, l_repairs_applied, l_repairs_exceeded) );

// assert if we have exceeded the allowed repairs
for (const auto& l_dimm : mss::find_targets<fapi2::TARGET_TYPE_DIMM>(l_mca))
Expand Down

0 comments on commit c7738e1

Please sign in to comment.