summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Zhang <paulz@codeaurora.org>2018-05-29 14:19:24 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2018-06-10 19:51:56 -0700
commit5a55990ddd52cf33b2fa5c40c253fcdd7ca20a8b (patch)
tree78bef8945af68a5840b0c9a132f4b193dd96d09c
parent8da2652ceb4209d9e233f94227c826a34d2c0ad3 (diff)
qcacld-3.0: Retry if request_firmware returns EAGAIN
Loading driver is fail because request_firmware returns EAGAIN when it invokes usermodehelper_read_trylock during system suspend happens. Though system suspend is aborted, it hasn't invoked usermodehelper_enable yet. To resolve this issue, retry again to check whether usermodehelper_enable has done. Change-Id: I80f95c2194039a67adbc463a32bfc0a15e68484b CRs-Fixed: 2251604
-rw-r--r--core/hdd/inc/wlan_hdd_main.h3
-rw-r--r--core/hdd/src/wlan_hdd_cfg.c14
2 files changed, 15 insertions, 2 deletions
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h
index fada4546d886..aba1d43d8dfc 100644
--- a/core/hdd/inc/wlan_hdd_main.h
+++ b/core/hdd/inc/wlan_hdd_main.h
@@ -275,6 +275,9 @@
#define HDD_MOD_EXIT_SSR_MAX_RETRIES 75
#endif
+#define HDD_CFG_REQUEST_FIRMWARE_RETRIES (3)
+#define HDD_CFG_REQUEST_FIRMWARE_DELAY (20)
+
#ifdef WLAN_FEATURE_GTK_OFFLOAD
#define GTK_OFFLOAD_ENABLE 0
#define GTK_OFFLOAD_DISABLE 1
diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c
index 04a2dc533420..3dcc8fa68eb6 100644
--- a/core/hdd/src/wlan_hdd_cfg.c
+++ b/core/hdd/src/wlan_hdd_cfg.c
@@ -7736,7 +7736,9 @@ static void hdd_set_rx_mode_value(hdd_context_t *hdd_ctx)
*/
QDF_STATUS hdd_parse_config_ini(hdd_context_t *pHddCtx)
{
- int status, i = 0;
+ int status = 0;
+ int i = 0;
+ int retry = 0;
/** Pointer for firmware image data */
const struct firmware *fw = NULL;
char *buffer, *line, *pTemp = NULL;
@@ -7748,7 +7750,15 @@ QDF_STATUS hdd_parse_config_ini(hdd_context_t *pHddCtx)
memset(cfgIniTable, 0, sizeof(cfgIniTable));
- status = request_firmware(&fw, WLAN_INI_FILE, pHddCtx->parent_dev);
+ do {
+ if (status == -EAGAIN)
+ msleep(HDD_CFG_REQUEST_FIRMWARE_DELAY);
+
+ status = request_firmware(&fw, WLAN_INI_FILE,
+ pHddCtx->parent_dev);
+ retry++;
+ } while ((retry < HDD_CFG_REQUEST_FIRMWARE_RETRIES) &&
+ (status == -EAGAIN));
if (status) {
hdd_alert("request_firmware failed %d", status);