From 25fa2c07927097dfbe4cc2378a69dbee8d264683 Mon Sep 17 00:00:00 2001 From: Yeshwanth Sriram Guntuka Date: Wed, 1 Aug 2018 15:31:10 +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: I26b5746e9ba4f57f46b3a5a486bd85ef150d0ee7 CRs-Fixed: 2289004 --- 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 2dc809d0608e..69ac7ec04a45 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -1505,6 +1505,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 c0b633598587..a177953fc433 100644 --- a/core/wma/src/wma_data.c +++ b/core/wma/src/wma_data.c @@ -1250,6 +1250,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 7b9c6957dfe0..29ae3eafd0f0 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -3406,6 +3406,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"), @@ -3732,6 +3737,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",