summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTushnim Bhattacharyya <tushnimb@qca.qualcomm.com>2014-02-25 23:22:08 -0800
committerAkash Patel <c_akashp@qca.qualcomm.com>2014-02-26 18:49:01 -0800
commitcfd3d1700d057583ba7ab5002a2ef423ee715031 (patch)
tree41e3d494429ccf0797ee3e779d259aec076284b0
parent95bc5a68409897ea858131f6c073b4c1621c7a4f (diff)
wlan: cld: Race condition fix at driver initialization
Use wait_for_completion_timeout instead of wait_for_completion_interruptible_timeout to avoid unwanted signal which can interrupt the wait event leading to driver load failure Change-Id: I820de83018b6745a4a0343e6638397fdc8460e87 CRs-Fixed: 622956
-rw-r--r--CORE/SME/src/csr/csrApiRoam.c6
-rw-r--r--CORE/SME/src/csr/csrUtil.c2
-rw-r--r--CORE/VOSS/src/vos_nvitem.c10
3 files changed, 12 insertions, 6 deletions
diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c
index 4802737463ca..18ba783fe1d3 100644
--- a/CORE/SME/src/csr/csrApiRoam.c
+++ b/CORE/SME/src/csr/csrApiRoam.c
@@ -340,10 +340,16 @@ eHalStatus csr_init_chan_list(tpAniSirGlobal mac)
mac->scan.countryCodeDefault,
&reg_id, source);
if (status != eHAL_STATUS_SUCCESS)
+ {
+ smsLog(mac, LOGE, FL("csrGetRegulatoryDomainForCountry failed"));
return status;
+ }
if (vos_nv_setRegDomain(mac, reg_id, FALSE) != VOS_STATUS_SUCCESS)
+ {
+ smsLog(mac, LOGE, FL("vos_nv_setRegDomain failed"));
return eHAL_STATUS_FAILURE;
+ }
mac->scan.domainIdDefault = reg_id;
mac->scan.domainIdCurrent = mac->scan.domainIdDefault;
vos_mem_copy(mac->scan.countryCodeCurrent,
diff --git a/CORE/SME/src/csr/csrUtil.c b/CORE/SME/src/csr/csrUtil.c
index 77db26419421..ef599a0d00b9 100644
--- a/CORE/SME/src/csr/csrUtil.c
+++ b/CORE/SME/src/csr/csrUtil.c
@@ -6128,7 +6128,7 @@ v_CountryInfoSource_t source
}
else
{
- smsLog(pMac, LOGW, FL(" doesn't match country %c%c"), pCountry[0], pCountry[1]);
+ smsLog(pMac, LOGE, FL(" doesn't match country %c%c, status %d"), pCountry[0], pCountry[1], vosStatus);
status = eHAL_STATUS_INVALID_PARAMETER;
}
}
diff --git a/CORE/VOSS/src/vos_nvitem.c b/CORE/VOSS/src/vos_nvitem.c
index 8ab9f334ed03..228a6f1eaa86 100644
--- a/CORE/VOSS/src/vos_nvitem.c
+++ b/CORE/VOSS/src/vos_nvitem.c
@@ -3032,14 +3032,14 @@ VOS_STATUS vos_nv_getRegDomainFromCountryCode( v_REGDOMAIN_t *pRegDomain,
{
INIT_COMPLETION(pHddCtx->linux_reg_req);
regulatory_hint(wiphy, country_code);
- wait_result = wait_for_completion_interruptible_timeout(
- &pHddCtx->linux_reg_req,
- LINUX_REG_WAIT_TIME);
+ wait_result = wait_for_completion_timeout(
+ &pHddCtx->linux_reg_req,
+ LINUX_REG_WAIT_TIME);
/* if the country information does not exist with the kernel,
then the driver callback would not be called */
- if (wait_result >= 0) {
+ if (wait_result > 0) {
/* the driver callback was called. this means the country
regulatory information was found in the kernel database.
@@ -3062,7 +3062,7 @@ VOS_STATUS vos_nv_getRegDomainFromCountryCode( v_REGDOMAIN_t *pRegDomain,
/* the country information has not been found in the kernel
database, return failure */
- VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_WARN,
+ VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
("runtime country code is not found in kernel db"));
return VOS_STATUS_E_EXISTS;