kernel-module-qualcomm: fix issue with _scan_callback at module unload

Protect the invocation of the _scan_done() callback function with the
global lock to avoid that it is called while the module is being unloaded
and the data structures have been freed.

Additionally, the commit also adds a patch to reduce the log level of the
driver that is logging some annoying messages.

https://jira.digi.com/browse/DEL-3607
https://jira.digi.com/browse/DEL-3393

Signed-off-by: Pedro Perez de Heredia <pedro.perez@digi.com>
This commit is contained in:
Pedro Perez de Heredia 2017-02-13 10:57:07 +01:00
parent 8d716dd0e0
commit e7f590350c
3 changed files with 157 additions and 0 deletions

View File

@ -34,6 +34,8 @@ SRC_URI = " \
file://0018-qcacld-Indicate-disconnect-event-to-upper-layers.patch \ file://0018-qcacld-Indicate-disconnect-event-to-upper-layers.patch \
file://0019-wdd_hdd_main-Print-con_mode-to-clearly-see-if-in-FTM.patch \ file://0019-wdd_hdd_main-Print-con_mode-to-clearly-see-if-in-FTM.patch \
file://0020-Makefile-Pass-BUILD_DEBUG_VERSION-to-kbuild-system.patch \ file://0020-Makefile-Pass-BUILD_DEBUG_VERSION-to-kbuild-system.patch \
file://0021-cosmetic-change-log-level.patch \
file://0022-fix-issue-with-_scan_callback.patch \
" "
S = "${WORKDIR}/${PV}" S = "${WORKDIR}/${PV}"

View File

@ -0,0 +1,53 @@
From: Pedro Perez de Heredia <pedro.perez@digi.com>
Date: Mon, 13 Feb 2017 09:43:50 +0100
Subject: [PATCH] kernel-module-qualcomm: cosmetic change log level for anoying
driver messages
Signed-off-by: Pedro Perez de Heredia <pedro.perez@digi.com>
---
CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c | 4 ++--
CORE/SVC/src/logging/wlan_logging_sock_svc.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c b/CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c
index 1a1e51e..ee2af05 100644
--- a/CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c
+++ b/CORE/SERVICES/HIF/sdio/linux/native_sdio/src/hif.c
@@ -1202,7 +1202,7 @@ TODO: MMC SDIO3.0 Setting should also be modified in ReInit() function when Powe
clock = device->host->f_max;
}
- printk(KERN_ERR "%s: Dumping clocks (%d,%d)\n", __func__, func->card->cis.max_dtr, device->host->f_max);
+ pr_info("%s: Dumping clocks (%d,%d)\n", __func__, func->card->cis.max_dtr, device->host->f_max);
/*
// We don't need to set the clock explicitly on 8064/ADP platforms.
@@ -1513,7 +1513,7 @@ static A_STATUS hifEnableFunc(HIF_DEVICE *device, struct sdio_func *func)
sdio_release_host(func);
return A_ERROR;
}
- printk(KERN_ERR"AR6000: Set async interrupt delay clock as %d.\n", asyncintdelay);
+ pr_info("AR6000: Set async interrupt delay clock as %d.\n", asyncintdelay);
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
diff --git a/CORE/SVC/src/logging/wlan_logging_sock_svc.c b/CORE/SVC/src/logging/wlan_logging_sock_svc.c
index 0253215..379d878 100644
--- a/CORE/SVC/src/logging/wlan_logging_sock_svc.c
+++ b/CORE/SVC/src/logging/wlan_logging_sock_svc.c
@@ -431,13 +431,13 @@ static int wlan_logging_thread(void *Arg)
|| gwlan_logging.exit));
if (ret_wait_status == -ERESTARTSYS) {
- pr_err("%s: wait_event_interruptible returned -ERESTARTSYS",
+ pr_info("%s: wait_event_interruptible returned -ERESTARTSYS",
__func__);
break;
}
if (gwlan_logging.exit) {
- pr_err("%s: Exiting the thread\n", __func__);
+ pr_info("%s: Exiting the thread\n", __func__);
break;
}

View File

@ -0,0 +1,102 @@
From: Pedro Perez de Heredia <pedro.perez@digi.com>
Date: Mon, 13 Feb 2017 10:28:35 +0100
Subject: [PATCH] kernel-module-qualcomm: fix issue with _scan_callback at
module unload
Protect the invocation of the _scan_done() callback function with the
global lock to avoid that it is called while the module is being unloaded
and the data structures have been freed.
https://jira.digi.com/browse/DEL-3607
https://jira.digi.com/browse/DEL-3393
Signed-off-by: Pedro Perez de Heredia <pedro.perez@digi.com>
---
CORE/SME/src/csr/csrApiScan.c | 43 +++++++++++++++++++++++++++++--------------
1 file changed, 29 insertions(+), 14 deletions(-)
diff --git a/CORE/SME/src/csr/csrApiScan.c b/CORE/SME/src/csr/csrApiScan.c
index 83a74cb..2f90cce 100644
--- a/CORE/SME/src/csr/csrApiScan.c
+++ b/CORE/SME/src/csr/csrApiScan.c
@@ -6420,13 +6420,20 @@ eHalStatus csrScanFreeRequest(tpAniSirGlobal pMac, tCsrScanRequest *pReq)
void csrScanCallCallback(tpAniSirGlobal pMac, tSmeCmd *pCommand, eCsrScanStatus scanStatus)
{
- if(pCommand->u.scanCmd.callback)
+ eHalStatus status;
+
+ status = sme_AcquireGlobalLock( &pMac->sme );
+ if ( HAL_STATUS_SUCCESS( status ) )
{
- pCommand->u.scanCmd.callback(pMac, pCommand->u.scanCmd.pContext,
- pCommand->sessionId,
- pCommand->u.scanCmd.scanID, scanStatus);
- } else {
- smsLog( pMac, LOG2, "%s:%d - Callback NULL!!!", __func__, __LINE__);
+ if(pCommand->u.scanCmd.callback)
+ {
+ pCommand->u.scanCmd.callback(pMac, pCommand->u.scanCmd.pContext,
+ pCommand->sessionId,
+ pCommand->u.scanCmd.scanID, scanStatus);
+ } else {
+ smsLog( pMac, LOG2, "%s:%d - Callback NULL!!!", __func__, __LINE__);
+ }
+ sme_ReleaseGlobalLock( &pMac->sme );
}
}
@@ -7126,6 +7133,7 @@ tANI_BOOLEAN csrScanRemoveFreshScanCommand(tpAniSirGlobal pMac, tANI_U8 sessionI
tSmeCmd *pCommand;
tDblLinkList localList;
tDblLinkList *pCmdList;
+ eHalStatus status;
vos_mem_zero(&localList, sizeof(tDblLinkList));
if(!HAL_STATUS_SUCCESS(csrLLOpen(pMac->hHdd, &localList)))
@@ -7178,15 +7186,21 @@ tANI_BOOLEAN csrScanRemoveFreshScanCommand(tpAniSirGlobal pMac, tANI_U8 sessionI
while( (pEntry = csrLLRemoveHead(&localList, LL_ACCESS_NOLOCK)) )
{
pCommand = GET_BASE_ADDR(pEntry, tSmeCmd, Link);
- if (pCommand->u.scanCmd.callback)
+
+ status = sme_AcquireGlobalLock( &pMac->sme );
+ if ( HAL_STATUS_SUCCESS( status ) )
{
- /* User scan request is pending,
+ if (pCommand->u.scanCmd.callback)
+ {
+ /* User scan request is pending,
* send response with status eCSR_SCAN_ABORT*/
- pCommand->u.scanCmd.callback(pMac,
- pCommand->u.scanCmd.pContext,
- sessionId,
- pCommand->u.scanCmd.scanID,
- eCSR_SCAN_ABORT);
+ pCommand->u.scanCmd.callback(pMac,
+ pCommand->u.scanCmd.pContext,
+ sessionId,
+ pCommand->u.scanCmd.scanID,
+ eCSR_SCAN_ABORT);
+ }
+ sme_ReleaseGlobalLock( &pMac->sme );
}
csrReleaseCommandScan( pMac, pCommand );
}
@@ -8015,7 +8029,6 @@ eHalStatus csrProcessSetBGScanParam(tpAniSirGlobal pMac, tSmeCmd *pCommand)
return (status);
}
-
eHalStatus csrScanAbortMacScan(tpAniSirGlobal pMac, tANI_U8 sessionId,
eCsrAbortReason reason)
{
@@ -8035,6 +8048,8 @@ eHalStatus csrScanAbortMacScan(tpAniSirGlobal pMac, tANI_U8 sessionId,
{
pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link );
+ pCommand->u.scanCmd.callback = NULL;
+ pCommand->u.scanCmd.pContext = NULL;
csrAbortCommand( pMac, pCommand, eANI_BOOLEAN_FALSE);
}
csrLLUnlock(&pMac->scan.scanCmdPendingList);