From patchwork Mon Jun 12 15:03:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 9781325 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 E450860212 for ; Mon, 12 Jun 2017 15:03:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D009226E51 for ; Mon, 12 Jun 2017 15:03:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C4E5728633; Mon, 12 Jun 2017 15:03:43 +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 6DA6B26E51 for ; Mon, 12 Jun 2017 15:03:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752568AbdFLPDi (ORCPT ); Mon, 12 Jun 2017 11:03:38 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:36166 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751974AbdFLPD1 (ORCPT ); Mon, 12 Jun 2017 11:03:27 -0400 Received: by mail-lf0-f67.google.com with SMTP id x81so9673592lfb.3 for ; Mon, 12 Jun 2017 08:03:26 -0700 (PDT) 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=OzghGcB3kc3ScDuk5+VA5I7iSWAcgwcLvFNMpjoHUag=; b=Yl8mbQQEmL6vld8XUklyZmHmtRTDjKwaMUFH3boyZNwgAN/Ee0EAm/CnLLQvtFnnaD G2vsBdjQ8ib+CdkkVu+hsdzkPX6JSGIxUt7zk+p3AjOoFyvmU4zlVQ/NW+ny8+CbGHCh AW9iLP5O0bz+g3BsVGam5u9cwS+24wNvUMgOUhmiLTh0B2GqRd05bIcgSigevhrcFqwO uYDvQE7G+EUvsVSLA7j9+UjB1qAGE0QseyBgZTvErRYkDVaq5BIFG+/dXepSHVO6zKEQ YtISnXSIGsIwbp3jR3+dunfKNphtn0cLl9ZuCV8vbSPwJ4EgXoP/dQyXnNXPmeQqvQ/a sYkA== 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=OzghGcB3kc3ScDuk5+VA5I7iSWAcgwcLvFNMpjoHUag=; b=MTNHXGRDMYmxkyK8pZHnvRz3O9/l5nL6RSpbeAebvFUKNJNJjVfWxQbVqC4BZttHrI yJZp3gOsRE3CTrW+O7g2jEy9vNSTjb/wDlXOBeuygwsRGwmfTRToGyhA4RsFFLjrT42o BC86gU/zAM1smFWEWBQBtJGdud3rKml1NTaacgti7F/SMtMA5q/ptHDZskyoTH+j3oy9 PpoGMXhuFbM27P7qzZV5qkJdZN2+9HY6a1IM0NUtK3tT9vc5qp4nGyP1NPggXtIWuy0c 0EVqzDAKxfzPjpH8QKTP0PtOsZC087S5mMyItvcVrrFx+Xqgpgou94K9Dv5SCQwRyojK Grrg== X-Gm-Message-State: AODbwcBh3rqxTdjuzj8pXdO6VCMaYY/N+qHYaJH0ruqHW3o0BJn2L/69 gzeYjvfkkZZYJQ== X-Received: by 10.25.39.194 with SMTP id n185mr11159101lfn.48.1497279805881; Mon, 12 Jun 2017 08:03:25 -0700 (PDT) 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 n71sm2709253lje.14.2017.06.12.08.03.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Jun 2017 08:03:25 -0700 (PDT) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Cc: Erik Stromdahl Subject: [RFC v2 07/10] ath10k: dma fixes for high latency devices Date: Mon, 12 Jun 2017 17:03:08 +0200 Message-Id: <1497279791-9598-8-git-send-email-erik.stromdahl@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497279791-9598-1-git-send-email-erik.stromdahl@gmail.com> References: <1497279791-9598-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 e5c80f5..232740c 100644 --- a/drivers/net/wireless/ath/ath10k/htc.c +++ b/drivers/net/wireless/ath/ath10k/htc.c @@ -137,11 +137,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 5833c08..972c21c 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -2492,7 +2492,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 e3b820d..27bbc3e 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 d4986f6..fae143e 100644 --- a/drivers/net/wireless/ath/ath10k/txrx.c +++ b/drivers/net/wireless/ath/ath10k/txrx.c @@ -90,11 +90,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);