From: Erik Stromdahl <erik.stromdahl@gmail.com>
To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org,
ath10k@lists.infradead.org
Cc: Erik Stromdahl <erik.stromdahl@gmail.com>
Subject: [RFC v5 06/12] ath10k: DMA related fixes for high latency devices
Date: Sun, 3 Jun 2018 20:20:23 +0200 [thread overview]
Message-ID: <20180603182029.8914-7-erik.stromdahl@gmail.com> (raw)
In-Reply-To: <20180603182029.8914-1-erik.stromdahl@gmail.com>
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>
---
drivers/net/wireless/ath/ath10k/htc.c | 19 ++++++++++++-------
drivers/net/wireless/ath/ath10k/htt_tx.c | 3 ++-
drivers/net/wireless/ath/ath10k/txrx.c | 3 ++-
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 8902720b4e49..b47e0547f767 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,
{
struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb);
- dma_unmap_single(htc->ar->dev, skb_cb->paddr, skb->len, DMA_TO_DEVICE);
+ if (htc->ar->dev_type != ATH10K_DEV_TYPE_HL)
+ dma_unmap_single(htc->ar->dev, skb_cb->paddr, skb->len, DMA_TO_DEVICE);
skb_pull(skb, sizeof(struct ath10k_htc_hdr));
}
@@ -137,11 +138,14 @@ int ath10k_htc_send(struct ath10k_htc *htc,
ath10k_htc_prepare_tx_skb(ep, skb);
skb_cb->eid = eid;
- skb_cb->paddr = dma_map_single(dev, skb->data, skb->len, DMA_TO_DEVICE);
- ret = dma_mapping_error(dev, skb_cb->paddr);
- if (ret) {
- ret = -EIO;
- goto err_credits;
+ 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);
+ if (ret) {
+ ret = -EIO;
+ goto err_credits;
+ }
}
sg_item.transfer_id = ep->eid;
@@ -157,7 +161,8 @@ int ath10k_htc_send(struct ath10k_htc *htc,
return 0;
err_unmap:
- dma_unmap_single(dev, skb_cb->paddr, skb->len, DMA_TO_DEVICE);
+ if (ar->dev_type != ATH10K_DEV_TYPE_HL)
+ dma_unmap_single(dev, skb_cb->paddr, skb->len, DMA_TO_DEVICE);
err_credits:
if (ep->tx_credit_flow_enabled) {
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 5d8b97a0ccaa..79a8eca46e88 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -1125,7 +1125,8 @@ int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)
return 0;
err_unmap_msdu:
- dma_unmap_single(dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE);
+ if (ar->dev_type != ATH10K_DEV_TYPE_HL)
+ dma_unmap_single(dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE);
err_free_txdesc:
dev_kfree_skb_any(txdesc);
err_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,
wake_up(&htt->empty_tx_wq);
spin_unlock_bh(&htt->tx_lock);
- dma_unmap_single(dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE);
+ if (ar->dev_type != ATH10K_DEV_TYPE_HL)
+ dma_unmap_single(dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE);
ath10k_report_offchan_tx(htt->ar, msdu);
--
2.17.0
next prev parent reply other threads:[~2018-06-03 18:22 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-03 18:20 [RFC v5 00/12] ath10k high latency Erik Stromdahl
2018-06-03 18:20 ` [RFC v5 01/12] ath10k: add struct ath10k_bus_params Erik Stromdahl
2018-09-06 16:16 ` Kalle Valo
[not found] ` <20180906161624.B4751606FA@smtp.codeaurora.org>
2018-09-06 18:22 ` Erik Stromdahl
2018-10-06 11:34 ` Kalle Valo
2018-06-03 18:20 ` [RFC v5 02/12] ath10k: add device type enum to ath10k_bus_params Erik Stromdahl
2018-06-03 18:20 ` [RFC v5 03/12] ath10k: add bus type check in ath10k_init_hw_params Erik Stromdahl
2018-06-03 18:20 ` [RFC v5 04/12] ath10k: use hw_params.num_peers for num_tids in TLV init Erik Stromdahl
2018-06-03 18:20 ` [RFC v5 05/12] ath10k: add per target config of max_num_peers Erik Stromdahl
2018-06-03 18:20 ` Erik Stromdahl [this message]
2018-06-03 18:20 ` [RFC v5 07/12] ath10k: add HTT TX HL ops Erik Stromdahl
2018-06-03 18:20 ` [RFC v5 08/12] ath10k: add HTT RX " Erik Stromdahl
2018-06-03 18:20 ` [RFC v5 09/12] ath10k: htt: RX ring config HL support Erik Stromdahl
2018-06-03 18:20 ` [RFC v5 10/12] ath10k: htt: High latency TX support Erik Stromdahl
2018-06-03 18:20 ` [RFC v5 11/12] ath10k: htt: High latency RX support Erik Stromdahl
2018-06-03 18:20 ` [RFC v5 12/12] ath10k: wmi: disable softirq's while calling ieee80211_rx Erik Stromdahl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180603182029.8914-7-erik.stromdahl@gmail.com \
--to=erik.stromdahl@gmail.com \
--cc=ath10k@lists.infradead.org \
--cc=kvalo@qca.qualcomm.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).