wlan: SW workaround to mitigate HW statbility
HW bug to handle small frame within WQ.
BMU Release FIFO Overrun in HW causing data abort.
As a SW workaroud, delay 1usec for each RX frame pulling.
Change-Id: I6dc075dd52d9342a9cce2521c0970b6e783457a1
CRs-fixed: 502453
diff --git a/CORE/DXE/src/wlan_qct_dxe.c b/CORE/DXE/src/wlan_qct_dxe.c
index 49b54b9..9118367 100644
--- a/CORE/DXE/src/wlan_qct_dxe.c
+++ b/CORE/DXE/src/wlan_qct_dxe.c
@@ -1,44 +1,8 @@
/*
- * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
- *
- * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
- *
- *
- * Permission to use, copy, modify, and/or distribute this software for
- * any purpose with or without fee is hereby granted, provided that the
- * above copyright notice and this permission notice appear in all
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-/*
- * Copyright (c) 2012, The Linux Foundation. All rights reserved.
- *
- * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
- *
- *
- * Permission to use, copy, modify, and/or distribute this software for
- * any purpose with or without fee is hereby granted, provided that the
- * above copyright notice and this permission notice appear in all
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
+* Copyright (c) 2012 Qualcomm Atheros, Inc.
+* All Rights Reserved.
+* Qualcomm Atheros Confidential and Proprietary.
+*/
/**=========================================================================
@@ -2002,6 +1966,14 @@
while(channelEntry->numFreeDesc > 0)
{
+ /* If RX thread drain small size of frame from HW too fast
+ * Sometimes HW cannot handle interrupt fast enough
+ * And system crash might happen
+ * To avoid system crash, input 1usec delay each frame draining
+ * within host side, This is SW work around, to fix HW problem
+ * Throughput and SnS test done successfully */
+ wpalUsecSleep(1);
+
/* Current Control block is free
* and associated frame buffer is not linked with control block anymore
* allocate new frame buffer for current control block */
@@ -2217,7 +2189,7 @@
* Do not try reload driver at here*/
if(!(chStat & WLANDXE_CH_CTRL_EN_MASK))
{
- HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN,
+ HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR,
"dxeRXFrameReady %s RING Wrapped, RX Free Low 0x%x",
channelType[channelEntry->channelType], chStat);
channelEntry->numFragmentCurrentChain = 0;
@@ -2251,11 +2223,11 @@
{
if(!(WLANDXE_U32_SWAP_ENDIAN(descCtrl) & WLANDXE_DESC_CTRL_VALID))
{
- HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN,
+ HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR,
"Found Invalidated Descriptor %d", (int)descLoop);
if(eWLAN_PAL_STATUS_SUCCESS == wpalIsPacketLocked(currentCtrlBlk->xfrFrame))
{
- HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN,
+ HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR,
"Packet locked, Resync Host and HW");
channelEntry->headCtrlBlk = currentCtrlBlk;
invalidatedFound = 1;
@@ -2263,7 +2235,7 @@
}
else
{
- HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_WARN,
+ HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR,
"Packet Not Locked, cannot transfer frame");
}
}
diff --git a/CORE/WDI/WPAL/inc/wlan_qct_pal_timer.h b/CORE/WDI/WPAL/inc/wlan_qct_pal_timer.h
index 0e31407..0e2da7f 100644
--- a/CORE/WDI/WPAL/inc/wlan_qct_pal_timer.h
+++ b/CORE/WDI/WPAL/inc/wlan_qct_pal_timer.h
@@ -139,6 +139,13 @@
---------------------------------------------------------------------------*/
wpt_status wpalSleep(wpt_uint32 timeout);
-
+/*---------------------------------------------------------------------------
+ wpalUsecSleep - sleep for a specified Micro Sec interval
+ Param:
+ timeout - amount of time to sleep. In unit of micro-seconds.
+ Return:
+ eWLAN_PAL_STATUS_SUCCESS - success. Fail otherwise.
+---------------------------------------------------------------------------*/
+wpt_status wpalUsecSleep(wpt_uint32 timeout);
#endif // __WLAN_QCT_PAL_TIMER_H
diff --git a/CORE/WDI/WPAL/src/wlan_qct_pal_timer.c b/CORE/WDI/WPAL/src/wlan_qct_pal_timer.c
index bd5decf..1c80fe8 100644
--- a/CORE/WDI/WPAL/src/wlan_qct_pal_timer.c
+++ b/CORE/WDI/WPAL/src/wlan_qct_pal_timer.c
@@ -60,6 +60,8 @@
#include "wlan_qct_os_status.h"
#include "vos_threads.h"
+#include <linux/delay.h>
+
/*---------------------------------------------------------------------------
\brief wpalTimerCback - VOS timer callback function
@@ -229,3 +231,16 @@
vos_sleep( timeout );
return eWLAN_PAL_STATUS_SUCCESS;
}
+
+/*---------------------------------------------------------------------------
+ wpalUsecSleep - sleep for a specified Micro Sec interval
+ Param:
+ timeout - amount of time to sleep. In unit of micro-seconds.
+ Return:
+ eWLAN_PAL_STATUS_SUCCESS - success. Fail otherwise.
+---------------------------------------------------------------------------*/
+wpt_status wpalUsecSleep(wpt_uint32 timeout)
+{
+ usleep( timeout );
+ return eWLAN_PAL_STATUS_SUCCESS;
+}