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: 9585045 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 799DD6042F for ; Tue, 21 Feb 2017 16:17:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6775C200F5 for ; Tue, 21 Feb 2017 16:17:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B01527BFF; Tue, 21 Feb 2017 16:17:05 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 04763200F5 for ; Tue, 21 Feb 2017 16:17:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753828AbdBUQRE (ORCPT ); Tue, 21 Feb 2017 11:17:04 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:34299 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753773AbdBUQQf (ORCPT ); Tue, 21 Feb 2017 11:16:35 -0500 Received: by mail-lf0-f67.google.com with SMTP id h67so3752539lfg.1 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=aGuJCHWlHOaPkmhdTk7BlqJugmX/hlYHt40GkXST1gO5kM9Ile/sgnEUF6hfV0mtwK WT8JWx7nsbResdCpy9wlFe9g8EplaZ+a+H9We8HqDPpV5z8PUgbkNi4gpSYy+XoeeHum PZ3qHqR1ip2NzVJL8L5jAHqZR65LrK5lJpeBanLdx5KNpj5GN6T+JVZePlWresrTIhqf oIE3MTrfnNdTYc8mPo936jqqW0E4/ISCcVF5rpFBs3Fug5HxsS7kE2Rh1jX0BP920Kge +Hpq2nUny/GeXp+xgdndOuOk8uCwf6RRcwwzwAfVB8kP07n2wuv4Dj64ZBPpAF5X+R0H vNEA== X-Gm-Message-State: AMke39kNVKcOaqoyMU7fIJ0tOiyfTLdtvdeXkF43KNFrYmSV8dMcssnh8gKbkebtYlSthA== 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 Cc: Erik Stromdahl 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> 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 | 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);