From d33276b0e31385364fe492677a243bc44994b321 Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Wed, 29 Nov 2017 11:08:11 -0800 Subject: [PATCH] qcacld-3.0: Close cds sched as part of cds_close() cds_sched_open is called as part of cds_open, but cds_sched_close is called outside of cds_close. This leads to situations where the CDS scheduler is started but not properly closed. Move the call to cds_sched_close into cds_close, such that the CDS scheduler lifecycle is tied directly to the CDS core lifecycle, to prevent CDS from closing without closing the CDS scheduler. Change-Id: I440ec279e6b750a7b41ec05000fc66b6cebdb8d8 CRs-Fixed: 2151049 --- core/cds/src/cds_api.c | 5 +++++ core/hdd/src/wlan_hdd_main.c | 10 ---------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index 4d0fae02ee925..39561b396cd43 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -1122,6 +1122,11 @@ QDF_STATUS cds_close(struct wlan_objmgr_psoc *psoc) { QDF_STATUS qdf_status; + qdf_status = cds_sched_close(); + QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status)); + if (QDF_IS_STATUS_ERROR(qdf_status)) + cds_err("Failed to close CDS Scheduler"); + dispatcher_psoc_close(psoc); qdf_status = wma_wmi_work_close(); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index c9ca468430586..9466dec8bdc0c 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9781,16 +9781,6 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode) QDF_ASSERT(0); } - /* - * Close the scheduler before calling cds_close to make sure - * no thread is scheduled after the each module close is - * is called i.e after all the data structures are freed. - */ - qdf_status = cds_sched_close(); - QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status)); - if (QDF_IS_STATUS_ERROR(qdf_status)) - hdd_alert("Failed to close CDS Scheduler"); - qdf_status = cds_close(hdd_ctx->hdd_psoc); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { hdd_warn("Failed to stop CDS: %d", qdf_status);