aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorErik Stromdahl <erik.stromdahl@gmail.com>2018-09-04 08:05:23 -0400
committerKalle Valo <kvalo@codeaurora.org>2018-09-06 12:14:37 -0400
commite66d5361127a485e5d136c870e4019a95907bd7c (patch)
tree87b86608bb2100c0f1da2413e79672e9fd6a556d /drivers/net/wireless/ath
parent4875e0b5208555a9cc2c45558f016e0814cbd6cb (diff)
ath10k: DMA related fixes for high latency devices
Several DMA related functions (such as the dma_map_xxx functions) are not used with high latency devices and don't need to be invoked in this case. Signed-off-by: Erik Stromdahl <erik.stromdahl@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ath10k/htc.c19
-rw-r--r--drivers/net/wireless/ath/ath10k/htt_tx.c3
-rw-r--r--drivers/net/wireless/ath/ath10k/txrx.c3
3 files changed, 16 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath/ath10k/htc.c b/drivers/net/wireless/ath/ath10k/htc.c
index 4e70ff2f78ae..28daed5981a1 100644
--- a/drivers/net/wireless/ath/ath10k/htc.c
+++ b/drivers/net/wireless/ath/ath10k/htc.c
@@ -53,7 +53,8 @@ static inline void ath10k_htc_restore_tx_skb(struct ath10k_htc *htc,
53{ 53{
54 struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb); 54 struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb);
55 55
56 dma_unmap_single(htc->ar->dev, skb_cb->paddr, skb->len, DMA_TO_DEVICE); 56 if (htc->ar->dev_type != ATH10K_DEV_TYPE_HL)
57 dma_unmap_single(htc->ar->dev, skb_cb->paddr, skb->len, DMA_TO_DEVICE);
57 skb_pull(skb, sizeof(struct ath10k_htc_hdr)); 58 skb_pull(skb, sizeof(struct ath10k_htc_hdr));
58} 59}
59 60
@@ -137,11 +138,14 @@ int ath10k_htc_send(struct ath10k_htc *htc,
137 ath10k_htc_prepare_tx_skb(ep, skb); 138 ath10k_htc_prepare_tx_skb(ep, skb);
138 139
139 skb_cb->eid = eid; 140 skb_cb->eid = eid;
140 skb_cb->paddr = dma_map_single(dev, skb->data, skb->len, DMA_TO_DEVICE); 141 if (ar->dev_type != ATH10K_DEV_TYPE_HL) {
141 ret = dma_mapping_error(dev, skb_cb->paddr); 142 skb_cb->paddr = dma_map_single(dev, skb->data, skb->len,
142 if (ret) { 143 DMA_TO_DEVICE);
143 ret = -EIO; 144 ret = dma_mapping_error(dev, skb_cb->paddr);
144 goto err_credits; 145 if (ret) {
146 ret = -EIO;
147 goto err_credits;
148 }
145 } 149 }
146 150
147 sg_item.transfer_id = ep->eid; 151 sg_item.transfer_id = ep->eid;
@@ -157,7 +161,8 @@ int ath10k_htc_send(struct ath10k_htc *htc,
157 return 0; 161 return 0;
158 162
159err_unmap: 163err_unmap:
160 dma_unmap_single(dev, skb_cb->paddr, skb->len, DMA_TO_DEVICE); 164 if (ar->dev_type != ATH10K_DEV_TYPE_HL)
165 dma_unmap_single(dev, skb_cb->paddr, skb->len, DMA_TO_DEVICE);
161err_credits: 166err_credits:
162 if (ep->tx_credit_flow_enabled) { 167 if (ep->tx_credit_flow_enabled) {
163 spin_lock_bh(&htc->tx_lock); 168 spin_lock_bh(&htc->tx_lock);
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c
index 7cff0d52338f..965acd57b22f 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -1123,7 +1123,8 @@ int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)
1123 return 0; 1123 return 0;
1124 1124
1125err_unmap_msdu: 1125err_unmap_msdu:
1126 dma_unmap_single(dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); 1126 if (ar->dev_type != ATH10K_DEV_TYPE_HL)
1127 dma_unmap_single(dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE);
1127err_free_txdesc: 1128err_free_txdesc:
1128 dev_kfree_skb_any(txdesc); 1129 dev_kfree_skb_any(txdesc);
1129err_free_msdu_id: 1130err_free_msdu_id:
diff --git a/drivers/net/wireless/ath/ath10k/txrx.c b/drivers/net/wireless/ath/ath10k/txrx.c
index cda164f6e9f6..23606b6972d0 100644
--- a/drivers/net/wireless/ath/ath10k/txrx.c
+++ b/drivers/net/wireless/ath/ath10k/txrx.c
@@ -95,7 +95,8 @@ int ath10k_txrx_tx_unref(struct ath10k_htt *htt,
95 wake_up(&htt->empty_tx_wq); 95 wake_up(&htt->empty_tx_wq);
96 spin_unlock_bh(&htt->tx_lock); 96 spin_unlock_bh(&htt->tx_lock);
97 97
98 dma_unmap_single(dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); 98 if (ar->dev_type != ATH10K_DEV_TYPE_HL)
99 dma_unmap_single(dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE);
99 100
100 ath10k_report_offchan_tx(htt->ar, msdu); 101 ath10k_report_offchan_tx(htt->ar, msdu);
101 102