Return-path: Received: from mail-pg0-f66.google.com ([74.125.83.66]:38763 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752178AbdI3Rij (ORCPT ); Sat, 30 Sep 2017 13:38:39 -0400 Received: by mail-pg0-f66.google.com with SMTP id y192so1837352pgd.5 for ; Sat, 30 Sep 2017 10:38:39 -0700 (PDT) From: silexcommon@gmail.com To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Alagu Sankar Subject: [PATCH 06/11] ath10k_sdio: high latency fixes for beacon buffer Date: Sat, 30 Sep 2017 23:07:43 +0530 Message-Id: <1506793068-27445-7-git-send-email-alagusankar@silex-india.com> (sfid-20170930_193803_580056_AF72B819) In-Reply-To: <1506793068-27445-1-git-send-email-alagusankar@silex-india.com> References: <1506793068-27445-1-git-send-email-alagusankar@silex-india.com> Sender: linux-wireless-owner@vger.kernel.org List-ID: From: Alagu Sankar Beacon buffer for high latency devices does not use dma. other similar buffer allocation methods in the driver have already been modified for high latency path. Fix the beacon buffer allocation left out in the earlier high latency changes. Signed-off-by: Alagu Sankar --- drivers/net/wireless/ath/ath10k/mac.c | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index f374d1b..c48785b 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -944,8 +944,12 @@ static void ath10k_mac_vif_beacon_cleanup(struct ath10k_vif *arvif) ath10k_mac_vif_beacon_free(arvif); if (arvif->beacon_buf) { - dma_free_coherent(ar->dev, IEEE80211_MAX_FRAME_LEN, - arvif->beacon_buf, arvif->beacon_paddr); + if (ar->is_high_latency) + kfree(arvif->beacon_buf); + else + dma_free_coherent(ar->dev, IEEE80211_MAX_FRAME_LEN, + arvif->beacon_buf, + arvif->beacon_paddr); arvif->beacon_buf = NULL; } } @@ -5052,10 +5056,17 @@ static int ath10k_add_interface(struct ieee80211_hw *hw, if (vif->type == NL80211_IFTYPE_ADHOC || vif->type == NL80211_IFTYPE_MESH_POINT || vif->type == NL80211_IFTYPE_AP) { - arvif->beacon_buf = dma_zalloc_coherent(ar->dev, - IEEE80211_MAX_FRAME_LEN, - &arvif->beacon_paddr, - GFP_ATOMIC); + if (ar->is_high_latency) { + arvif->beacon_buf = kmalloc(IEEE80211_MAX_FRAME_LEN, + GFP_KERNEL); + arvif->beacon_paddr = (dma_addr_t)arvif->beacon_buf; + } else { + arvif->beacon_buf = + dma_zalloc_coherent(ar->dev, + IEEE80211_MAX_FRAME_LEN, + &arvif->beacon_paddr, + GFP_ATOMIC); + } if (!arvif->beacon_buf) { ret = -ENOMEM; ath10k_warn(ar, "failed to allocate beacon buffer: %d\n", @@ -5244,8 +5255,12 @@ static int ath10k_add_interface(struct ieee80211_hw *hw, err: if (arvif->beacon_buf) { - dma_free_coherent(ar->dev, IEEE80211_MAX_FRAME_LEN, - arvif->beacon_buf, arvif->beacon_paddr); + if (ar->is_high_latency) + kfree(arvif->beacon_buf); + else + dma_free_coherent(ar->dev, IEEE80211_MAX_FRAME_LEN, + arvif->beacon_buf, + arvif->beacon_paddr); arvif->beacon_buf = NULL; } -- 1.9.1