summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorspashabk-in <shakeebbk@in.ibm.com>2018-06-26 03:26:34 -0500
committerSachin Gupta <sgupta2m@in.ibm.com>2018-07-03 02:30:31 -0400
commitbba0cab941443a90083d9abc0c53e4cbea948121 (patch)
tree9f3721d1bd17037c51b1bc97472942a9efd1e0b3 /src
parent022cf9ef4eee5331ce96a26dc77c6ddecdae4d3b (diff)
downloadtalos-sbe-bba0cab941443a90083d9abc0c53e4cbea948121.tar.gz
talos-sbe-bba0cab941443a90083d9abc0c53e4cbea948121.zip
Protect fapi rc between processor and async thread
Since we share a global fapi rc betweeen threads, to avoid corruption, following approach - 1. Run processor thread at higher priority than async thread 2. Once async thread is unlocked, make it non pre-emptable Change-Id: I873affbc15d99c8020c3d074e58aae1165e7ae12 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/61355 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com> (cherry picked from commit bcd84270938b75c83cc364ff2c75133638cddb6e) Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/61461
Diffstat (limited to 'src')
-rw-r--r--src/sbefw/core/sbecmdprocessor.C7
-rw-r--r--src/sbefw/core/sbemain.C4
2 files changed, 9 insertions, 2 deletions
diff --git a/src/sbefw/core/sbecmdprocessor.C b/src/sbefw/core/sbecmdprocessor.C
index c0cf0353..2d4e77b0 100644
--- a/src/sbefw/core/sbecmdprocessor.C
+++ b/src/sbefw/core/sbecmdprocessor.C
@@ -455,6 +455,11 @@ void sbeAsyncCommandProcessor_routine(void *arg)
ReturnCode rc = FAPI2_RC_SUCCESS;
Target<TARGET_TYPE_PROC_CHIP > proc = plat_getChipTarget();
+
+ // Run the procedure atomically
+ PkMachineContext ctx;
+ pk_critical_section_enter(&ctx);
+
SBE_EXEC_HWP(rc, p9_sbe_io_eol_toggle, proc)
if (rc != FAPI2_RC_SUCCESS)
{
@@ -463,6 +468,8 @@ void sbeAsyncCommandProcessor_routine(void *arg)
captureAsyncFFDC(SBE_PRI_GENERIC_EXECUTION_FAILURE,
SBE_SEC_PERIODIC_IO_TOGGLE_FAILED);
}
+
+ pk_critical_section_exit(&ctx);
} while(1);
#endif // PERIODIC_IO_TOGGLE_SUPPORTED
#undef SBE_FUNC
diff --git a/src/sbefw/core/sbemain.C b/src/sbefw/core/sbemain.C
index 327c3339..9bcc53e0 100644
--- a/src/sbefw/core/sbemain.C
+++ b/src/sbefw/core/sbemain.C
@@ -226,7 +226,7 @@ int sbeInitThreads(void)
(void *)0,
(PkAddress)sbeSyncCommandProcessor_stack,
SBE_THREAD_SYNC_CMD_PROC_STACK_SIZE,
- THREAD_PRIORITY_7);
+ THREAD_PRIORITY_6);
if (l_rc)
{
break;
@@ -238,7 +238,7 @@ int sbeInitThreads(void)
(void *)0,
(PkAddress)sbeAsyncCommandProcessor_stack,
SBE_THREAD_ASYNC_CMD_PROC_STACK_SIZE,
- THREAD_PRIORITY_6);
+ THREAD_PRIORITY_7);
if (l_rc)
{
break;
OpenPOWER on IntegriCloud