diff options
| author | Leo Chang <schang@qca.qualcomm.com> | 2015-10-19 21:52:05 -0700 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2015-10-20 17:01:55 +0530 |
| commit | a3347b7e7aa676e4c8f7cbf1c4930dbfeb6acad4 (patch) | |
| tree | 9db22eff37712fcbc4424f49e89c335db4571580 | |
| parent | 00bdab1c2be2ea8efd5582d566c940fa170365ec (diff) | |
qcacld-2.0: replace semaphore to completion
HTC RX event wait semaphore waiting event infinte.
Infinte waiting will hang device and cannot getting out from
system hang. To collect FW RAM dump and make correct panic,
semaphore should be replaced with time limitted compeletion
Change-Id: Idabfc7916676c9e986e953b50108653a5b394278
CRs-fixed: 924387
| -rw-r--r-- | CORE/SERVICES/COMMON/debug_linux.h | 7 | ||||
| -rw-r--r-- | CORE/SERVICES/HTC/htc_internal.h | 2 | ||||
| -rw-r--r-- | CORE/SERVICES/HTC/htc_recv.c | 15 |
3 files changed, 18 insertions, 6 deletions
diff --git a/CORE/SERVICES/COMMON/debug_linux.h b/CORE/SERVICES/COMMON/debug_linux.h index 3636ad350411..cc371f96984b 100644 --- a/CORE/SERVICES/COMMON/debug_linux.h +++ b/CORE/SERVICES/COMMON/debug_linux.h @@ -51,5 +51,12 @@ /* compile specific macro to get the function name string */ #define _A_FUNCNAME_ __func__ +#define ADF_BUG(_condition) do { \ + if (!(_condition)) { \ + printk(KERN_CRIT "ADF BUG in %s Line %d\n", \ + __func__, __LINE__); \ + BUG_ON(1); \ + } \ +} while(0) #endif /* _DEBUG_LINUX_H_ */ diff --git a/CORE/SERVICES/HTC/htc_internal.h b/CORE/SERVICES/HTC/htc_internal.h index 7ac205193d1a..9f1ea6cf3acf 100644 --- a/CORE/SERVICES/HTC/htc_internal.h +++ b/CORE/SERVICES/HTC/htc_internal.h @@ -183,7 +183,7 @@ typedef struct _HTC_TARGET { HTC_PACKET_QUEUE ControlBufferTXFreeList; A_UINT8 CtrlResponseBuffer[HTC_MAX_CONTROL_MESSAGE_LENGTH]; int CtrlResponseLength; - adf_os_mutex_t CtrlResponseValid; + adf_os_comp_t CtrlResponseValid; A_BOOL CtrlResponseProcessing; int TotalTransmitCredits; HTC_SERVICE_TX_CREDIT_ALLOCATION ServiceTxAllocTable[HTC_MAX_SERVICE_ALLOC_ENTRIES]; diff --git a/CORE/SERVICES/HTC/htc_recv.c b/CORE/SERVICES/HTC/htc_recv.c index 63f98257940b..0a2ca5c8758e 100644 --- a/CORE/SERVICES/HTC/htc_recv.c +++ b/CORE/SERVICES/HTC/htc_recv.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -32,6 +32,9 @@ #include <vos_getBin.h> #include "epping_main.h" +/* HTC Control message receive timeout msec */ +#define HTC_CONTROL_RX_TIMEOUT 3000 + #ifdef DEBUG void DebugDumpBytes(A_UCHAR *buffer, A_UINT16 length, char *pDescription) { @@ -411,7 +414,7 @@ A_STATUS HTCRxCompletionHandler( target->CtrlResponseProcessing = TRUE; UNLOCK_HTC_RX(target); - adf_os_mutex_release(target->osdev, &target->CtrlResponseValid); + adf_os_complete(&target->CtrlResponseValid); break; case HTC_MSG_SEND_SUSPEND_COMPLETE: wow_nack = 0; @@ -564,8 +567,7 @@ void HTCFlushRxHoldQueue(HTC_TARGET *target, HTC_ENDPOINT *pEndpoint) void HTCRecvInit(HTC_TARGET *target) { /* Initialize CtrlResponseValid to block */ - adf_os_init_mutex(&target->CtrlResponseValid); - adf_os_mutex_acquire(target->osdev, &target->CtrlResponseValid); + adf_os_init_completion(&target->CtrlResponseValid); } @@ -577,7 +579,10 @@ A_STATUS HTCWaitRecvCtrlMessage(HTC_TARGET *target) AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("+HTCWaitCtrlMessageRecv\n")); /* Wait for BMI request/response transaction to complete */ - while (adf_os_mutex_acquire(target->osdev, &target->CtrlResponseValid)) { + if(!adf_os_wait_for_completion_timeout(&target->CtrlResponseValid, + adf_os_msecs_to_ticks(HTC_CONTROL_RX_TIMEOUT))) { + ADF_BUG(0); + return A_ERROR; } AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("-HTCWaitCtrlMessageRecv success\n")); |
