diff options
| author | jiad <jiad@codeaurora.org> | 2017-05-18 11:28:57 +0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-05-30 00:56:55 -0700 |
| commit | b81ef70d636299f06b4936533796a6987beea950 (patch) | |
| tree | 8079d56ac4f0d62b202a9d53033cb72d30277cc1 | |
| parent | d849ef56e0db7c93e54a3a8eaf9bb9700ba1415f (diff) | |
qcacld-3.0: enable pktlog support for HL project
qcacld-2.0 to qcacld-3.0 propagation
Currently for SDIO implementation, tx comp indication is
suppressed and tx_desc is freed when htt download is done.
This leads to invalid tx_desc being referenced when pktlog
indication handler wants to collect TX-ed tx_desc information.
Fix consists of two parts:
1. When pktlog is enabled in ini, enable tx comp indication
handler just like PCIe and USB. tx_desc is still valid when
pktlog indication comes.
2. Check vdev pointer embedded in tx_desc structure. vdev
pointer is set when tx_desc is allocated and set to NULL when
tx_desc is freed. This guards against invalid tx_desc_id
from firmware.
Note that performance drops should be expected when
pktlog is enabled on HL platforms.
Change-Id: Iba9b8323b4a6e2ae17e36768bda3511f52236a2c
CRs-Fixed: 2034996
| -rw-r--r-- | core/bmi/src/ol_fw_common.c | 5 | ||||
| -rw-r--r-- | core/dp/txrx/ol_tx_desc.h | 10 | ||||
| -rw-r--r-- | core/utils/pktlog/pktlog_internal.c | 9 |
3 files changed, 21 insertions, 3 deletions
diff --git a/core/bmi/src/ol_fw_common.c b/core/bmi/src/ol_fw_common.c index f79e450bef1f..f56f3b005b1f 100644 --- a/core/bmi/src/ol_fw_common.c +++ b/core/bmi/src/ol_fw_common.c @@ -43,6 +43,7 @@ #include <net/cnss.h> #endif #include "i_bmi.h" +#include "cds_api.h" #ifdef CONFIG_DISABLE_SLEEP_BMI_OPTION static inline void ol_sdio_disable_sleep(struct ol_context *ol_ctx) @@ -167,6 +168,10 @@ QDF_STATUS ol_sdio_extra_initialization(struct ol_context *ol_ctx) HI_ACS_FLAGS_SDIO_REDUCE_TX_COMPL_SET| HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE); + /* enable TX completion to collect tx_desc for pktlog */ + if (cds_is_packet_log_enabled()) + param &= ~HI_ACS_FLAGS_SDIO_REDUCE_TX_COMPL_SET; + bmi_write_memory(hif_hia_item_address(target_type, offsetof(struct host_interest_s, hi_acs_flags)), diff --git a/core/dp/txrx/ol_tx_desc.h b/core/dp/txrx/ol_tx_desc.h index 3e804b558ae9..f1115f1e9a2a 100644 --- a/core/dp/txrx/ol_tx_desc.h +++ b/core/dp/txrx/ol_tx_desc.h @@ -144,7 +144,15 @@ ol_tx_desc_find_check(struct ol_txrx_pdev_t *pdev, u_int16_t tx_desc_id) static inline struct ol_tx_desc_t * ol_tx_desc_find_check(struct ol_txrx_pdev_t *pdev, u_int16_t tx_desc_id) { - return ol_tx_desc_find(pdev, tx_desc_id); + struct ol_tx_desc_t *tx_desc; + + tx_desc = ol_tx_desc_find(pdev, tx_desc_id); + + /* check against invalid tx_desc_id */ + if (ol_cfg_is_high_latency(pdev->ctrl_pdev) && !tx_desc->vdev) + return NULL; + + return tx_desc; } #endif diff --git a/core/utils/pktlog/pktlog_internal.c b/core/utils/pktlog/pktlog_internal.c index 3299102963bb..8a2b133a1afc 100644 --- a/core/utils/pktlog/pktlog_internal.c +++ b/core/utils/pktlog/pktlog_internal.c @@ -290,8 +290,13 @@ fill_ieee80211_hdr_data(struct ol_txrx_pdev_t *txrx_pdev, >> TX_DESC_ID_HIGH_SHIFT); msdu_id += 1; } - tx_desc = ol_tx_desc_find(txrx_pdev, tx_desc_id); - qdf_assert(tx_desc); + tx_desc = ol_tx_desc_find_check(txrx_pdev, tx_desc_id); + if (!tx_desc) { + qdf_print("%s: ignore invalid desc_id(%u)\n", __func__, + tx_desc_id); + return; + } + netbuf = tx_desc->netbuf; htt_tx_desc = (uint32_t *) tx_desc->htt_tx_desc; qdf_assert(htt_tx_desc); |
