Commit e66d5361 authored by Erik Stromdahl's avatar Erik Stromdahl Committed by Kalle Valo

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: default avatarErik Stromdahl <erik.stromdahl@gmail.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 4875e0b5
...@@ -53,6 +53,7 @@ static inline void ath10k_htc_restore_tx_skb(struct ath10k_htc *htc, ...@@ -53,6 +53,7 @@ static inline void ath10k_htc_restore_tx_skb(struct ath10k_htc *htc,
{ {
struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb); struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb);
if (htc->ar->dev_type != ATH10K_DEV_TYPE_HL)
dma_unmap_single(htc->ar->dev, skb_cb->paddr, skb->len, DMA_TO_DEVICE); dma_unmap_single(htc->ar->dev, skb_cb->paddr, skb->len, DMA_TO_DEVICE);
skb_pull(skb, sizeof(struct ath10k_htc_hdr)); skb_pull(skb, sizeof(struct ath10k_htc_hdr));
} }
...@@ -137,12 +138,15 @@ int ath10k_htc_send(struct ath10k_htc *htc, ...@@ -137,12 +138,15 @@ int ath10k_htc_send(struct ath10k_htc *htc,
ath10k_htc_prepare_tx_skb(ep, skb); ath10k_htc_prepare_tx_skb(ep, skb);
skb_cb->eid = eid; skb_cb->eid = eid;
skb_cb->paddr = dma_map_single(dev, skb->data, skb->len, DMA_TO_DEVICE); if (ar->dev_type != ATH10K_DEV_TYPE_HL) {
skb_cb->paddr = dma_map_single(dev, skb->data, skb->len,
DMA_TO_DEVICE);
ret = dma_mapping_error(dev, skb_cb->paddr); ret = dma_mapping_error(dev, skb_cb->paddr);
if (ret) { if (ret) {
ret = -EIO; ret = -EIO;
goto err_credits; goto err_credits;
} }
}
sg_item.transfer_id = ep->eid; sg_item.transfer_id = ep->eid;
sg_item.transfer_context = skb; sg_item.transfer_context = skb;
...@@ -157,6 +161,7 @@ int ath10k_htc_send(struct ath10k_htc *htc, ...@@ -157,6 +161,7 @@ int ath10k_htc_send(struct ath10k_htc *htc,
return 0; return 0;
err_unmap: err_unmap:
if (ar->dev_type != ATH10K_DEV_TYPE_HL)
dma_unmap_single(dev, skb_cb->paddr, skb->len, DMA_TO_DEVICE); dma_unmap_single(dev, skb_cb->paddr, skb->len, DMA_TO_DEVICE);
err_credits: err_credits:
if (ep->tx_credit_flow_enabled) { if (ep->tx_credit_flow_enabled) {
......
...@@ -1123,6 +1123,7 @@ int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *msdu) ...@@ -1123,6 +1123,7 @@ int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)
return 0; return 0;
err_unmap_msdu: err_unmap_msdu:
if (ar->dev_type != ATH10K_DEV_TYPE_HL)
dma_unmap_single(dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); dma_unmap_single(dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE);
err_free_txdesc: err_free_txdesc:
dev_kfree_skb_any(txdesc); dev_kfree_skb_any(txdesc);
......
...@@ -95,6 +95,7 @@ int ath10k_txrx_tx_unref(struct ath10k_htt *htt, ...@@ -95,6 +95,7 @@ int ath10k_txrx_tx_unref(struct ath10k_htt *htt,
wake_up(&htt->empty_tx_wq); wake_up(&htt->empty_tx_wq);
spin_unlock_bh(&htt->tx_lock); spin_unlock_bh(&htt->tx_lock);
if (ar->dev_type != ATH10K_DEV_TYPE_HL)
dma_unmap_single(dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); dma_unmap_single(dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE);
ath10k_report_offchan_tx(htt->ar, msdu); ath10k_report_offchan_tx(htt->ar, msdu);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment