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: 10138269 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 ABDCB605B4 for ; Sun, 31 Dec 2017 17:32:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 930612886B for ; Sun, 31 Dec 2017 17:32:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 878C52887B; Sun, 31 Dec 2017 17:32:19 +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=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D4DA62887A for ; Sun, 31 Dec 2017 17:32:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=eHnzd9SEoo91pBF1rtc28NpB5Yfi6zn9RWiBmxbYEPs=; b=E+/wFuaaXHV0DFhFNG6Z7Wipcw wGo66CU5IMgorNrnNqfIaNdBL3OmXnR//guPajoe8fatVqPlLEo8wS6iZs/yPpZKfs3/zRgNvegCU VqkETQqrnEkiHgu5fmcnBTU9Lh5zfFO32nBgWDMjlsBz4ZY770hl0+0skS5il00QiFqVPYS5BplII SHV0HujhXKYoP2QRRFz3HAxyu+KACwpxE7FzPuq2Itc9B0b9xEuOA3q4gHreaT8nzC2GLwy7nGn1E kXW5QjM/G47KNLN6ZsvpbC6BX5Gv7mCk53fHPPT6eIMYgci/q/wQ1xk1ktQ6hmBDmUt/eTLt1fc72 ZrLJYxrQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eVhSy-0006Bq-FC; Sun, 31 Dec 2017 17:32:08 +0000 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eVhSd-0005z4-85 for ath10k@lists.infradead.org; Sun, 31 Dec 2017 17:31:51 +0000 Received: by mail-lf0-x241.google.com with SMTP id y71so1215152lfd.12 for ; Sun, 31 Dec 2017 09:31:41 -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=d+X40jCOnYVEHlYPS1eYJqHd7kribojqfZckQqQmYBZGIjI7ZjErpfEegGIgJLzSi8 nl1WLoAqP3KK5M9BaRN6uJLniX6OZvUhePZHE7Jcae2GqzxAIJ8AxYB4T4SMkFoJtkV1 1+aT8buvGqBKWOd1O9q1z5Ag3a78MKRNwgLpKVIMmMsfrff/+mmWC5xjN30RnlehZaah OJcWqnv/HlnLEUQd/NL9/jU9f0KvftveoIkYjFFmcLv4BCDAefKIv7y7XrFVcM2uPp74 4t7SNySuxnwDqTZqXe7iBhCGz28bXA+rPvBO/17eHkX7DXwEa2VXGqvV34frGljSYBcW 4O6w== X-Gm-Message-State: AKGB3mJrL0Z5UpYdWRQJgwdfmFeu67S7v8OMbW6TlSt+3G9aqbaCF8Xg PSlIHgFwZ9zVgguQb1Witt39RA== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171231_093147_430113_75A82E0C X-CRM114-Status: GOOD ( 10.60 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Erik Stromdahl MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.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);