From 858feb14d25661b17fe6a5cfd6bd6d3e771a8835 Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Mon, 21 May 2018 01:52:46 -0400 Subject: [PATCH] qcacld-3.0: do PLD power off for FTM mode Remove cds_set_load_in_progress so that the hdd_wlan_stop_modules can do PLD power off for FTM mode. Add con_mode_flag checking for HDD context access protection. Change-Id: Ie48443579fcb692fcc806cb9b6bf5782d7764c9f CRs-Fixed: 2246876 --- core/hdd/src/wlan_hdd_main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 4fa158e439..2b0fe0d557 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -878,6 +878,11 @@ int wlan_hdd_validate_context(struct hdd_context *hdd_ctx) return -EAGAIN; } + if (qdf_atomic_read(&hdd_ctx->con_mode_flag)) { + hdd_debug("con_mode_handler is in progress Ignore!!!"); + return -EAGAIN; + } + return 0; } @@ -12542,7 +12547,6 @@ static int __con_mode_handler(const char *kmessage, return ret; qdf_atomic_set(&hdd_ctx->con_mode_flag, 1); - cds_set_load_in_progress(true); ret = kstrtoint(kmessage, 0, &new_con_mode); if (ret) { @@ -12626,7 +12630,6 @@ static int __con_mode_handler(const char *kmessage, reset_flags: mutex_unlock(&hdd_init_deinit_lock); - cds_set_load_in_progress(false); qdf_atomic_set(&hdd_ctx->con_mode_flag, 0); return ret; }