Skip to content

Commit

Permalink
p9_thread_control -- remove threads_running check from sreset, start …
Browse files Browse the repository at this point in the history
…code paths

  After a write to DIRECT_CONTROLS, the targeted thread will start executing
  instructions, which may include STOP.  Future polling of the RAS_STATUS
  register is not guaranteed to satisfy the threads_running check (by the time
  RAS_STATUS is polled the thread may be idle again)

Change-Id: Ie3628149cef5089fb635256df5a25f08dbd828dc
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/47069
Reviewed-by: Kevin F. Reick <reick@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Thi N. Tran <thi@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/47077
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
  • Loading branch information
jjmcgill authored and crgeddes committed Oct 8, 2017
1 parent ba28b4b commit 9ff3876
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 113 deletions.
66 changes: 0 additions & 66 deletions src/import/chips/p9/procedures/hwp/core/p9_thread_control.C
Expand Up @@ -106,35 +106,6 @@ fapi2::ReturnCode p9_thread_control_query(
fapi2::buffer<uint64_t>& o_rasStatusReg,
uint64_t& o_state);

//--------------------------------------------------------------------------
/// @brief threads_running : static funtion to encapsulate the running state
/// @param[in] i_target core target
/// @param[in] i_threads normal core thread bitset (0b0000..0b1111)
/// @param[out] o_rasStatusReg Complete RAS status reg 64-bit buffer.
/// @param[out] o_ok true if the threads are running
/// @return FAPI2_RC_SUCCESS if the underlying hw operations succeeded
//--------------------------------------------------------------------------
static inline fapi2::ReturnCode threads_running(
const fapi2::Target<TARGET_TYPE_CORE>& i_target,
const uint8_t i_threads,
fapi2::buffer<uint64_t>& o_rasStatusReg,
bool& o_ok)
{
// Running is defined as not in maint mode and not quiesced.
uint64_t l_trys = g_poll_for_running;
uint64_t l_state = 0;

for (o_ok = false; !o_ok && l_trys > 0; l_trys--)
{
FAPI_TRY(p9_thread_control_query(i_target, i_threads, o_rasStatusReg, l_state),
"threads_running(): p9_thread_control_query() returns an error.");
o_ok = (l_state & THREAD_STATE_RUNNING);
}

fapi_try_exit:
return fapi2::current_err;
}

//--------------------------------------------------------------------------
/// @brief threads_in_maint : static funtion to encapsulate the maint state
/// @param[in] i_target core target
Expand Down Expand Up @@ -440,24 +411,6 @@ fapi2::ReturnCode p9_thread_control_sreset(
"sp_sreset for threads 0x%x", i_threads);
}

// Post-conditions check
{
bool l_running = false;
FAPI_TRY(threads_running(i_target, i_threads, o_rasStatusReg, l_running),
"p9_thread_control_sreset: unable to determine if threads "
"are running. threads: 0x%x", i_threads);
PTC_ASSERT_WARN(l_running == true,
i_warncheck,
fapi2::P9_THREAD_CONTROL_SRESET_FAIL()
.set_CORE_TARGET(i_target)
.set_THREAD(i_threads)
.set_C_RAS_STATUS_REG(o_rasStatusReg),
"p9_thread_control_sreset: ERROR: Thread SRESET issued, "
"but the threads aren't running. SReset might have "
"failed for threads 0x%x, C_RAS_STATUS reg 0x%.16llX",
i_threads, o_rasStatusReg);
}

FAPI_INF("p9_thread_control_sreset : sreset command issued for threads 0x%x",
i_threads);

Expand Down Expand Up @@ -526,25 +479,6 @@ fapi2::ReturnCode p9_thread_control_start(
"for threads 0x%x", i_threads);
}

// Post-conditions check
{
bool l_running = false;
FAPI_TRY(threads_running(i_target, i_threads, o_rasStatusReg, l_running),
"p9_thread_control_start: unable to determine if threads are "
"running. threads: 0x%x", i_threads);

PTC_ASSERT_WARN(l_running == true,
i_warncheck,
fapi2::P9_THREAD_CONTROL_START_FAIL()
.set_CORE_TARGET(i_target)
.set_THREAD(i_threads)
.set_C_RAS_STATUS_REG(o_rasStatusReg),
"p9_thread_control_start: ERROR: Thread Start issued, "
"but the threads aren't running. Start might have "
"failed for threads 0x%x, C_RAS_STATUS reg 0x%.16llX",
i_threads, o_rasStatusReg);
}

FAPI_INF("p9_thread_control_start : start command issued for threads 0x%x",
i_threads);

Expand Down
Expand Up @@ -24,30 +24,6 @@
<!-- IBM_PROLOG_END_TAG -->
<!-- @brief Error definitions for p9_thread_control procedure -->
<hwpErrors>

<!-- ********************************************************************* -->
<hwpError>
<sbeError/>
<rc>RC_P9_THREAD_CONTROL_SRESET_FAIL</rc>
<description>SReset command failed: Not all threads are running after sreset command.</description>
<ffdc>CORE_TARGET</ffdc>
<ffdc>THREAD</ffdc>
<ffdc>C_RAS_STATUS_REG</ffdc>
<callout>
<target>CORE_TARGET</target>
<priority>HIGH</priority>
</callout>
<callout>
<procedure>CODE</procedure>
<priority>LOW</priority>
</callout>
<deconfigure>
<target>CORE_TARGET</target>
</deconfigure>
<gard>
<target>CORE_TARGET</target>
</gard>
</hwpError>
<!-- ********************************************************************* -->
<hwpError>
<sbeError/>
Expand All @@ -62,29 +38,6 @@
</callout>
</hwpError>
<!-- ********************************************************************* -->
<hwpError>
<sbeError/>
<rc>RC_P9_THREAD_CONTROL_START_FAIL</rc>
<description>Start command failed: RAS STAT instruction completed bit was not set after start command.</description>
<ffdc>CORE_TARGET</ffdc>
<ffdc>THREAD</ffdc>
<ffdc>C_RAS_STATUS_REG</ffdc>
<callout>
<target>CORE_TARGET</target>
<priority>HIGH</priority>
</callout>
<callout>
<procedure>CODE</procedure>
<priority>LOW</priority>
</callout>
<deconfigure>
<target>CORE_TARGET</target>
</deconfigure>
<gard>
<target>CORE_TARGET</target>
</gard>
</hwpError>
<!-- ********************************************************************* -->
<hwpError>
<sbeError/>
<rc>RC_P9_THREAD_CONTROL_STOP_FAIL</rc>
Expand Down

0 comments on commit 9ff3876

Please sign in to comment.