From patchwork Sun Dec 31 17:29:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 10138261 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 02BD160362 for ; Sun, 31 Dec 2017 17:32:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DEF192886B for ; Sun, 31 Dec 2017 17:32:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D3D712887A; Sun, 31 Dec 2017 17:32:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D7F12886B for ; Sun, 31 Dec 2017 17:32:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751186AbdLaRcN (ORCPT ); Sun, 31 Dec 2017 12:32:13 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:40381 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751057AbdLaRbl (ORCPT ); Sun, 31 Dec 2017 12:31:41 -0500 Received: by mail-lf0-f65.google.com with SMTP id u84so32314899lff.7 for ; Sun, 31 Dec 2017 09:31:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bFTehzZe8zdplO2aUwXkHekCfs+oeH7lyiaUre+EQ2s=; b=iVRlVdnwfyKvio2ivPC538QsT/M9i8GJ2jpgN3unH5vRECFTywKr+UVQIUx4pB6FdR OvRGhCSfHbtQM+mmdFOXsTZ4KNonjwBXLcU+P7oiJOGBKVU24Kyz4hxYe2pWVBevTRi8 DHlv0jUXWlC4h1sFHH7uxCd5aLb33tqePY6GyuUzhWn2otV6r7lrTapS+ZSiOyswYrnC A1gdz7bkcwsj/4vCRzehl1E21/TD/a/3TffvmxnQTv1KmlUMEp7cyMWM984DvzxgYAQj rYA2AtkuQKKRnK0/m1/IG4XF95mHo+xsFmjYlplu53sDWxhw+vcxHS+rvZWxjIf2WMUK t+gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=bFTehzZe8zdplO2aUwXkHekCfs+oeH7lyiaUre+EQ2s=; b=WptAc9x2XfCZoZD1aoPpAW+FYJanOeZ6LfqLYRvs4J0N72xrBaGDv9ALpGv1DZHXor PzAw1+S70QXnZXVkKiWx+6sIL42q5S/X/9/MW03uuRrZ90+mMcg/BDLc1LqItPgGQ7GK lJ93SKXcxakItuyFJP/7KWSJ2fMMsXH/BUGVfRrCq8fOiHKtieamzXMp7krZw6TXd0o9 JRmhem2AYLn4gVBrlzB0KV6VIpvViVopbrb4hPZdO++4tqsLCZiTpUKGQF2fFI+NBwk7 e/DHeK4FVeE5k14xic8aYh33NRVDAw8rLEZXY3bIzEXrpvzJ0zNTWQxuXL8J6B1ZHoMv mEHA== X-Gm-Message-State: AKGB3mLtczjzuoRRnPqvVISr0hbfIo5pC/AGnmO/9GW5lRDHLOpBJrkL ZzH/boexz79I+eBiY+cn8PI= X-Google-Smtp-Source: ACJfBovTjxVcs8VEZQescI0PgtlYPUdF/SZHiXA/uOgm/VcibiJren1ons04FjOAl+I0YX1N0YWCSg== X-Received: by 10.25.15.29 with SMTP id e29mr11055784lfi.16.1514741499957; Sun, 31 Dec 2017 09:31:39 -0800 (PST) Received: from localhost.localdomain (90-227-62-61-no75.tbcn.telia.com. [90.227.62.61]) by smtp.gmail.com with ESMTPSA id o64sm5048449lfo.53.2017.12.31.09.31.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 31 Dec 2017 09:31:39 -0800 (PST) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Cc: Erik Stromdahl Subject: [RFC v4 07/18] ath10k: DMA related fixes for high latency devices Date: Sun, 31 Dec 2017 18:29:14 +0100 Message-Id: <20171231172925.24014-8-erik.stromdahl@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171231172925.24014-1-erik.stromdahl@gmail.com> References: <20171231172925.24014-1-erik.stromdahl@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 492dc5b4bbf2..dd69345f911e 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->is_high_latency) + 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->is_high_latency) { + 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->is_high_latency) + 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 a086958c39b6..4d0bfb47d162 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->is_high_latency) + 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 5b3b021526ab..febc3eb93fbd 100644 --- a/drivers/net/wireless/ath/ath10k/txrx.c +++ b/drivers/net/wireless/ath/ath10k/txrx.c @@ -94,7 +94,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->is_high_latency) + dma_unmap_single(dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); ath10k_report_offchan_tx(htt->ar, msdu);