From e76354d77ef85f69d20eaad0c8ab297315d821d6 Mon Sep 17 00:00:00 2001 From: yunjie Date: Mon, 19 Feb 2024 17:58:01 +0000 Subject: [PATCH] MA-22118 [8MQ & 8MP] io_tlb_used issue after apply WCS Q1 patch Reason:WCSWREL-571 PCIe call moal_map_memory 2 times, Fix the bug in call wlan_pcie_send_boot_cmd Tested:on 8MP Change-Id: Ia856602961fb9d3573059da6dfaf17dcf741873b Signed-off-by: yunjie --- mxm_wifiex/wlan_src/mlan/mlan_pcie.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/mxm_wifiex/wlan_src/mlan/mlan_pcie.c b/mxm_wifiex/wlan_src/mlan/mlan_pcie.c index e32a3ad..cdf4975 100644 --- a/mxm_wifiex/wlan_src/mlan/mlan_pcie.c +++ b/mxm_wifiex/wlan_src/mlan/mlan_pcie.c @@ -713,11 +713,12 @@ static mlan_status wlan_pcie_set_host_int_select_mask(mlan_adapter *pmadapter, * * @param pmadapter A pointer to mlan_adapter structure * @param pmbuf A pointer to mlan_buffer + * @param mapping mapping flag * * @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE */ static mlan_status wlan_pcie_send_boot_cmd(mlan_adapter *pmadapter, - mlan_buffer *pmbuf) + mlan_buffer *pmbuf, t_u8 mapping) { mlan_status ret = MLAN_STATUS_SUCCESS; pmlan_callbacks pcb = &pmadapter->callbacks; @@ -730,13 +731,16 @@ static mlan_status wlan_pcie_send_boot_cmd(mlan_adapter *pmadapter, return MLAN_STATUS_FAILURE; } - if (MLAN_STATUS_FAILURE == - pcb->moal_map_memory( - pmadapter->pmoal_handle, pmbuf->pbuf + pmbuf->data_offset, - &pmbuf->buf_pa, WLAN_UPLD_SIZE, PCI_DMA_TODEVICE)) { - PRINTM(MERROR, "BootCmd: failed to moal_map_memory\n"); - LEAVE(); - return MLAN_STATUS_FAILURE; + if (mapping) { + if (MLAN_STATUS_FAILURE == + pcb->moal_map_memory(pmadapter->pmoal_handle, + pmbuf->pbuf + pmbuf->data_offset, + &pmbuf->buf_pa, WLAN_UPLD_SIZE, + PCI_DMA_TODEVICE)) { + PRINTM(MERROR, "BootCmd: failed to moal_map_memory\n"); + LEAVE(); + return MLAN_STATUS_FAILURE; + } } if (!(pmbuf->pbuf && pmbuf->data_len && pmbuf->buf_pa)) { @@ -877,7 +881,7 @@ static mlan_status wlan_pcie_send_vdll(mlan_adapter *pmadapter, #ifdef PCIE8997 if (!pmadapter->pcard_pcie->reg->use_adma) { - if (wlan_pcie_send_boot_cmd(pmadapter, pmbuf)) { + if (wlan_pcie_send_boot_cmd(pmadapter, pmbuf, MFALSE)) { PRINTM(MERROR, "Failed to send vdll block to device\n"); ret = MLAN_STATUS_FAILURE; goto done; @@ -2824,7 +2828,7 @@ static mlan_status wlan_pcie_send_cmd(mlan_adapter *pmadapter, goto done; } } - if (wlan_pcie_send_boot_cmd(pmadapter, pmbuf)) { + if (wlan_pcie_send_boot_cmd(pmadapter, pmbuf, MFALSE)) { PRINTM(MERROR, "Failed to send hostcmd to device\n"); ret = MLAN_STATUS_FAILURE; goto done; @@ -3650,7 +3654,7 @@ static mlan_status wlan_pcie_prog_fw_w_helper(mlan_adapter *pmadapter, } /* Send the boot command to device */ - if (wlan_pcie_send_boot_cmd(pmadapter, pmbuf)) { + if (wlan_pcie_send_boot_cmd(pmadapter, pmbuf, MTRUE)) { PRINTM(MERROR, "Failed to send firmware download command\n"); goto done;