wlan: Protect processing of sending FATAL event
Hold ssr_protect_entry_count while processing of sending FATAL event
request to FW, so that there will be no invalid data access during SSR.
Change-Id: I3c888f2d528d7f8160b4e66b08051013231eff13
CRs-Fixed: 936164
diff --git a/CORE/VOSS/src/vos_api.c b/CORE/VOSS/src/vos_api.c
index a74fdee..b7d4fae 100644
--- a/CORE/VOSS/src/vos_api.c
+++ b/CORE/VOSS/src/vos_api.c
@@ -1765,11 +1765,9 @@
return pHddCtx->cfg_ini->enableFatalEvent;
}
-
-
/**---------------------------------------------------------------------------
- \brief vos_fatal_event_logs_req() - used to send flush command to FW
+ \brief __vos_fatal_event_logs_req() - used to send flush command to FW
This API is wrapper to SME flush API.
@@ -1780,7 +1778,7 @@
\return VOS_STATUS_SUCCESS - if command is sent successfully.
VOS_STATUS_E_FAILURE - if command is not sent successfully.
--------------------------------------------------------------------------*/
-VOS_STATUS vos_fatal_event_logs_req( uint32_t is_fatal,
+VOS_STATUS __vos_fatal_event_logs_req( uint32_t is_fatal,
uint32_t indicator,
uint32_t reason_code,
bool wait_required,
@@ -1838,7 +1836,13 @@
"%s: Triggering fatal Event: type:%d, indicator=%d reason_code=%d",
__func__, is_fatal, indicator, reason_code);
- vos_event_reset(&gpVosContext->fwLogsComplete);
+ status = vos_event_reset(&gpVosContext->fwLogsComplete);
+ if(!HAL_STATUS_SUCCESS(status))
+ {
+ VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
+ FL("fwLogsComplete reset failed:%d"),status);
+ return VOS_STATUS_E_FAILURE;
+ }
status = sme_fatal_event_logs_req(vos_context->pMACContext,
is_fatal, indicator,
reason_code, dump_vos_trace);
@@ -1872,6 +1876,22 @@
return VOS_STATUS_E_FAILURE;
}
+VOS_STATUS vos_fatal_event_logs_req( uint32_t is_fatal,
+ uint32_t indicator,
+ uint32_t reason_code,
+ bool wait_required,
+ bool dump_vos_trace)
+{
+ VOS_STATUS status;
+
+ vos_ssr_protect(__func__);
+ status = __vos_fatal_event_logs_req(is_fatal, indicator, reason_code,
+ wait_required, dump_vos_trace);
+ vos_ssr_unprotect(__func__);
+
+ return status;
+}
+
/**---------------------------------------------------------------------------
\brief vos_process_done_indication() - Process the done indication for fatal event,