From aa9d9084eafc360e2ddbd19a6faf4b4838bc1f72 Mon Sep 17 00:00:00 2001 From: Arun Kumar Khandavalli Date: Tue, 27 Oct 2020 17:35:22 +0530 Subject: [PATCH] qcacld-3.0: Close/destroy the pdev before CDS closing Pdev is created once all the modules are enabled and currently it is freed after the cds close is done, if some of the modules as part of the de-init sequence has to send a command to the firmware it will result in error. To keep the deinit sequence opposite to that of init close/destroy the pdev before closing the cds. Change-Id: I8e087a573112e5d2d81e8ea413044d45f228813e CRs-Fixed: 2797344 --- core/hdd/src/wlan_hdd_main.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index f056d45517a7..7005c34151e0 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -14139,6 +14139,14 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode) QDF_ASSERT(0); } + hdd_component_pdev_close(hdd_ctx->pdev); + dispatcher_pdev_close(hdd_ctx->pdev); + ret = hdd_objmgr_release_and_destroy_pdev(hdd_ctx); + if (ret) { + hdd_err("Failed to destroy pdev; errno:%d", ret); + QDF_ASSERT(0); + } + qdf_status = cds_close(hdd_ctx->psoc); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { hdd_warn("Failed to stop CDS: %d", qdf_status); @@ -14151,15 +14159,7 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode) hdd_err("WBUFF de-init unsuccessful; status: %d", qdf_status); - hdd_component_pdev_close(hdd_ctx->pdev); - hdd_component_psoc_close(hdd_ctx->psoc); - dispatcher_pdev_close(hdd_ctx->pdev); - ret = hdd_objmgr_release_and_destroy_pdev(hdd_ctx); - if (ret) { - hdd_err("Failed to destroy pdev; errno:%d", ret); - QDF_ASSERT(0); - } /* pdev close and destroy use tx rx ops so call this here */ wlan_global_lmac_if_close(hdd_ctx->psoc); }