From patchwork Tue Feb 21 16:15:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 9585073 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 E36016042F for ; Tue, 21 Feb 2017 16:17:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0F2828527 for ; Tue, 21 Feb 2017 16:17:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C59E9285C6; Tue, 21 Feb 2017 16:17:50 +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=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM 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 7D4BA28527 for ; Tue, 21 Feb 2017 16:17:50 +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=HpOMpzjHeGSwHUsxH2TYoZNXimd5LHmF24natjxctuY=; b=VVd37zM5hkOxsuhIWvO9gmKvlW R7wRjxnfw1UcN7Py/KXcJQMfKLs+hrUkpf+XBYHFmI5bskiuuhR+844HbMNPUznf7v3UFtax/uXCn 1bINCdgkQFcfI5sTigiTkshV4k+MxFVnpf8+QC2g/FHubTzzyNdguRuIIDdByqvACfxLL0QJIIhyx anUjKN38AVSbPBmFkQgWLwNBtlfw1YdvTWUSs2dDPBgVNlN9ZZDC4+GZu/8re3aE4/IfiT4MdruIs M3WEA8Z5LIf8eGLyhWsU791Irjb756nJlocmxKG4GWc0RAD0TlLA/JKVkeE7DUQVU4Ph6ekfegu/D A9yVUzrg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cgD8K-0007lu-WB; Tue, 21 Feb 2017 16:17:45 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cgD7Z-00075k-Ip for ath10k@bombadil.infradead.org; Tue, 21 Feb 2017 16:16:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=P6XUticUNfntKzb0IiXh7KiynWwWAbNRRvG9ZPid09I=; b=mTEqrWvCu31xUn3TcgwOcLPHB rISrd//851z/ocxuUYGH/ISP4OaP0mYtzDF1Y5xiiDMuCQOlG6lrIU7bQz1WxrpuUDuVxCHYjoJDd dmsTvXKBJgoG194Y5F5CwgTo0xLizly6RiRBFnoknVH4p5AzvnWUJ4wdviHNHaxcYgHfpYMhx6zl2 +HmnwDKZkfdmF1symiYHCPC+pukHi8+a3QzjUT5vqvC7eQZJ5fz76K4me3I2t1xCNmAqD5VtgBOTH /5pp+Np7gEyTWxRBu01H3zRzS35TVYWhktgoTz6sD/D+ZY1HTHLeVoO10uFlMVbB6x+o6tAJmgJ9r irHNlGlnw==; Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cgD7Y-0007HT-0o for ath10k@lists.infradead.org; Tue, 21 Feb 2017 16:16:56 +0000 Received: by mail-lf0-x244.google.com with SMTP id 86so5300599lfv.0 for ; Tue, 21 Feb 2017 08:16:35 -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=P6XUticUNfntKzb0IiXh7KiynWwWAbNRRvG9ZPid09I=; b=u1COYZhHknjnSzUKX3Hn947eKP9BZPvWjXiLJBb124b8LZv5o82yVv2Y2afYQ0V0ZK JFMcTUgJDHB2kk5AQ6jRRMaSwih/pVvxBCMB9AfSRIxTPCJ3FUJCYO8ln3KtlySckkrY IAv/PgEAgZuru5XMk8IDYsx4jG2KUC5tNj8map6J0de0DB5wrb6JVYzZf+ITzXtviMsP SpCDvocFcWZfYWdnshjcMKaeOGzUtUJfkntXNdW1RBbENrkrLZd6jy8hI4taiueiffRx GU0Y/rwEcC9eomdOkyPOv5fPxxyJ/EWx6HGCh9YynYf5nQCHymSPtAwafObRrY4+Qmfv YfWQ== 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=P6XUticUNfntKzb0IiXh7KiynWwWAbNRRvG9ZPid09I=; b=pvJgulb8xQwbZMSpAr5NWAQyHTcOEM304qpXSu/C5l1yfZxUyYZK1j2kJs1rUjarZA xgDJZyvkEu9Qk+5Ur6cZWfLXOWm+CgWJ61fT645wKFIjN0j/52h31otXAFaet95Gyxht KTxAPbo+B8dsGXQ9bhxHEKAMdXR38ShOQ31nZOTDSzHZzlrxBwe3cUrXp/ue+S1tRgK2 11qYBJmhkM4z2rL3QASQHuFKGUIyQ3zBsnCWhjmPKK+BxzniPEM+ojze5y3HvuieK/ol v0F+99lRBtwAmxN8o14SVZ5FdLQrgcPW7u12vOLc5SFaMauV5F5nw9CmggByGcRTn4sP PgVg== X-Gm-Message-State: AMke39lLNJU50gHOy77xli++R34wVRjZHqeV3Fvk/fv1X3sphj7fbUiOid7c1HAnT+3yKQ== X-Received: by 10.25.211.7 with SMTP id k7mr7709855lfg.62.1487693793671; Tue, 21 Feb 2017 08:16:33 -0800 (PST) Received: from erik-mate-1604.lan (90-227-62-61-no75.tbcn.telia.com. [90.227.62.61]) by smtp.gmail.com with ESMTPSA id t29sm6336069ljd.39.2017.02.21.08.16.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Feb 2017 08:16:33 -0800 (PST) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Subject: [RFC v4 21/21] ath10k: dma fixes for high latency devices Date: Tue, 21 Feb 2017 17:15:41 +0100 Message-Id: <1487693741-10042-22-git-send-email-erik.stromdahl@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487693741-10042-1-git-send-email-erik.stromdahl@gmail.com> References: <1487693741-10042-1-git-send-email-erik.stromdahl@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170221_111656_232776_44377004 X-CRM114-Status: UNSURE ( 9.65 ) X-CRM114-Notice: Please train this message. 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 | 13 ++++++++----- drivers/net/wireless/ath/ath10k/htt_rx.c | 3 ++- drivers/net/wireless/ath/ath10k/htt_tx.c | 3 +++ drivers/net/wireless/ath/ath10k/txrx.c | 5 +++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htc.c b/drivers/net/wireless/ath/ath10k/htc.c index 3eaa9a8..b5fddd7 100644 --- a/drivers/net/wireless/ath/ath10k/htc.c +++ b/drivers/net/wireless/ath/ath10k/htc.c @@ -134,11 +134,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; diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index c90570f..96e73b4 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -2485,7 +2485,8 @@ bool ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb) break; } case HTT_T2H_MSG_TYPE_TX_COMPL_IND: - ath10k_htt_rx_tx_compl_ind(htt->ar, skb); + if (!ar->is_high_latency) + ath10k_htt_rx_tx_compl_ind(htt->ar, skb); break; case HTT_T2H_MSG_TYPE_SEC_IND: { struct ath10k *ar = htt->ar; diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c index a714aa8..190d002 100644 --- a/drivers/net/wireless/ath/ath10k/htt_tx.c +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c @@ -409,6 +409,9 @@ int ath10k_htt_tx_start(struct ath10k_htt *htt) if (htt->tx_mem_allocated) return 0; + if (ar->is_high_latency) + return 0; + ret = ath10k_htt_tx_alloc_buf(htt); if (ret) goto free_idr_pending_tx; diff --git a/drivers/net/wireless/ath/ath10k/txrx.c b/drivers/net/wireless/ath/ath10k/txrx.c index 9852c5d..5e27f6da 100644 --- a/drivers/net/wireless/ath/ath10k/txrx.c +++ b/drivers/net/wireless/ath/ath10k/txrx.c @@ -89,11 +89,12 @@ int ath10k_txrx_tx_unref(struct ath10k_htt *htt, ath10k_htt_tx_free_msdu_id(htt, tx_done->msdu_id); ath10k_htt_tx_dec_pending(htt); - if (htt->num_pending_tx == 0) + if (!ar->is_high_latency && (htt->num_pending_tx == 0)) 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);