| From b28b3b83e3aa5adc26b3e18b998715a1c14b247e Mon Sep 17 00:00:00 2001 |
| From: Youghandhar Chintala <quic_youghand@quicinc.com> |
| Date: Fri, 21 Jan 2022 12:14:27 +0530 |
| Subject: [PATCH] BACKPORT: FROMLIST: ath10k: Delay the unmapping of the buffer |
| |
| We are seeing a corner case smmu fault issue where copy engine is still |
| accessing the memory though host unmaps it hence as work around |
| we are delaying the unmapping the memory. |
| |
| Tested-on: WLAN.HL.3.2.2.c10-00757-QCAHLSWMTPL-1 |
| |
| Signed-off-by: Youghandhar Chintala <quic_youghand@quicinc.com> |
| (am from https://patchwork.kernel.org/patch/12719338/) |
| (also found at https://lore.kernel.org/r/20220121064427.32059-3-quic_youghand@quicinc.com) |
| |
| Conflicts: |
| drivers/net/wireless/ath/ath10k/htc.c |
| Context conflicts since those patches are 4 months old. |
| |
| BUG=b:202564690, b:215757035 |
| TEST=Reboot tests; S2R tests |
| |
| Signed-off-by: Douglas Anderson <dianders@chromium.org> |
| Change-Id: I8d5006902a9eec9f13f098805e0d0716bc94a625 |
| Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/3673024 |
| Reviewed-by: Abhishek Kumar <kuabhs@chromium.org> |
| --- |
| drivers/net/wireless/ath/ath10k/core.c | 16 ++++++++++++++++ |
| drivers/net/wireless/ath/ath10k/htc.c | 5 +++++ |
| drivers/net/wireless/ath/ath10k/hw.h | 3 +++ |
| 3 files changed, 24 insertions(+) |
| |
| diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c |
| index f85275be1b4c..5220018150b0 100644 |
| --- a/drivers/net/wireless/ath/ath10k/core.c |
| +++ b/drivers/net/wireless/ath/ath10k/core.c |
| @@ -99,6 +99,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { |
| .dynamic_sar_support = false, |
| .hw_restart_disconnect = false, |
| .use_fw_tx_credits = true, |
| + .delay_unmap_buffer = false, |
| }, |
| { |
| .id = QCA988X_HW_2_0_VERSION, |
| @@ -138,6 +139,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { |
| .dynamic_sar_support = false, |
| .hw_restart_disconnect = false, |
| .use_fw_tx_credits = true, |
| + .delay_unmap_buffer = false, |
| }, |
| { |
| .id = QCA9887_HW_1_0_VERSION, |
| @@ -178,6 +180,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { |
| .dynamic_sar_support = false, |
| .hw_restart_disconnect = false, |
| .use_fw_tx_credits = true, |
| + .delay_unmap_buffer = false, |
| }, |
| { |
| .id = QCA6174_HW_3_2_VERSION, |
| @@ -214,6 +217,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { |
| .hw_restart_disconnect = false, |
| .use_fw_tx_credits = true, |
| .start_retry = ATH10K_START_RETRY, |
| + .delay_unmap_buffer = false, |
| }, |
| { |
| .id = QCA6174_HW_2_1_VERSION, |
| @@ -253,6 +257,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { |
| .dynamic_sar_support = false, |
| .hw_restart_disconnect = false, |
| .use_fw_tx_credits = true, |
| + .delay_unmap_buffer = false, |
| }, |
| { |
| .id = QCA6174_HW_2_1_VERSION, |
| @@ -292,6 +297,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { |
| .dynamic_sar_support = false, |
| .hw_restart_disconnect = false, |
| .use_fw_tx_credits = true, |
| + .delay_unmap_buffer = false, |
| }, |
| { |
| .id = QCA6174_HW_3_0_VERSION, |
| @@ -331,6 +337,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { |
| .dynamic_sar_support = false, |
| .hw_restart_disconnect = false, |
| .use_fw_tx_credits = true, |
| + .delay_unmap_buffer = false, |
| }, |
| { |
| .id = QCA6174_HW_3_2_VERSION, |
| @@ -374,6 +381,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { |
| .dynamic_sar_support = true, |
| .hw_restart_disconnect = false, |
| .use_fw_tx_credits = true, |
| + .delay_unmap_buffer = false, |
| }, |
| { |
| .id = QCA99X0_HW_2_0_DEV_VERSION, |
| @@ -419,6 +427,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { |
| .dynamic_sar_support = false, |
| .hw_restart_disconnect = false, |
| .use_fw_tx_credits = true, |
| + .delay_unmap_buffer = false, |
| }, |
| { |
| .id = QCA9984_HW_1_0_DEV_VERSION, |
| @@ -471,6 +480,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { |
| .dynamic_sar_support = false, |
| .hw_restart_disconnect = false, |
| .use_fw_tx_credits = true, |
| + .delay_unmap_buffer = false, |
| }, |
| { |
| .id = QCA9888_HW_2_0_DEV_VERSION, |
| @@ -520,6 +530,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { |
| .dynamic_sar_support = false, |
| .hw_restart_disconnect = false, |
| .use_fw_tx_credits = true, |
| + .delay_unmap_buffer = false, |
| }, |
| { |
| .id = QCA9377_HW_1_0_DEV_VERSION, |
| @@ -559,6 +570,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { |
| .dynamic_sar_support = false, |
| .hw_restart_disconnect = false, |
| .use_fw_tx_credits = true, |
| + .delay_unmap_buffer = false, |
| }, |
| { |
| .id = QCA9377_HW_1_1_DEV_VERSION, |
| @@ -600,6 +612,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { |
| .dynamic_sar_support = false, |
| .hw_restart_disconnect = false, |
| .use_fw_tx_credits = true, |
| + .delay_unmap_buffer = false, |
| }, |
| { |
| .id = QCA9377_HW_1_1_DEV_VERSION, |
| @@ -632,6 +645,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { |
| .dynamic_sar_support = false, |
| .hw_restart_disconnect = false, |
| .use_fw_tx_credits = true, |
| + .delay_unmap_buffer = false, |
| }, |
| { |
| .id = QCA4019_HW_1_0_DEV_VERSION, |
| @@ -678,6 +692,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { |
| .dynamic_sar_support = false, |
| .hw_restart_disconnect = false, |
| .use_fw_tx_credits = true, |
| + .delay_unmap_buffer = false, |
| }, |
| { |
| .id = WCN3990_HW_1_0_DEV_VERSION, |
| @@ -710,6 +725,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { |
| .dynamic_sar_support = true, |
| .hw_restart_disconnect = true, |
| .use_fw_tx_credits = false, |
| + .delay_unmap_buffer = false, |
| }, |
| }; |
| |
| diff --git a/drivers/net/wireless/ath/ath10k/htc.c b/drivers/net/wireless/ath/ath10k/htc.c |
| index 6d1784f74bea..63279045a6a6 100644 |
| --- a/drivers/net/wireless/ath/ath10k/htc.c |
| +++ b/drivers/net/wireless/ath/ath10k/htc.c |
| @@ -56,6 +56,11 @@ void ath10k_htc_notify_tx_completion(struct ath10k_htc_ep *ep, |
| ath10k_dbg(ar, ATH10K_DBG_HTC, "%s: ep %d skb %pK\n", __func__, |
| ep->eid, skb); |
| |
| + /* WAR - Delay the unmapping of the buffer */ |
| + if (ar->hw_params.delay_unmap_buffer && |
| + ep->ul_pipe_id == 3) |
| + mdelay(2); |
| + |
| hdr = (struct ath10k_htc_hdr *)skb->data; |
| ath10k_htc_restore_tx_skb(ep->htc, skb); |
| |
| diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h |
| index 415bae6b6fe1..214f519fc108 100644 |
| --- a/drivers/net/wireless/ath/ath10k/hw.h |
| +++ b/drivers/net/wireless/ath/ath10k/hw.h |
| @@ -639,6 +639,9 @@ struct ath10k_hw_params { |
| bool use_fw_tx_credits; |
| |
| u32 start_retry; |
| + |
| + /* WAR - Delay the unmapping of the buffer */ |
| + bool delay_unmap_buffer; |
| }; |
| |
| struct htt_resp; |
| -- |
| 2.38.0.413.g74048e4d9e-goog |
| |