From 51d818cb2ae27ceaa82561ebcbb667fd34405f65 Mon Sep 17 00:00:00 2001 From: Himanshu Agarwal Date: Thu, 19 Apr 2018 18:16:46 +0530 Subject: [PATCH] qcacld-3.0: Don't fill any WMA request if target is not ready If any WMA request is queued in wma hold req/vdev resp queue after fw has crashed and sent the corresponding uevent to HOST, request will timeout and if at the same time, SSR is also going on, it may lead to various issues and crashes. Check whether target is ready or not before queuing any request in wma hold req/vdev resp queue. Change-Id: I358841566f858e115b3b04f12f4d8b70b75d1dfc CRs-Fixed: 2226497 --- core/hdd/src/wlan_hdd_driver_ops.c | 1 + core/wma/src/wma_data.c | 1 + core/wma/src/wma_dev_if.c | 10 ++++++++++ 3 files changed, 12 insertions(+) diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index 38513db558fc..4b17b087383a 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -1489,6 +1489,7 @@ static void wlan_hdd_handle_the_pld_uevent(struct pld_uevent_data *uevent) switch (uevent->uevent) { case PLD_RECOVERY: + cds_set_target_ready(false); hdd_pld_ipa_uc_shutdown_pipes(); break; case PLD_FW_DOWN: diff --git a/core/wma/src/wma_data.c b/core/wma/src/wma_data.c index 01a4f356fbb8..5f1511b478f2 100644 --- a/core/wma/src/wma_data.c +++ b/core/wma/src/wma_data.c @@ -1217,6 +1217,7 @@ void wma_set_linkstate(tp_wma_handle wma, tpLinkStateParams params) vdev_id); params->status = false; status = QDF_STATUS_E_NOMEM; + goto out; } wma_vdev_set_pause_bit(vdev_id, PAUSE_TYPE_HOST); if (wma_send_vdev_stop_to_fw(wma, vdev_id)) { diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index 6fe3af6571d9..56d558a0730d 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -3278,6 +3278,11 @@ struct wma_target_req *wma_fill_hold_req(tp_wma_handle wma, struct wma_target_req *req; QDF_STATUS status; + if (!cds_is_target_ready()) { + WMA_LOGE("target not ready, drop the request"); + return NULL; + } + req = qdf_mem_malloc(sizeof(*req)); if (!req) { WMA_LOGE(FL("Failed to allocate memory for msg %d vdev %d"), @@ -3587,6 +3592,11 @@ struct wma_target_req *wma_fill_vdev_req(tp_wma_handle wma, struct wma_target_req *req; QDF_STATUS status; + if (!cds_is_target_ready()) { + WMA_LOGE("target not ready, drop the request"); + return NULL; + } + req = qdf_mem_malloc(sizeof(*req)); if (!req) { WMA_LOGE("%s: Failed to allocate memory for msg %d vdev %d",