qcacld-3.0: avoid free link_stats_results when last cmd isn't complete

For send_ll_stats_req from upper layer,  need send 1 wmi cmd:
WMI_REQUEST_UNIFIED_LL_GET_STA_CMDID,  and need 4 events from F/W
for dbs platform:
1.	radio_stats_event for radio 0
2.	tx_power_level_stats_event for radio 0
3.	radio_stats_event for radio 1
4.	tx_power_level_stats_event  for radio 1.

If new ll_stats_req comes before last send_ll_stats_req finished,
link_stats_results memory wil be freed, left event can't be handled and
last send_ll_stats_req can't get response from low level and time out
after 1.6s,  netlink is blocked during 1.6s,  many app will be blocked.

To fix it, if new ll_stats_req comes before last send_ll_stats_req
finished, don't free link_stats_results memory.

Change-Id: I27453d8a3c72e62b030657323ecdf463114b4ac8
CRs-Fixed: 3106562
This commit is contained in:
Jianmin Zhu
2022-01-07 22:21:48 +08:00
committed by Madan Koyyalamudi
orang tua 3768ab503c
melakukan 579df591f3
2 mengubah file dengan 7 tambahan dan 5 penghapusan

Melihat File

@@ -2050,6 +2050,10 @@ static int wlan_hdd_send_ll_stats_req(struct hdd_adapter *adapter,
hdd_enter_dev(adapter->dev);
status = wlan_hdd_set_station_stats_request_pending(adapter);
if (status == QDF_STATUS_E_ALREADY)
return qdf_status_to_os_return(status);
/*
* FW can send radio stats with multiple events and for the first event
* host allocates memory in wma and processes the events, there is a
@@ -2064,10 +2068,6 @@ static int wlan_hdd_send_ll_stats_req(struct hdd_adapter *adapter,
*/
sme_radio_tx_mem_free();
status = wlan_hdd_set_station_stats_request_pending(adapter);
if (status == QDF_STATUS_E_ALREADY)
return qdf_status_to_os_return(status);
request = osif_request_alloc(&params);
if (!request) {
hdd_err("Request Allocation Failure");

Melihat File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2013-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -1855,6 +1855,8 @@ int wma_unified_radio_tx_mem_free(void *handle)
if (!wma_handle->link_stats_results)
return 0;
wma_debug("free link_stats_results");
qdf_mutex_acquire(&wma_handle->radio_stats_lock);
ret = __wma_unified_radio_tx_mem_free(wma_handle);
qdf_mutex_release(&wma_handle->radio_stats_lock);