From 6d40ee06511e8a3fb024c81cbf184ed775707dec Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Date: Thu, 20 Nov 2014 16:54:05 -0800 Subject: qcacld-new: Debug change to catch MC thread stuck issue Add debug change to call panic after detecting MC thread is stuck. Change-Id: Iea7c53138ed783eda7f90c732f667dab505a7ee0 CRs-fixed: 760528 --- CORE/VOSS/src/vos_api.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/CORE/VOSS/src/vos_api.c b/CORE/VOSS/src/vos_api.c index 224e2db0700c..03a80faec410 100644 --- a/CORE/VOSS/src/vos_api.c +++ b/CORE/VOSS/src/vos_api.c @@ -99,6 +99,9 @@ /* Approximate amount of time to wait for WDA to issue a DUMP req */ #define VOS_WDA_RESP_TIMEOUT WDA_STOP_TIMEOUT +/* Maximum number of vos message queue get wrapper failures to cause panic */ +#define VOS_WRAPPER_MAX_FAIL_COUNT (1000) + /*--------------------------------------------------------------------------- * Data definitions * ------------------------------------------------------------------------*/ @@ -1591,6 +1594,7 @@ VOS_STATUS vos_mq_post_message( VOS_MQ_ID msgQueueId, vos_msg_t *pMsg ) { pVosMqType pTargetMq = NULL; pVosMsgWrapper pMsgWrapper = NULL; + static uint32_t debug_count = 0; if ((gpVosContext == NULL) || (pMsg == NULL)) { @@ -1659,14 +1663,21 @@ VOS_STATUS vos_mq_post_message( VOS_MQ_ID msgQueueId, vos_msg_t *pMsg ) */ pMsgWrapper = vos_mq_get(&gpVosContext->freeVosMq); - if (NULL == pMsgWrapper) - { - VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - "%s: VOS Core run out of message wrapper", __func__); + if (NULL == pMsgWrapper) { + debug_count++; + VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, + "%s: VOS Core run out of message wrapper %d", + __func__, debug_count); + + if (VOS_WRAPPER_MAX_FAIL_COUNT == debug_count) { + VOS_BUG(0); + } return VOS_STATUS_E_RESOURCES; } + debug_count = 0; + /* ** Copy the message now */ -- cgit v1.2.3