From patchwork Sun May 21 19:59:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 9739269 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 10C7460392 for ; Sun, 21 May 2017 20:02:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00C1628598 for ; Sun, 21 May 2017 20:02:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9CB6285E2; Sun, 21 May 2017 20:02:03 +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 178A4285A3 for ; Sun, 21 May 2017 20:02:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932248AbdEUUB4 (ORCPT ); Sun, 21 May 2017 16:01:56 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:34009 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932173AbdEUUBm (ORCPT ); Sun, 21 May 2017 16:01:42 -0400 Received: by mail-lf0-f67.google.com with SMTP id q24so3696320lfb.1 for ; Sun, 21 May 2017 13:01:36 -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=kE1b2S+haJdTdSyEiWHZGGaSG3lQvWh/hRNmzr9uGjo=; b=jC6FOwE6Hnt0eps74GYrIeW2dr3xDMS++LyQnNnWGWeezSwa/NcCcqI/SVF4D8GlMc 632wyu9XVMAxrwvUCddh0iletgRMJ1zpUwgSiHcbC4KQlLjyhPOEgRCiAkdabhtdATQf BonRkGbG874MM0fy3R+dKyK2y2c68ddIItTJu49CVkLPljVf4ZV+hy1161mx/TeuG963 vumfKTwOicogxYVHQJ2Xv3i8xDCyWK6DAJ4ZG1EgjcWPJVT+Sq73IApshduGnAvNpg1p vZkqjgMHoyo3C7h1HkYcgqmbOsq3DKwHJQKDU07ZpUGUuheBcbtAlWInWttMdYAeykuG PDFA== 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=kE1b2S+haJdTdSyEiWHZGGaSG3lQvWh/hRNmzr9uGjo=; b=gmFSV+FyoNsUHuSCbjQgGCgHxjzsL/dcjSXn0AJKPQrSSdXWE0n7JrISlxWrtWMy9X moFK70nGwC7MRa1WbEojmFPtDM/qvaXrwTXK7DBeo1JVCSGMVkDhna4aJsJ4P42lJ+Qe it0tbMoAOkxxvcEZUiKNZ1/qekT6nni4OxSKI/Rmq/gPB5y/MeV3hVhZAMBFC+DLJ2m8 Sc89dPRorsAsv/iUE24s1rYEltR4JVMDUH4iM7vRbE5Ekw2T/sg6YWS+yNzqYg9mQ4i+ XBDAS06YOzJR5w3msPHj3B7olYVAXrCL5j0nd2oy3WlDsx3RsOuYY9A0NKbuxvoCABjU hjOg== X-Gm-Message-State: AODbwcBBRxfBb4MGzjh3m24HsJ+GOUHO+gl0ZuxlEUQNReMgIckccTgj ONPIYGob0VxYOw== X-Received: by 10.25.27.199 with SMTP id b190mr4377747lfb.24.1495396885484; Sun, 21 May 2017 13:01: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 17sm1821544ljo.56.2017.05.21.13.01.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 21 May 2017 13:01: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 7/9] ath10k: dma fixes for high latency devices Date: Sun, 21 May 2017 21:59:09 +0200 Message-Id: <1495396751-4805-8-git-send-email-erik.stromdahl@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1495396751-4805-1-git-send-email-erik.stromdahl@gmail.com> References: <1495396751-4805-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 31654bd..e1cb754 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -2484,7 +2484,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);