From f0c0d76d7249aab47a18fbb024ee4b0eea07b731 Mon Sep 17 00:00:00 2001 From: Arunk Khandavalli Date: Thu, 7 Dec 2017 10:18:50 +0530 Subject: [PATCH] qcacld-3.0: cleanup scan queue in case of SSR When the SSR and interface down happen in parallel, the driver rejects the interface down since the recovery is in progress. Kernel ignores the -EAGAIN request from the driver and as part of NET_DOWN notification in cfg80211_netdown_notifer the kernel invokes the ___cfg80211_scan_done to free the request but dosen't not send scan_result indication, since it expects the scan_done work to get scheduled and then broadcast the request to upperlayer. Change-Id: Id698044ebe30cf555300e909a916d74be1f8b94f CRs-Fixed: 2115392 --- core/hdd/src/wlan_hdd_driver_ops.c | 5 +++++ core/hdd/src/wlan_hdd_main.c | 7 +++++++ core/hdd/src/wlan_hdd_power.c | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index 9aa5bf6d4203..896e9575c73b 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -1466,6 +1466,7 @@ static void wlan_hdd_set_the_pld_uevent(struct pld_uevent_data *uevent) static void wlan_hdd_handle_the_pld_uevent(struct pld_uevent_data *uevent) { enum cds_driver_state driver_state; + struct hdd_context *hdd_ctx; driver_state = cds_get_driver_state(); @@ -1482,6 +1483,10 @@ static void wlan_hdd_handle_the_pld_uevent(struct pld_uevent_data *uevent) case PLD_FW_DOWN: qdf_complete_wait_events(); cds_set_target_ready(false); + hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); + if (hdd_ctx != NULL) + wlan_cfg80211_cleanup_scan_queue( + hdd_ctx->hdd_pdev); break; case PLD_FW_READY: default: diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index faf111b8d3cd..43e74477f16d 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -552,6 +552,13 @@ static int __hdd_netdev_notifier_call(struct notifier_block *nb, cds_flush_work(&adapter->scan_block_work); hdd_debug("Scan is not Pending from user"); } + /* + * After NETDEV_GOING_DOWN, kernel calls hdd_stop.Irrespective + * of return status of hdd_stop call, kernel resets the IFF_UP + * flag after which driver does not send the cfg80211_scan_done. + * Ensure to cleanup the scan queue in NETDEV_GOING_DOWN + */ + wlan_cfg80211_cleanup_scan_queue(hdd_ctx->hdd_pdev); break; default: diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index ba52464dfea9..f445af6a0db1 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -82,6 +82,7 @@ #include "scheduler_api.h" #include "cds_utils.h" #include "wlan_hdd_packet_filter_api.h" +#include "wlan_cfg80211_scan.h" /* Preprocessor definitions and constants */ #ifdef QCA_WIFI_NAPIER_EMULATION @@ -1272,7 +1273,6 @@ QDF_STATUS hdd_wlan_shutdown(void) hdd_debug("Invoking packetdump deregistration API"); wlan_deregister_txrx_packetdump(); - wlan_cfg80211_cleanup_scan_queue(hdd_ctx->hdd_pdev); hdd_reset_all_adapters(hdd_ctx); /* Flush cached rx frame queue */